Ticket #6007 (accepted enhancement)
Template Name et al not localizable
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | I18N | Version: | 2.5 |
| Severity: | minor | Keywords: | |
| Cc: | georgemamadashvili@… |
Description
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
Change History
comment:1
nbachiyski — 4 years ago
- Component changed from Administration to i18n
- Severity changed from major to minor
-
attachment
6007.r7098.diff
added
Translates file descriptions before showing in theme editor
- 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.
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 ().
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.
Actually, it might be better to have get_file_description() do this:
return translate($name[1]);
- 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.
- Keywords needs-patch added; has-patch removed
- Type changed from defect (bug) to enhancement
- Milestone changed from 2.9 to Future Release
- Summary changed from Gettexted file do no translate to Template Name et al not localizable
comment:9
solarissmoke — 13 months ago
- Keywords close added; needs-patch removed
Is this still an issue?
Related: #15858
comment:11
nacin — 4 weeks ago
- Keywords close removed
- Milestone changed from Future Release to 3.4
Let's do this and #15858.
Steps to complete this ticket:
- Run translate() over these.
- Leverage a Text Domain header (where #15858 comes in).
- Extract Template Name from individual template files and add them to the pot, which would require some improvements to http://i18n.svn.wordpress.org/tools/trunk/pot-ext-meta.php.
comment:13
nacin — 39 hours ago
In [19968]:
comment:14
nacin — 39 hours ago
comment:15
nacin — 36 hours ago
15858.diff:ticket:15858 more or less fixes this.
