[wp-trac] [WordPress Trac] #15677: It is not possible to install multiple variants of the same language

WordPress Trac noreply at wordpress.org
Wed Oct 9 00:52:07 UTC 2013


#15677: It is not possible to install multiple variants of the same language
--------------------------+-----------------------------
 Reporter:  caesarsgrunt  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  I18N          |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+-----------------------------

Comment (by iandunn):

 I've attached a first attempt at this, using `locales.php` from GlotPress
 to define the locales. I've got it running on WordCamp.org and it seems to
 be doing fine. The only issue is going to be backcompat, since the
 structure of the array has changed some.

 e.g., `$lang_codes['pt']` is now split into `$lang_codes['pt_PT']` and
 `$lang_codes['pt_BR']`. There are some similar changes with other
 languages as well.

 The could bite a plugin that's calling `format_code_lang()` directly, or
 using the `lang_codes` filter, since the input/output wouldn't always
 match what they're expecting anymore.

 One inelegant solution would be to go through all the codes one by one,
 determine which ones have changed, and add duplicate entries for them in
 the array. That would be kind of lame, though, so I'm hoping someone has a
 better idea.

 As far as updating the locales goes, it should be fairly easy to diff our
 version of the file against the original to bring in any updates.

 I didn't internationalize the locale names since there's already a
 separate ticket for that (#19760), but it should be trivial to wrap them
 in `__()` in `locales.php`. Maybe even do it upstream to make maintenance
 easier.

 If this is committed, it'd also fix #13069.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/15677#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list