Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 5 weeks ago

#41256 closed defect (bug) (invalid)

Core hardcoded translations

Reported by: sisalik's profile sisalik Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords: reporter-feedback close
Focuses: template Cc:


There is so many hardcoded words/texts ("Search", "Search results for", "Tag", "Tags", "Category", "Categories", "Pages" etc) in Wordpress templates (Pages, Posts, General). Instead of hardcoding, they should be in a language table/file. Wordpress needs a function that checks for a metatag "hreflang" or for a language tag in url (default "en" or empty). If any other language tag is found, then use a translation from the table, and if doesn't exist, then use default (en).
This way it's easier to use other language translations or any translation plugins and add own languages. Else every Wordpress update might overwrite these hardcoded translations, that someone has written especially into code instead of English.
Also if there would be an additional admin page to add languages to the table/file, this would make things much more easier.

This is not a translation plugin! It is needed for Wordpress core, instead of template-hardcoded English.

Change History (6)

#1 @DrewAPicture
7 years ago

  • Component changed from General to I18N
  • Focuses accessibility administration performance removed

#2 @johnbillion
7 years ago

  • Keywords reporter-feedback added

Hi @sisalik, welcome to WordPress Trac, and thanks for your ticket.

Can you point to the specific locations of these hardcoded texts please? WordPress has a very well established internationalisation system and there should be no instances of hardcoded English phrases that cannot be translated.

#3 @sisalik
7 years ago

I haven't found these places again, since they won't come up anymore in my code (I edited these places). If I should stumble on them, I will post again.
I remember, that "Search" button and "Search results", also "Tag", "Tags", "Category", "Categories", "Pages" were the problematic places for me. If they have the possibility for translations, then let me know, maybe I was wrong.

#4 @Kau-Boy
7 years ago

Hey @sisalik thanks for reporting back! Those strings you mentioned sound like strings that can usually be found in the frontend. So I would assume, that they have been used in a theme, which was not prepared to be translated or simply lacked a proper translation file.

Can you remember, in which folders you have edited files? The "core" you mainly be in the folders wp-includes and wp-admin whereas the the would usually be found in wp-content/themes.

#5 @knutsp
7 years ago

  • Keywords close added
  • Type changed from feature request to defect (bug)

These strings almost certainly must have been found in a third party theme, not core, not a default theme, based on reporters #comment:3.

So this ticket can very soon be closed as invalid, I think, until some indication they're really in core or in bundeled themes. And if so, it's a bug, no enhacement.

Last edited 7 years ago by knutsp (previous) (diff)

#6 @johnbillion
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Please feel free to reopen this ticket if you do find hard coded strings in WordPress core which can't be translated, but it sounds like these were probably all in a third party theme.

Note: See TracTickets for help on using tickets.