Table of locales: Difference between revisions

From MoodleDocs
m (...hehe...this is really hard. More languages. Finished!)
(Shifted to dev docs)
 
(29 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Template:Work in progress}}
{{Moved_to_dev_docs}}
__NOTOC__
===Introduction===
'''Definition:''' (from [http://en.wikipedia.org/wiki/Locale Wikipedia]) Locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a region identifier.
 
Currently such locales are named differently under Unix-based and Win32-based platforms so we need to have them defined separately to allow Moodle to use them as necessary. For each '''lang package''' available for Moodle, we must specify the '''locale''' value (Unix locale) and the ''localewin''' value (Win32 locale). Both those strings should be (no mandatory) defined inside each Moodle 1.6 and upwards langpack to be able to display locale strings properly.
 
The general syntax for locales is:
 
    language[_country][.charset]
 
(with information under brackets being optional)
 
While the '''.charset''' part seems to work properly under Unix, it seems that is not working under Win32 (at least from PHP), and strings returned from some PHP functions aren't in the charset specified but in some sort of default charset. Let's call it '''localewincharset'''. This forces us to convert from this charset to the current_charset() being used by the user.
 
===Table===
 
So, for each 1.6 Moodle language pack, we'll describe below this columns:
* '''package_name:''' name of the language pack as showed in http://download.moodle.org/lang16/.
* '''lang_name:''' name of the language as showed in http://download.moodle.org/lang16/.
* '''locale:''' locale string to be used under Unix platforms. This will be stored in each language '''langconfig.php''' file.
* '''localewin:''' locale string to be used under Win32 platforms. This will be stored in each language '''langconfig.php''' file.
* '''localewincharset:''' charset in which PHP is retrieving information from locale-dependent functions (strftime...). This will allow us to convert such strings to the final charset properly. This will be stored in each language '''langconfig.php''' file.
 
 
<table align="center" border="1" cellpadding="5">
  <tr>
    <th><b>package_name</b>
    <th><b>lang_name</b>
    <th><b>locale</b>
    <th><b>localewin</b>
    <th><b>localewincharset</b>
  <tr>
    <td>af_utf8
    <td>Afrikaans
    <td><span style="color:red">en.UTF-8</span>
    <td>Afrikaans.1252
    <td>WINDOWS-1252
  <tr>
    <td>sq_utf8
    <td>Albanian
    <td>al.UTF-8
    <td>Albanian_Albania.1250
    <td>WINDOWS-1250
  <tr>
    <td>ar_utf8
    <td>Arabic
    <td><span style="color:red">en.UTF-8</span>
    <td>Arabic.1256
    <td>WINDOWS-1256
  <tr>
    <td>eu_utf8
    <td>Basque
    <td>eu.UTF-8
    <td>Basque_Spain.1252
    <td>WINDOWS-1252
  <tr>
    <td>be_utf8
    <td>Belarusian
    <td><span style="color:red">en.UTF-8</span>
    <td>Belarusian_Belarus.1251
    <td>WINDOWS-1251
  <tr>
    <td>bs_utf8
    <td>Bosnian
    <td>bs.UTF-8
    <td><span style="color:red">Serbian (Latin)</span>
    <td>WINDOWS-1250
  <tr>
    <td>bg_utf8
    <td>Bulgarian
    <td><span style="color:red">en.UTF-8</span>
    <td>Bulgarian_Bulgaria.1251
    <td>WINDOWS-1251
  <tr>
    <td>ca_utf8
    <td>Catalan
    <td>ca_ES.UTF-8
    <td>Catalan_Spain.1252
    <td>WINDOWS-1252
  <tr>
    <td>zh_cn_utf8
    <td>Chinese (Simplified)
    <td>zh_CN.UTF-8
    <td>Chinese_China.936
    <td>CP936
  <tr>
    <td>zh_tw_utf8
    <td>Chinese (Traditional
    <td>zh_TW.UTF-8
    <td>Chinese_Taiwan.950
    <td>CP950
  <tr>
    <td>cs_utf8
    <td>Czech
    <td>cs_CZ.UTF-8
    <td>Czech_Czech Republic.1250
    <td>WINDOWS-1250
  <tr>
    <td>da_utf8
    <td>Danish
    <td>da_DK.UTF-8
    <td>Danish_Denmark.1252
    <td>WINDOWS-1252
  <tr>
    <td>nl_utf8
    <td>Dutch
    <td>nl_NL.UTF-8
    <td>Dutch_Netherlands.1252
    <td>WINDOWS-1252
  <tr>
    <td>en_utf8
    <td>English
    <td>en.UTF-8
    <td>English_Australia.1252
    <td>-empty string-
  <tr>
    <td>en_us_utf8
    <td>English (US)
    <td>-parent en_utf8 used-
    <td>-parent en_utf8 used-
    <td>-parent en_utf8 used-
  <tr>
    <td>et_utf8
    <td>Estonian
    <td>et_EE.UTF-8
    <td>Estonian_Estonia.1257
    <td>WINDOWS-1257
  <tr>
    <td>fa_utf8
    <td>Farsi
    <td><span style="color:red">en.UTF-8</span>
    <td>Farsi_Iran.1256
    <td>WINDOWS-1256
  <tr>
    <td>fil_utf8
    <td>Filipino
    <td> fil.UTF-8
    <td><span style="color:red">Filipino_Philippines.1252</span>
    <td><span style="color:red">WINDOWS-1252</span>
  <tr>
    <td>fi_utf8
    <td>Finnish
    <td>fi_FI.UTF-8
    <td>Finnish_Finland.1252
    <td>WINDOWS-1252
  <tr>
    <td>fr_utf8
    <td>French
    <td>fr_FR.UTF-8
    <td>French_France.1252
    <td>WINDOWS-1252
  <tr>
    <td>fr_ca_utf8
    <td>French (Canada)
    <td>fr_CA.UTF-8
    <td>-parent fr_utf8 used-
    <td>-parent fr_utf8 used-
  <tr>
    <td>ga_utf8
    <td>Gaelic
    <td>ga.UTF-8
    <td><span style="color:red">Gaelic; Scottish Gaelic</span>
    <td>WINDOWS-1252
  <tr>
    <td>gl_utf8
    <td>Gallego
    <td><span style="color:red">es_ES.UTF-8</span>
    <td>Galician_Spain.1252
    <td>WINDOWS-1252
  <tr>
    <td>ka_utf8
    <td>Georgian
    <td><span style="color:red">ka_GE</span>
    <td><span style="color:red">Georgian_Georgia.65001</span>
    <td>-empty string-
  <tr>
    <td>de_utf8
    <td>German
    <td><span style="color:red">en.UTF-8</span>
    <td>German_Germany.1252
    <td>WINDOWS-1252
  <tr>
    <td>de_du_utf8
    <td>German (Personal)
    <td>de_DE.UTF-8
    <td>-parent de_utf8 used-
    <td>-parent de_utf8 used-
  <tr>
    <td>el_utf8
    <td>Greek
    <td>el.UTF-8
    <td>Greek_Greece.1253
    <td>WINDOWS-1253
  <tr>
    <td>he_utf8
    <td>Hebrew
    <td><span style="color:red">en.UTF-8</span>
    <td>Hebrew_Israel.1255
    <td>WINDOWS-1255
  <tr>
    <td>hi_utf8
    <td>Hindi
    <td><span style="color:red">empty!</span>
    <td><span style="color:red">Hindi.65001</span>
    <td>-empty string-
  <tr>
    <td>hu_utf8
    <td>Hungarian
    <td>hu.UTF-8
    <td>Hungarian_Hungary.1250
    <td>WINDOWS-1250
  <tr>
    <td>id_utf8
    <td>Indonesian
    <td>id_ID.UTF-8
    <td>Indonesian_indonesia.1252
    <td>WINDOWS-1252
  <tr>
    <td>it_utf8
    <td>Italian
    <td>it_IT.UTF-8
    <td>Italian_Italy.1252
    <td>WINDOWS-1252
  <tr>
    <td>ja_utf8
    <td>Japanese
    <td>ja_JP.UTF-8
    <td>Japanese_Japan.932
    <td>CP932
  <tr>
    <td>kn_utf8
    <td>Kannada
    <td><span style="color:red">ಕನ್ನಡ</span>
    <td><span style="color:red">Kannada.65001</span>
    <td>-empty string-
  <tr>
    <td>km_utf8
    <td>Khmer
    <td><span style="color:red">អង់គ្លេស</span>
    <td><span style="color:red">Khmer.65001</span>
    <td>-empty string-
  <tr>
    <td>ko_utf8
    <td>Korean
    <td>ko_KR.UTF-8
    <td>Korean_Korea.949
    <td>EUC-KR
  <tr>
    <td>lt_utf8
    <td>Lithuanian
    <td>lt_LT.UTF-8
    <td>Lithuanian_Lithuania.1257
    <td>WINDOWS-1257
  <tr>
    <td>lv_utf8
    <td>Latvian
    <td>lat.UTF-8
    <td>Latvian_Latvia.1257
    <td>WINDOWS-1257
  <tr>
    <td>ms_utf8
    <td>Malaysian
    <td><span style="color:red">id_ID.UTF-8</span>
    <td><span style="color:red">Indonesian_indonesia.1252</span>
    <td><span style="color:red">WINDOWS-1252</span>
  <tr>
    <td>mi_tn_utf8
    <td>Maori (Ngai Tahu)
    <td><span style="color:red">en</span>
    <td><span style="color:red">Maori.1252</span>
    <td><span style="color:red">WINDOWS-1252</span>
  <tr>
    <td>no_utf8
    <td>Norwegian
    <td>no_NO.UTF-8
    <td>Norwegian_Norway.1252
    <td>WINDOWS-1252
  <tr>
    <td>undefined
    <td>Norwegian (Primary)
    <td>no_NO.UTF-8
    <td>-parent no_utf8 used-
    <td>-parent no_utf8 used-
  <tr>
    <td>nn_utf8
    <td>Nynorsk
    <td><span style="color:red">no_NO.UTF-8</span>
    <td>Norwegian-Nynorsk_Norway.1252
    <td>WINDOWS-1252
  <tr>
    <td>pl_utf8
    <td>Polish
    <td>pl.UTF-8
    <td>Polish_Poland.1250
    <td>WINDOWS-1250
  <tr>
    <td>pt_utf8
    <td>Portuguese
    <td>pt_PT.UTF-8
    <td>Portuguese_Portugal.1252
    <td>WINDOWS-1252
  <tr>
    <td>pt_br_utf8
    <td>Portuguese (Brazil)
    <td>pt_BR.UTF-8
    <td>Portuguese_Brazil.1252
    <td>WINDOWS-1252
  <tr>
    <td>ro_utf8
    <td>Romanian
    <td>ro_RO.UTF-8
    <td>Romanian_Romania.1250
    <td>WINDOWS-1250
  <tr>
    <td>ru_utf8
    <td>Russian
    <td>ru_RU.UTF-8
    <td>Russian_Russia.1251
    <td>WINDOWS-1251
  <tr>
    <td>sr_utf8
    <td>Serbian
    <td><span style="color:red">sr</span>
    <td>Serbian (Cyrillic)_Serbia and Montenegro.1251
    <td>WINDOWS-1251
  <tr>
    <td>sk_utf8
    <td>Slovak
    <td>sk_SK.UTF-8
    <td>Slovak_Slovakia.1250
    <td>WINDOWS-1250
  <tr>
    <td>sl_utf8
    <td>Slovenian
    <td><span style="color:red">en.UTF-8</span>
    <td>Slovenian_Slovenia.1250
    <td>WINDOWS-1250
  <tr>
    <td>so_utf8
    <td>Somali
    <td><span style="color:red">en.UTF-8</span>
    <td><span style="color:red">not found!</span>
    <td><span style="color:red">not found!</span>
  <tr>
    <td>es_utf8
    <td>Spanish (International)
    <td>es_ES.UTF-8
    <td>Spanish_Spain.1252
    <td>WINDOWS-1252
  <tr>
    <td>es_es_utf8
    <td>Spanish (Spain)
    <td>es_ES.UTF-8
    <td>-parent es_utf8 used-
    <td>-parent es_utf8 used-
  <tr>
    <td>sv_utf8
    <td>Swedish
    <td>sv_SE.UTF-8
    <td>Swedish_Sweden.1252
    <td>WINDOWS-1252
  <tr>
    <td>tl_utf8
    <td>Tagalog
    <td>tl.UTF-8
    <td><span style="color:red">not found!</span>
    <td><span style="color:red">not found!</span>
  <tr>
    <td>th_utf8
    <td>Thai
    <td><span style="color:red">th</span>
    <td>Thai_Thailand.874
    <td>WINDOWS-874
  <tr>
    <td>tr_utf8
    <td>Turkish
    <td>tr_TR.UTF-8
    <td>Turkish_Turkey.1254
    <td>WINDOWS-1254
  <tr>
    <td>uk_utf8
    <td>Ukrainian
    <td>uk_UA.UTF-8
    <td>Ukrainian_Ukraine.1251
    <td>WINDOWS-1251
  <tr>
    <td>vi_utf8
    <td>Vietnamese
    <td><span style="color:red">en</span>
    <td>Vietnamese_Viet Nam.1258
    <td>WINDOWS-1258
</table>
 
'''Note:''' Some locales for windows <span style="color:red">in red</span> could be incorrect (technically or geographically but they are the only way I've found to show dates properly in my XP box). Also some other coloured cells must be revised because they are not working.
 
=== Some references ===
 
==== Windows====
 
* Win32 Language names: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp
* Win32 Country names: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp
* Win32 Codepage codes: http://www.microsoft.com/globaldev/reference/wincp.mspx
* Languages and codepages: http://www.science.co.il/Language/Locale-Codes.asp
* More languages and codepages: http://code.cside.com/3rdpage/windows/
* Languages and locales: http://www.livio.net/main/charset.asp
 
====Unix====
 
* Unix Language names: http://www.loc.gov/standards/iso639-2/englangn.html (639-2 is used only if 639-1 doesn't exist, see the "Locale Name Guide" below).
* Unix Country names: http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
* Unix Charset codes: http://www.w3.org/International/O-charset-list.html
 
====Other Info====
 
* Locale Name Guide: http://openi18n.org/docs/text/LocNameGuide-V10.txt
* FAQ about ISO 639: http://www.loc.gov/standards/iso639-2/faq.html
* One initiative from Unicode: http://www.unicode.org/cldr/index.html
* Weekdays and Months: http://www.domesticat.net/misc/monthsdays.php
 
[[Category:Developer]]
[[Category:Language]]
[[Category:UTF-8|Scripts]]

Latest revision as of 08:24, 22 June 2011

This development related page is now located in the Dev docs.

See the Table of locales page in the Dev docs.