WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#15858 closed defect (bug) (fixed)

Twenty Ten i18n - translated strings not visible

Reported by: pavelevap Owned by: brocheafoin
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.1
Component: I18N Keywords: needs-patch
Focuses: Cc:

Description

New ticket for partial problem in http://core.trac.wordpress.org/ticket/14063

There are several strings in .pot file which were translated, but translations not displayed, for example "The 2010 default theme for WordPress." and "the WordPress team".

You can see following discussion here: http://wppolyglots.wordpress.com/2010/11/27/there-are-some-strings-in-twenty-ten-1-3/

Attachments (2)

15858.diff (16.0 KB) - added by nacin 5 years ago.
15858.2.diff (16.0 KB) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (18)

#1 @nacin
7 years ago

  • Keywords needs-patch 3.2-early added
  • Milestone changed from Awaiting Review to Future Release

#2 @nacin
7 years ago

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

(In [17072]) Handle 'This gallery contains X photos' properly in Twenty Ten. fixes #15858.

#3 @nacin
7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

[17072] was meant for #15859.

#4 @SergeyBiryukov
7 years ago

Should we reuse _get_plugin_data_markup_translate() or create a separate function?

#5 @pavelevap
6 years ago

Bump. It was problem for Twenty Ten and now it is also problem for Twenty Eleven. Many translators translate long (important and descriptive) strings, but they do not work. Any chance to solve this for 3.2?

#6 @pavelevap
6 years ago

Also "Showcase Template" and "Sidebar Template" are not translatable (and not in .pot file). And it is not consistent because "Default Template" is translated in core. So users can see translation of "Default Template" and then not translated template names from Twenty Eleven.

#7 @nacin
6 years ago

In get_page_templates(), we would possibly run the string through the theme textdomain.

We don't currently have get_theme_data looking for a textdomain header -- I imagine this means we don't support translated headers for themes the way we do for plugins.

These both sound like 3.3 opportunities.

#8 @pavelevap
6 years ago

OK, I expected that it is probably too late for 3.2, but this problem is very serious from the point of language packs. Users without English knowledge will not understand for example very informative description about Showcase template and other possibilities of Twenty Eleven.

#9 @brocheafoin
6 years ago

  • Owner set to brocheafoin
  • Status changed from reopened to accepted

#10 @SergeyBiryukov
6 years ago

  • Keywords 3.2-early removed
  • Milestone changed from Future Release to 3.4

Related: #19597

#11 @Mamaduka
5 years ago

  • Cc georgemamadashvili@… added

@nacin
5 years ago

#12 @nacin
5 years ago

15858.diff is the beginnings of a fix for #15858 and #6007. I started by adding TextDomain and DomainPath, then fixed up _get_plugin_data_markup_translate() and added a corresponding function for themes. Page templates were translated.

Then it went downhill. (Or down a rabbit hole, you might say.)

  1. get_file_description() is passed an absolute path to a file. Figuring out what theme it belongs to (to ascertain the textdomain) is harder than one might expect.
  1. get_themes() should burn in hell and will likely give me night terrors for the rest of the week. Seriously. I struggled with this mess two years ago during GSoC, and returning to it now makes me want to stab my eyes with a pencil.

Other than that, things are peachy.

@nacin
5 years ago

#13 @nacin
5 years ago

15858.2.diff isn't an improvement. Decided to take a swing at translating the data of get_themes(). You'd think this would work (given that it is not cached), but haha, you'd be wrong. A few places, mainly the theme editor, rely on $theme_data['Name'] to uniquely identify a theme.

The patch does do something else: It takes the list of tags on themes.php and translates them, which is nice.

#14 @ocean90
5 years ago

  • Cc ocean90 added

#15 @nacin
5 years ago

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

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.

#16 @pavelevap
5 years ago

Simply awesome!

I tried to add headers and localization works well. Nice. Do not forget to add headers to all default themes (if needed with Language packs).

Note: See TracTickets for help on using tickets.