Difference between revisions of "Table of locales"

Jump to: navigation, search
(Unix)
(Shifted to dev docs)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{Moved_to_dev_docs}}
==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.
 
 
 
==Support in operating systems==
 
Just in case you freshly installed some new locales and they don't seem to work don't forget to restart your webserver.
 
 
 
===openSUSE===
 
* SUSE linux 10.1 contains all necessary locales in default installation
 
 
 
===Ubuntu based===
 
The default installation contains only limited number of locales. You can generate all locales on server from command line:
 
 
 
    sudo ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
 
    sudo locale-gen
 
 
 
===Debian based===
 
The default installation contains only a limited number of locales. You can generate the locales you need  on your server from the command line. Login as root and execute:
 
 
 
    dpkg-reconfigure locales
 
 
 
choose the ones you need and press OK, next select the default locale for your server and press OK.
 
 
 
===FreeBSD===
 
All 5.x and later versions should already contain a large number of supported locales with utf-8 charset.
 
 
 
===MS Windows===
 
There is no way to add new locales, see following table for list of supported locales.
 
 
 
==Table==
 
 
 
So, for each 1.6 Moodle language pack, we'll describe below this columns:
 
* '''package_name:''' name of the language pack as shown in http://download.moodle.org/lang16/.
 
* '''lang_name:''' name of the language as shown 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>'''package_name'''</th>
 
    <th>'''lang_name'''</th>
 
    <th>'''locale'''</th>
 
    <th>'''localewin'''</th>
 
    <th>'''localewincharset</th></tr>
 
  <tr>
 
    <td>af_utf8</td>
 
    <td>Afrikaans</td>
 
    <td>af_ZA.UTF-8</td>
 
    <td>Afrikaans_South Africa.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>sq_utf8</td>
 
    <td>Albanian</td>
 
    <td>sq_AL.UTF-8</td>
 
    <td>Albanian_Albania.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>ar_utf8</td>
 
    <td>Arabic</td>
 
    <td>ar_SA.UTF-8</td>
 
    <td>Arabic_Saudi Arabia.1256</td>
 
    <td>WINDOWS-1256</td></tr>
 
  <tr>
 
    <td>eu_utf8</td>
 
    <td>Basque</td>
 
    <td>eu_ES.UTF-8</td>
 
    <td>Basque_Spain.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>be_utf8</td>
 
    <td>Belarusian</td>
 
    <td>be_BY.UTF-8</td>
 
    <td>Belarusian_Belarus.1251</td>
 
    <td>WINDOWS-1251</td></tr>
 
  <tr>
 
    <td>bs_utf8</td>
 
    <td>Bosnian</td>
 
    <td>bs_BA.UTF-8</td>
 
    <td><span style="color:red">Serbian (Latin)</span></td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>bg_utf8</td>
 
    <td>Bulgarian</td>
 
    <td>bg_BG.UTF-8</td>
 
    <td>Bulgarian_Bulgaria.1251</td>
 
    <td>WINDOWS-1251</td></tr>
 
  <tr>
 
    <td>ca_utf8</td>
 
    <td>Catalan</td>
 
    <td>ca_ES.UTF-8</td>
 
    <td>Catalan_Spain.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>hr_utf8</td>
 
    <td>Croatian</td>
 
    <td>hr_HR.UTF-8</td>
 
    <td>Croatian_Croatia.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>zh_cn_utf8</td>
 
    <td>Chinese (Simplified)</td>
 
    <td>zh_CN.UTF-8</td>
 
    <td>Chinese_China.936</td>
 
    <td>CP936</td></tr>
 
  <tr>
 
    <td>zh_tw_utf8</td>
 
    <td>Chinese (Traditional)</td>
 
    <td>zh_TW.UTF-8</td>
 
    <td>Chinese_Taiwan.950</td>
 
    <td>CP950</td></tr>
 
  <tr>
 
    <td>cs_utf8</td>
 
    <td>Czech</td>
 
    <td>cs_CZ.UTF-8</td>
 
    <td>Czech_Czech Republic.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>da_utf8</td>
 
    <td>Danish</td>
 
    <td>da_DK.UTF-8</td>
 
    <td>Danish_Denmark.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>nl_utf8</td>
 
    <td>Dutch</td>
 
    <td>nl_NL.UTF-8</td>
 
    <td>Dutch_Netherlands.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>en_utf8</td>
 
    <td>English</td>
 
    <td>en.UTF-8</td>
 
    <td>English_Australia.1252</td>
 
    <td>-empty string-</td></tr>
 
  <tr>
 
    <td>en_us_utf8</td>
 
    <td>English (US)</td>
 
    <td>-parent en_utf8 used-</td>
 
    <td>-parent en_utf8 used-</td>
 
    <td>-parent en_utf8 used-</td></tr>
 
  <tr>
 
    <td>et_utf8</td>
 
    <td>Estonian</td>
 
    <td>et_EE.UTF-8</td>
 
    <td>Estonian_Estonia.1257</td>
 
    <td>WINDOWS-1257</td></tr>
 
  <tr>
 
    <td>fa_utf8</td>
 
    <td>Farsi</td>
 
    <td>fa_IR.UTF-8</td>
 
    <td>Farsi_Iran.1256</td>
 
    <td>WINDOWS-1256</td></tr>
 
  <tr>
 
    <td>fil_utf8</td>
 
    <td>Filipino</td>
 
    <td>ph_PH.UTF-8</td>
 
    <td><span style="color:red">Filipino_Philippines.1252</span></td>
 
    <td><span style="color:red">WINDOWS-1252</span></td></tr>
 
  <tr>
 
    <td>fi_utf8</td>
 
    <td>Finnish</td>
 
    <td>fi_FI.UTF-8</td>
 
    <td>Finnish_Finland.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>fr_utf8</td>
 
    <td>French</td>
 
    <td>fr_FR.UTF-8 ''or''<br />fr_CH.UTF-8 ''or''<br />fr_BE.UTF-8</td>
 
    <td>French_France.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>fr_ca_utf8</td>
 
    <td>French (Canada)</td>
 
    <td>fr_CA.UTF-8</td>
 
    <td>-parent fr_utf8 used-</td>
 
    <td>-parent fr_utf8 used-</td></tr>
 
  <tr>
 
    <td>ga_utf8</td>
 
    <td>Gaelic</td>
 
    <td>ga.UTF-8</td>
 
    <td><span style="color:red">Gaelic; Scottish Gaelic</span></td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>gl_utf8</td>
 
    <td>Gallego</td>
 
    <td>gl_ES.UTF-8</td>
 
    <td>Galician_Spain.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>ka_utf8</td>
 
    <td>Georgian</td>
 
    <td>ka_GE.UTF-8</td>
 
    <td><span style="color:red">Georgian_Georgia.65001</span></td>
 
    <td>-empty string-</td></tr>
 
  <tr>
 
    <td>de_utf8</td>
 
    <td>German</td>
 
    <td>de_DE.UTF-8</td>
 
    <td>German_Germany.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>de_du_utf8</td>
 
    <td>German (Personal)</td>
 
    <td>de_DE.UTF-8</td>
 
    <td>-parent de_utf8 used-</td>
 
    <td>-parent de_utf8 used-</td></tr>
 
  <tr>
 
    <td>el_utf8</td>
 
    <td>Greek</td>
 
    <td>el_GR.UTF-8</td>
 
    <td>Greek_Greece.1253</td>
 
    <td>WINDOWS-1253</td></tr>
 
<tr>
 
    <td>gu_utf8</td>
 
    <td>Gujarati</td>
 
    <td>gu.UTF-8</td>
 
    <td>Gujarati_India.0</td>
 
    <td> </td></tr>
 
  <tr>
 
    <td>he_utf8</td>
 
    <td>Hebrew</td>
 
    <td>he_IL.utf8</td>
 
    <td>Hebrew_Israel.1255</td>
 
    <td>WINDOWS-1255</td></tr>
 
  <tr>
 
    <td>hi_utf8</td>
 
    <td>Hindi</td>
 
    <td>hi_IN.UTF-8</td>
 
    <td><span style="color:red">Hindi.65001</span></td>
 
    <td>-empty string-</td></tr>
 
  <tr>
 
    <td>hu_utf8</td>
 
    <td>Hungarian</td>
 
    <td>hu.UTF-8</td>
 
    <td>Hungarian_Hungary.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>is_utf8</td>
 
    <td>Icelandic</td>
 
    <td>is_IS.UTF-8</td>
 
    <td>Icelandic_Iceland.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>id_utf8</td>
 
    <td>Indonesian</td>
 
    <td>id_ID.UTF-8</td>
 
    <td>Indonesian_indonesia.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>it_utf8</td>
 
    <td>Italian</td>
 
    <td>it_IT.UTF-8</td>
 
    <td>Italian_Italy.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>ja_utf8</td>
 
    <td>Japanese</td>
 
    <td>ja_JP.UTF-8</td>
 
    <td>Japanese_Japan.932</td>
 
    <td>CP932</td></tr>
 
  <tr>
 
    <td>kn_utf8</td>
 
    <td>Kannada</td>
 
    <td>kn_IN.UTF-8</td>
 
    <td><span style="color:red">Kannada.65001</span></td>
 
    <td>-empty string-</td></tr>
 
  <tr>
 
    <td>km_utf8</td>
 
    <td>Khmer</td>
 
    <td>km_KH.UTF-8</td>
 
    <td><span style="color:red">Khmer.65001</span></td>
 
    <td>-empty string-</td></tr>
 
  <tr>
 
    <td>ko_utf8</td>
 
    <td>Korean</td>
 
    <td>ko_KR.UTF-8</td>
 
    <td>Korean_Korea.949</td>
 
    <td>EUC-KR</td></tr>
 
  <tr>
 
    <td>lo_utf8</td>
 
    <td>Lao</td>
 
    <td>lo_LA.UTF-8</td>
 
    <td>Lao_Laos.UTF-8</td>
 
    <td>WINDOWS-1257</td></tr>
 
  <tr>
 
    <td>lt_utf8</td>
 
    <td>Lithuanian</td>
 
    <td>lt_LT.UTF-8</td>
 
    <td>Lithuanian_Lithuania.1257</td>
 
    <td>WINDOWS-1257</td></tr>
 
  <tr>
 
    <td>lv_utf8</td>
 
    <td>Latvian</td>
 
    <td>lat.UTF-8</td>
 
    <td>Latvian_Latvia.1257</td>
 
    <td>WINDOWS-1257</td></tr>
 
  <tr>
 
    <td>ml_utf8</td>
 
    <td>Malayalam</td>
 
    <td>ml_IN.UTF-8</td>
 
    <td><span style="color:red">Malayalam_India.x-iscii-ma</span></td>
 
    <td><span style="color:red">x-iscii-ma</span></td></tr>
 
  <tr>
 
    <td>ms_utf8</td>
 
    <td>Malaysian</td>
 
    <td>id_ID.UTF-8</td>
 
    <td><span style="color:red">Indonesian_indonesia.1252</span></td>
 
    <td><span style="color:red">WINDOWS-1252</span></td></tr>
 
  <tr>
 
    <td>mi_tn_utf8</td>
 
    <td>Maori (Ngai Tahu)</td>
 
    <td>mi_NZ.UTF-8</td>
 
    <td><span style="color:red">Maori.1252</span></td>
 
    <td><span style="color:red">WINDOWS-1252</span></td></tr>
 
  <tr>
 
    <td>mi_wwow_utf8</td>
 
    <td>Maori (Waikoto Uni)</td>
 
    <td>mi_NZ.UTF-8</td>
 
    <td><span style="color:red">Maori.1252</span></td>
 
    <td><span style="color:red">WINDOWS-1252</span></td></tr>
 
  <tr>
 
    <td>mn_utf8</td>
 
    <td>Mongolian</td>
 
    <td>mn.UTF-8</td>
 
    <td>Cyrillic_Mongolian.1251</td>
 
    <td></tr>
 
  <tr>
 
    <td>no_utf8</td>
 
    <td>Norwegian</td>
 
    <td>no_NO.UTF-8</td>
 
    <td>Norwegian_Norway.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>no_gr_utf8</td>
 
    <td>Norwegian (Primary)</td>
 
    <td>no_NO.UTF-8</td>
 
    <td>-parent no_utf8 used-</td>
 
    <td>-parent no_utf8 used-</td></tr>
 
  <tr>
 
    <td>nn_utf8</td>
 
    <td>Nynorsk</td>
 
    <td>nn_NO.UTF-8</td>
 
    <td>Norwegian-Nynorsk_Norway.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>pl_utf8</td>
 
    <td>Polish</td>
 
    <td>pl.UTF-8</td>
 
    <td>Polish_Poland.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>pt_utf8</td>
 
    <td>Portuguese</td>
 
    <td>pt_PT.UTF-8</td>
 
    <td>Portuguese_Portugal.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>pt_br_utf8</td>
 
    <td>Portuguese (Brazil)</td>
 
    <td>pt_BR.UTF-8</td>
 
    <td>Portuguese_Brazil.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>ro_utf8</td>
 
    <td>Romanian</td>
 
    <td>ro_RO.UTF-8</td>
 
    <td>Romanian_Romania.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>ru_utf8</td>
 
    <td>Russian</td>
 
    <td>ru_RU.UTF-8</td>
 
    <td>Russian_Russia.1251</td>
 
    <td>WINDOWS-1251</td></tr>
 
  <tr>
 
    <td>sm_utf8</td>
 
    <td>Samoan</td>
 
    <td>mi_NZ.UTF-8</td>
 
    <td>Maori.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>sr_utf8</td>
 
    <td>Serbian</td>
 
    <td>sr_CS.UTF-8</td>
 
    <td>Serbian (Cyrillic)_Serbia and Montenegro.1251</td>
 
    <td>WINDOWS-1251</td></tr>
 
  <tr>
 
    <td>sk_utf8</td>
 
    <td>Slovak</td>
 
    <td>sk_SK.UTF-8</td>
 
    <td>Slovak_Slovakia.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>sl_utf8</td>
 
    <td>Slovenian</td>
 
    <td>sl_SI.UTF-8</td>
 
    <td>Slovenian_Slovenia.1250</td>
 
    <td>WINDOWS-1250</td></tr>
 
  <tr>
 
    <td>so_utf8</td>
 
    <td>Somali</td>
 
    <td>so_SO.UTF-8</td>
 
    <td><span style="color:red">not found!</span></td>
 
    <td><span style="color:red">not found!</span></td></tr>
 
  <tr>
 
    <td>es_utf8</td>
 
    <td>Spanish (International)</td>
 
    <td>es_ES.UTF-8</td>
 
    <td>Spanish_Spain.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>sv_utf8</td>
 
    <td>Swedish</td>
 
    <td>sv_SE.UTF-8</td>
 
    <td>Swedish_Sweden.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>tl_utf8</td>
 
    <td>Tagalog</td>
 
    <td>tl.UTF-8</td>
 
    <td><span style="color:red">not found!</span></td>
 
    <td><span style="color:red">not found!</span></td></tr>
 
  <tr>
 
    <td>ta_utf8</td>
 
    <td>Tamil</td>
 
    <td>ta_IN.UTF-8</td>
 
    <td>English_Australia.1252</td>
 
    <td></td></tr>
 
  <tr>
 
    <td>th_utf8</td>
 
    <td>Thai</td>
 
    <td>th_TH.UTF-8</td>
 
    <td>Thai_Thailand.874</td>
 
    <td>WINDOWS-874</td></tr>
 
  <tr>
 
    <td>to_utf8</td>
 
    <td>Tongan</td>
 
    <td>mi_NZ.UTF-8'</td>
 
    <td>Maori.1252</td>
 
    <td>WINDOWS-1252</td></tr>
 
  <tr>
 
    <td>tr_utf8</td>
 
    <td>Turkish</td>
 
    <td>tr_TR.UTF-8</td>
 
    <td>Turkish_Turkey.1254</td>
 
    <td>WINDOWS-1254</td></tr>
 
  <tr>
 
    <td>uk_utf8</td>
 
    <td>Ukrainian</td>
 
    <td>uk_UA.UTF-8</td>
 
    <td>Ukrainian_Ukraine.1251</td>
 
    <td>WINDOWS-1251</td></tr>
 
  <tr>
 
    <td>vi_utf8</td>
 
    <td>Vietnamese</td>
 
    <td>vi_VN.UTF-8</td>
 
    <td>Vietnamese_Viet Nam.1258</td>
 
    <td>WINDOWS-1258</td></tr>
 
</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.
 
 
 
== 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
 
* Table of language identifiers: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.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
 
* More locales: http://search.cpan.org/~drolsky/DateTime-Locale-0.42/lib/DateTime/Locale/Catalog.pm
 
 
 
===Other Information===
 
 
 
* 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
 
 
 
[[es:Tabla de locales]]
 
 
 
[[Category:Developer]]
 
[[Category:Language]]
 
[[Category:UTF-8]]
 
 
 
[[ja:ロケールテーブル]]
 

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.