Skip to content

Commit

Permalink
L10N handler patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Jun 26, 2024
1 parent 7052384 commit 2bf7d93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions _docs/L10N.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ Additionally, as you might've noticed in the above example, the fallback L10N ar

#### What rules to use for what language?

*The information listed in the table below is generally based upon [Unicode's CLDR page on Language Plural Rules](https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html) (which also serves as the general basis for the rules for [grammatical number](https://en.wikipedia.org/wiki/Grammatical_number) supported by the class). Information based upon other sources will be marked accordingly. If any of the listed information is wrong, erroneous, or incomplete, any corrections, additions, etc that you can think of would be invited and welcome (please create a pull request, or create an [issue](https://github.com/Maikuolan/Common/issues) if creating a pull request isn't possible). Please also be aware that I am NOT a professional linguist! If you ask me for the correct rules to use for a particular language, I'll only be able to answer if I'm able to find a reliable source somewhere online to help determine that information.*
*The information listed in the table below is generally based upon [Unicode's CLDR page on Language Plural Rules](https://www.unicode.org/cldr/charts/46/supplemental/language_plural_rules.html) (which also serves as the general basis for the rules for [grammatical number](https://en.wikipedia.org/wiki/Grammatical_number) supported by the class). Information based upon other sources will be marked accordingly. If any of the listed information is wrong, erroneous, or incomplete, any corrections, additions, etc that you can think of would be invited and welcome (please create a pull request, or create an [issue](https://github.com/Maikuolan/Common/issues) if creating a pull request isn't possible). Please also be aware that I am NOT a professional linguist! If you ask me for the correct rules to use for a particular language, I'll only be able to answer if I'm able to find a reliable source somewhere online to help determine that information.*

*†1: Language isn't listed on Unicode's CLDR page, but the required information for it can be found elsewhere (if a single, particular information source is the sole or primarily used information source, it will be linked next to the language, where this mark occurs).*

Language | `IntegerRule` | `FractionRule` | Notes
:--|:--|:--|:--
`********************************` | `********` | `********` | `********`
Afrikaans<br />Albanian (Shqipe)<br />Aragonese<br />Asturian (Asturianu)<br />Asu<br />Azerbaijani (Azərbaycan)<br />Balochi (بلۏچی)<br />Basque (Euskara)<br />Bemba<br />Bena<br />Bodo (बड़ो)<br />Bulgarian (Български)<br />Catalan (Català)<br />Chechen<br />Cherokee (ᏣᎳᎩ)<br />Chiga<br />Divehi<br />Dutch (Nederlandse)<br />English<br />Esperanto<br />Estonian (Eesti keel)<br />European Portuguese (Português)<br />Ewe (Eʋegbe)<br />Faroese (Føroyskt)<br />Finnish (Suomi)<br />Friulian<br />Galician (Galego)<br />Ganda (LùGáànda)<br />Georgian (ქართული)<br />German (Deutsch)<br />Greek (Ελληνικά)<br />Greenlandic (Kalaallisut)<br />Hausa (حَوْسَ)<br />Hawaiian (ʻōlelo Hawaiʻi)<br />Hungarian (Magyar)<br />Ido<br />Interlingua<br />Italian (Italiano)<br />Jju<br />Kako<br />Kashmiri (कॉशुर, كٲشُر)<br />Kazakh (Қазақ тілі)<br />Kurdish (Kurdî)<br />Kyrgyz (Кыргыз тили)<br />Ligurian<br />Luxembourgish (Lëtzebuergesch)<br />Machame<br />Malayalam (മലയാളം)<br />Marathi (मराठी)<br />Masai<br />Maori (Māori) *[†1](https://en.wikipedia.org/wiki/M%C4%81ori_language)*<br />Metaʼ<br />Mongolian (Монгол)<br />Nahuatl (Nāhuatl)<br />Ndebele<br />Nepali (नेपाली)<br />Ngiemboon<br />Ngomba<br />Norwegian (Norsk)<br />Norwegian Bokmål<br />Norwegian Nynorsk<br />Nyanja<br />Nyankole<br />Odia (ଓଡ଼ିଆ)<br />Oromo (ኦሮሞ፞)<br />Ossetic<br />Papiamento (Papiamentu)<br />Pashto (پښتو)<br />Romansh (Rumantsch)<br />Rombo<br />Rwa<br />Saho<br />Samburu<br />Samoan<br />Sardinian (Limba Sarda)<br />Scots *[†1](http://www.scots-online.org/grammar/numbers.asp)*<br />Sena<br />Shambala<br />Shona<br />Sicilian (Sicilianu)<br />Sindarin *[†1](https://en.wikipedia.org/wiki/Sindarin)*<br />Sindhi (سنڌي)<br />Soga<br />Somali (Soomaaliga)<br />Southern Sotho (Sesotho)<br />Spanish (Español)<br />Swahili (Kiswahili)<br />Swati<br />Swedish (Svenska)<br />Swiss German<br />Syriac (ܠܫܢܐ ܣܘܪܝܝܐ)<br />Tamil (தமிழ்)<br />Telugu (తెలుగు)<br />Teso<br />Tigre (ትግረ, ትግሬ)<br />Tsonga (xiTsonga)<br />Tswana (Setswana)<br />Turkish (Türkçe)<br />Turkmen (Түркmенче)<br />Tyap<br />Urdu (‏اردو‏)<br />Uyghur (ئۇيغۇرچە, Уйғурчә)<br />Uzbek (O'zbek)<br />Venda (tshiVenḓa)<br />Volapük<br />Vunjo<br />Walser<br />Western Frisian (Frysk)<br />Xhosa (isiXhosa)<br />Yiddish (ייִדיש) | `int2Type4` | `int1`
Afrikaans<br />Albanian (Shqipe)<br />Aragonese<br />Asturian (Asturianu)<br />Asu<br />Azerbaijani (Azərbaycan)<br />Balochi (بلۏچی)<br />Basque (Euskara)<br />Bemba<br />Bena<br />Bodo (बड़ो)<br />Bulgarian (Български)<br />Catalan (Català)<br />Chechen<br />Cherokee (ᏣᎳᎩ)<br />Chiga<br />Divehi<br />Dutch (Nederlandse)<br />English<br />Esperanto<br />Estonian (Eesti keel)<br />European Portuguese (Português)<br />Ewe (Eʋegbe)<br />Faroese (Føroyskt)<br />Finnish (Suomi)<br />Friulian<br />Galician (Galego)<br />Ganda (LùGáànda)<br />Georgian (ქართული)<br />German (Deutsch)<br />Greek (Ελληνικά)<br />Greenlandic (Kalaallisut)<br />Hausa (حَوْسَ)<br />Hawaiian (ʻōlelo Hawaiʻi)<br />Hungarian (Magyar)<br />Ido<br />Interlingua<br />Italian (Italiano)<br />Jju<br />Kako<br />Kashmiri (कॉशुर, كٲشُر)<br />Kazakh (Қазақ тілі)<br />Kurdish (Kurdî)<br />Kyrgyz (Кыргыз тили)<br />Ladin<br />Ligurian<br />Luxembourgish (Lëtzebuergesch)<br />Machame<br />Malayalam (മലയാളം)<br />Marathi (मराठी)<br />Masai<br />Maori (Māori) *[†1](https://en.wikipedia.org/wiki/M%C4%81ori_language)*<br />Metaʼ<br />Mongolian (Монгол)<br />Nahuatl (Nāhuatl)<br />Ndebele<br />Nepali (नेपाली)<br />Ngiemboon<br />Ngomba<br />Norwegian (Norsk)<br />Norwegian Bokmål<br />Norwegian Nynorsk<br />Nyanja<br />Nyankole<br />Odia (ଓଡ଼ିଆ)<br />Oromo (ኦሮሞ፞)<br />Ossetic<br />Papiamento (Papiamentu)<br />Pashto (پښتو)<br />Romansh (Rumantsch)<br />Rombo<br />Rwa<br />Saho<br />Samburu<br />Samoan<br />Sardinian (Limba Sarda)<br />Scots *[†1](http://www.scots-online.org/grammar/numbers.asp)*<br />Sena<br />Shambala<br />Shona<br />Sicilian (Sicilianu)<br />Sindarin *[†1](https://en.wikipedia.org/wiki/Sindarin)*<br />Sindhi (سنڌي)<br />Soga<br />Somali (Soomaaliga)<br />Southern Sotho (Sesotho)<br />Spanish (Español)<br />Swahili (Kiswahili)<br />Swati<br />Swedish (Svenska)<br />Swiss German<br />Syriac (ܠܫܢܐ ܣܘܪܝܝܐ)<br />Tamil (தமிழ்)<br />Telugu (తెలుగు)<br />Teso<br />Tigre (ትግረ, ትግሬ)<br />Tsonga (xiTsonga)<br />Tswana (Setswana)<br />Turkish (Türkçe)<br />Turkmen (Түркmенче)<br />Tyap<br />Urdu (‏اردو‏)<br />Uyghur (ئۇيغۇرچە, Уйғурчә)<br />Uzbek (O'zbek)<br />Venda (tshiVenḓa)<br />Volapük<br />Vunjo<br />Walser<br />Western Frisian (Frysk)<br />Xhosa (isiXhosa)<br />Yiddish (ייִדיש) | `int2Type4` | `int1`
Akan<br />Bihari<br />Gun<br />Klingon (tlhIngan Hol,  ) *[†1](https://en.wikibooks.org/wiki/Klingon/Grammar/Plurals)*<br />Lingala (Lingála)<br />Malagasy<br />Northern Sotho (Sesotho)<br />Punjabi (ਪੰਜਾਬੀ) *‡1*<br />Sinhala (සිංහල)<br />Tigrinya (ትግርኛ)<br />Walloon (Walon) | `int2Type3` | `int1` | *‡1: Classification includes (groups together with): Changvi, Chenavari, Dhani, Doabi, Hindko, Jafri, Jangli, Jhangochi, Khetrani, Lahnda, Majhi, Malwai, Pahari-Potowari, Panjistani, Pothohari, Puadhi, Rachnavi, Saraiki, Shahpuri.*
Amharic (አማርኛ)<br />Assamese (অসমীয়া)<br />Bangla/Bengali (বাংলা)<br />Dogri (𑠖𑠵𑠌𑠤𑠮)<br />Gujarati (ગુજરાતી)<br />Hindi (हिंदी)<br />Kannada (ಕನ್ನಡ)<br />Nigerian Pidgin<br />Persian/Farsi (فارسی)<br />Zulu (isiZulu) | `int2Type3` | `fraction2Type2`
Arabic (<code dir="rtl">العربية</code>) *‡1* | `int6Type1` | `int1` | *‡1: CLDR's information suggests 6 distinct grammatical numbers used, but I haven't been able to successfully replicate this via online translators or dictionaries in most cases, so I'm not entirely sure about it.*
Expand Down Expand Up @@ -480,4 +480,4 @@ This means, that in theory, you could have an unlimited number of languages as f
---


Last Updated: 2 March 2024 (2024.03.02).
Last Updated: 22 June 2024 (2024.06.22).
4 changes: 2 additions & 2 deletions src/L10N.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* L10N handler (last modified: 2024.03.02).
* L10N handler (last modified: 2024.06.22).
*
* This file is a part of the "common classes package", utilised by a number of
* packages and projects, including CIDRAM and phpMussel.
Expand Down Expand Up @@ -752,7 +752,7 @@ private function fraction2Type2(float $Fraction): int
* ISO 639-1/639-2 language code.
* @link https://www.loc.gov/standards/iso639-2/php/code_list.php
* @link https://cldr.unicode.org/index/cldr-spec/plural-rules
* @link https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html
* @link https://www.unicode.org/cldr/charts/46/supplemental/language_plural_rules.html
*
* @param string $Code An ISO 639-1/639-2 language code.
* @return string An appropriate integer rule to use.
Expand Down

0 comments on commit 2bf7d93

Please sign in to comment.