[glotpress-updates] [GlotPress] #342: Cleanup to locales.php

GlotPress noreply at wordpress.org
Wed Jul 9 22:07:18 UTC 2014

#342: Cleanup to locales.php
  Reporter:  stuwest             |      Owner:
      Type:  enhancement         |     Status:  new
  Priority:  normal              |  Milestone:
 Component:  locale information  |    Version:
Resolution:                      |   Keywords:

Comment (by stuwest):

 Replying to [comment:7 nacin]:

 Added another pass at a diff.  Fixed the mentioned issues, limited scope,
 and was more careful with diff noise. locales-clean-up-take-two.diff

 1. added variable declaration for $ltr as it is is used down in
 GP_Locales() (it appears to be duplicate of $text_direction which is
 declared but not used in GP_Locales(); do we really need both $rtl and
 2. added $CLDR_locale which matches the name of relevant CLDR file
 3. added $fallback which, as a first pass for an approach to fallbacks,
 takes the single level of fallbacks from Mediawiki
 4. added $mysql_collation to facilitate improved sorting of different
 languages (based on https://dev.mysql.com/doc/refman/5.0/en/charset-
 5. updated English and native names based on CLDR (I excluded pt_PT from
 the check for updated native name since it sounds like we're confident
 that one is well thought out.)
 6. generally cleaned up items within GP_Locales() to make ordering of
 items consistent, fix some spacing, remove blank country codes, and remove
 redundant "null" declarations, fix to Maori 639-1 code, removing erroneous
 reference to 'de' in the variable block for 'de-ch', country code for es-

 BTW, I used a script to generate this. Basic approach was to call
 GP_Locales() and then rebuild a new set of objects from the array it
 returns. Script relies on local copies of a few things a) the CLDR files,
 b) the country/language/etc extracts I've previously extracted from the
 CLDR file c) some tweaks to a local copy of the old locales.php, and d)
 the set of messages files where Mediawiki stores fallback data.

 future tickets might bite off:
 - additional CLDR items
 - if we need BCP 47 tags for Accept Headers, maybe we call them those
 instead of trying to keep a list of ISO 639 codes. Better yet, there's
 probably a generalized model for codes we can adopt rather than storing
 separate ones for each service or even a separate BCP 47 and Unicode ones.
 - it's confusing that we use one object name inside GP Locales () but
 whenever that function is called the key in the array switches to
 something different. In most cases it's the slug with '_' instead of '-'
 but there are some exceptions: the slugs bel and mya switch to their two
 digit code, the slug rw switches to its three digit code, the slugs bn and
 tt switch to their full wp_locale, and the slug fuc switches to 'ff_sn'.
 I'd love to clean all that up.

Ticket URL: <https://glotpress.trac.wordpress.org/ticket/342#comment:11>
GlotPress <https://glotpress.trac.wordpress.org>
Easy comin', easy goin'

More information about the glotpress-updates mailing list