[wp-trac] [WordPress Trac] #28303: How to handle default/formal translations for automatic upgrades?

WordPress Trac noreply at wordpress.org
Tue Aug 18 12:51:33 UTC 2015


#28303: How to handle default/formal translations for automatic upgrades?
------------------------------------------+----------------------
 Reporter:  zodiac1978                    |       Owner:  ocean90
     Type:  task (blessed)                |      Status:  closed
 Priority:  normal                        |   Milestone:  4.3
Component:  I18N                          |     Version:
 Severity:  normal                        |  Resolution:  fixed
 Keywords:  has-patch meta needs-testing  |     Focuses:
------------------------------------------+----------------------

Comment (by rkoller):

 Regarding the filenaming scheme for variant cases like the german formal
 @zodiac1978 asked me to post a link and a few lines regarding that matter.
 Bottom line to use e.g. de_DE at formal.po instead of de_DE_formal .
 Underneath are a link and a few liner notes by vaclav from poedit who
 brought the whole file name issue to my attention

 https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html

 """
 Language

 Fill in the language code of the language. This can be in one of three
 forms:

         • - ‘ll’, an ISO 639 two-letter language code (lowercase). See
 Language Codes for the list of codes.
         • - ‘ll_CC’, where ‘ll’ is an ISO 639 two-letter language code
 (lowercase) and ‘CC’ is an ISO 3166 two-letter country code (uppercase).
 The country code specification is not redundant: Some languages have
 dialects in different countries. For example, ‘de_AT’ is used for Austria,
 and ‘pt_BR’ for Brazil. The country code serves to distinguish the
 dialects. See Language Codes and Country Codes for the lists of codes.
         • - ‘ll_CC at variant’, where ‘ll’ is an ISO 639 two-letter language
 code (lowercase), ‘CC’ is an ISO 3166 two-letter country code (uppercase),
 and ‘variant’ is a variant designator. The variant designator (lowercase)
 can be a script designator, such as ‘latin’ or ‘cyrillic’.

 The naming convention ‘ll_CC’ is also the way locales are named on systems
 based on GNU libc. But there are three important differences:

         • In this PO file field, but not in locale names, ‘ll_CC’
 combinations denoting a language’s main dialect are abbreviated as ‘ll’.
 For example, ‘de’ is equivalent to ‘de_DE’ (German as spoken in Germany),
 and ‘pt’ to ‘pt_PT’ (Portuguese as spoken in Portugal) in this context.
         • In this PO file field, suffixes like ‘.encoding’ are not used.
         • In this PO file field, variant designators that are not relevant
 to message translation, such as ‘@euro’, are not used.

 So, if your locale name is ‘de_DE.UTF-8’, the language specification in PO
 files is just ‘de’.
 """


 The filenames used by convention use the same designation. WordPress has
 its own conventions in places, but generally follows this, see the plugin
 files' naming in the form of "slug-locale.mo".

 The more common convention in the gettext world is to use
 $prefix/share/locale/$lang/LC_MESSAGES directory and the @ convention is
 used there too. See some of the gettext translations installed on my
 system:

         /usr/local/share/locale/cs/LC_MESSAGES/glib20.mo
         /usr/local/share/locale/cs/LC_MESSAGES/gnupg.mo
         …
         /usr/local/share/locale/sr/LC_MESSAGES/glib20.mo
         /usr/local/share/locale/sr/LC_MESSAGES/sed.mo
         /usr/local/share/locale/sr at latin/LC_MESSAGES/glib20.mo
         …
         /usr/local/share/locale/ca at valencia/LC_MESSAGES/glib20.mo

 You can find the same on pretty much any modern Unix (Linux or *BSD) in
 their respective /usr/share/locale folders too.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28303#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list