Make WordPress Core

Opened 16 years ago

Closed 12 years ago

#6007 closed enhancement (fixed)

Template Name et al not localizable

Reported by: steveagl's profile SteveAgl Owned by: hansengel's profile hansengel
Milestone: 3.4 Priority: normal
Severity: minor Version: 2.5
Component: I18N Keywords:
Focuses: Cc:


In theme editor the tempalte description for archives.php and links.php are correctly gettext but even if tanslated in po file they don't translate.

Attachments (2)

6007.r7098.diff (1.7 KB) - added by hansengel 16 years ago.
Translates file descriptions before showing in theme editor
6007.diff (12.2 KB) - added by nacin 12 years ago.

Download all attachments as: .zip

Change History (20)

#1 @nbachiyski
16 years ago

  • Component changed from Administration to i18n
  • Severity changed from major to minor

16 years ago

Translates file descriptions before showing in theme editor

#2 @hansengel
16 years ago

  • Keywords has-patch added
  • Owner changed from anonymous to hansengel
  • Status changed from new to assigned

Actually, SteveAgl, the theme file descriptions aren't translated at all. I attached a patch to add translation functionality.

#3 @ryan
16 years ago

You can only pass literal strings to ().

These strings should be translated when $wp_file_descriptions is defined. By the time file.php is loaded, the gettext system should be fully initialized. I'd like to understand why that is apparently not working.

If we can't figure that out, we can change your patch to use translate() instead of ().

#4 @ryan
16 years ago

Oh, we're talking about templates with "Template Name:" in them. The template would have to make a dummy call to () somewhere to get the string in the template. If that is done, then changing your patch to use translate() will work.

#5 @ryan
16 years ago

Actually, it might be better to have get_file_description() do this:

return translate($name[1]);

#6 @ryan
16 years ago

  • Milestone changed from 2.5 to 2.6

Actually, we'd have to call translate with the proper domain for the theme. We're getting into the same issue as with plugins. We've pushed that fix to 2.6, so I'll push this one as well.

#7 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.9 to Future Release
  • Type changed from defect (bug) to enhancement

#8 @Denis-de-Bernardy
15 years ago

  • Summary changed from Gettexted file do no translate to Template Name et al not localizable

#9 @solarissmoke
13 years ago

  • Keywords close added; needs-patch removed

Is this still an issue?

#11 @nacin
12 years ago

  • Keywords close removed
  • Milestone changed from Future Release to 3.4

Let's do this and #15858.

Steps to complete this ticket:

  1. Run translate() over these.
  1. Leverage a Text Domain header (where #15858 comes in).
  1. Extract Template Name from individual template files and add them to the pot, which would require some improvements to

#12 @Mamaduka
12 years ago

  • Cc georgemamadashvili@… added

#13 @nacin
12 years ago

In [19968]:

Add template names to theme pots. see #6007.

#15 @nacin
12 years ago

15858.diff:ticket:15858 more or less fixes this.

12 years ago

#16 @nacin
12 years ago

Since #15858 is a mess, 6007.diff targets just this ticket. A lot of the rewrite of get_theme_data() is from #15858.

#17 @nacin
12 years ago

In [20029]:

Introduce WP_Theme, wp_get_themes(), and wp_get_theme() to replace get_themes(), get_theme(), get_theme_data(), current_theme_info(), and others.

  • Getters and Helpers: Introduces a series of methods to allow for easy generation of headers for display, and other theme metadata, including page templates.
  • Screenshots: Handles support for multiple screenshots. (see # Additional screenshots must be PNG and start with screenshot-2.png, and be sequential to be counted. see #19816.
  • Error Handling: Broken themes have a WP_Error object attached to them.
  • Caching: Introduces a wp_cache_themes_persistently filter (also in [20020]) to enable persistent caching of all filesystem and sanitization operations normally handled by WP_Theme (and formerly get_file_data() and get_themes()). Themes are cached individually and across five different cache keys for different data pieces.
  • Compatibility: A WP_Theme object is backwards compatible with a theme's array formerly returned by get_themes() and get_theme(), and an stdClass object formerly returned by current_theme_info().
  • i18n/L10n: Theme headers are now localizable with proper Text Domain and Domain Path headers, like plugins. (Language packs may remove the requirement for headers.) For page templates, see #6007 (not fixed yet, but will be easy now). For headers, fixes #15858.
  • PHP and CSS files: New methods that fetch a list of theme files (for the theme editor) only on demand, rather than only loading them into memory. fixes #11214.

Functions deprecated:

  • get_themes(), get_allowed_themes() and get_broken_themes() -- use wp_get_themes()
  • get_theme() and current_theme_info() -- use wp_get_theme()
  • get_site_allowed_themes() -- use WP_Theme::get_allowed_on_network()
  • wpmu_get_blog_allowedthemes() -- use WP_theme::get_allowed_on_site()

see also [20016], [20018], [20019], [20020], [20021], [20022], [20025], [20026], [20027]. also fixes #19244.

see #20103.

#15 @nacin
12 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [20041]:

Translate page template names! Have WP_Theme::get_page_templates() return templates keyed by filename, not by template name, as it makes more sense. Flip this in get_page_templates() to be compatible. fixes #6007.

Note: See TracTickets for help on using tickets.