Skip to content

Commit

Permalink
Merge pull request #26 from Laravel-Lang/2.x
Browse files Browse the repository at this point in the history
Fixed handling of new locales
  • Loading branch information
andrey-helldar authored Dec 29, 2023
2 parents c7561be + d10f5a4 commit 1ce8db0
Show file tree
Hide file tree
Showing 147 changed files with 4,721 additions and 8,867 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
run: composer require laravel/framework:^${{ matrix.laravel }} --prefer-${{ matrix.prefer }}

- name: Execute tests
run: vendor/bin/pest
run: php vendor/bin/pest --compact
79 changes: 5 additions & 74 deletions app/Processors/Cldr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,86 +17,14 @@

namespace LaravelLang\Dev\Processors;

use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use LaravelLang\Dev\Services\Process;

class Cldr extends Processor
{
protected array $notSupported = [
'ak',
'am',
'as',
'ay',
'bho',
'bm',
'ceb',
'ckb',
'co',
'de_CH',
'doi',
'dv',
'ee',
'eo',
'fy',
'ga',
'gd',
'gn',
'gom',
'ha',
'haw',
'hmn',
'ht',
'ig',
'ilo',
'jw',
'kri',
'ky',
'la',
'lb',
'lg',
'ln',
'lo',
'lus',
'mai',
'mg',
'mi',
'ml',
'mni_Mtei',
'mt',
'my',
'nso',
'ny',
'om',
'or',
'pa',
'pt_BR',
'qu',
'rw',
'sa',
'sd',
'sm',
'sn',
'so',
'sr_Cyrl',
'sr_Latn',
'sr_Latn_ME',
'st',
'su',
'ta',
'te',
'ti',
'tl',
'ts',
'tt',
'uz_Cyrl',
'uz_Latn',
'xh',
'yi',
'yo',
'zh_CN',
'zh_HK',
'zh_TW',
'zu',
];

public function handle(): void
Expand All @@ -113,7 +41,10 @@ protected function toInstall(): string
])
->flatten()
->unique()
->filter(fn (string $locale) => ! in_array($locale, $this->notSupported, true))
->when($this->notSupported, fn (Collection $items, array $except) => $items->filter(
fn (string $locale) => ! in_array($locale, $except, true)
))
->filter(fn (string $locale) => ! Str::contains($locale, ['-', '_']))
->sort()
->map(fn (string $locale) => '+' . $locale)
->implode(',');
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
},
"require-dev": {
"illuminate/support": "^10.31",
"laravel-lang/locale-list": "^1.2.1",
"laravel-lang/locale-list": "^1.2-RC1",
"pestphp/pest": "^2.24.3",
"punic/punic": "^3.8",
"symfony/console": "^6.3",
"symfony/process": "^6.3",
"symfony/var-dumper": "^6.3"
},
"minimum-stability": "stable",
"minimum-stability": "rc",
"prefer-stable": true,
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -76,6 +76,9 @@
],
"cldr": [
"php bin/native cldr"
],
"test": [
"php vendor/bin/pest --parallel"
]
}
}
97 changes: 41 additions & 56 deletions data/_native.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
{
"af": "Afrikaans",
"ak": "Akan",
"am": "Amharic",
"am": "አማርኛ",
"ar": "العربية",
"as": "Assamese",
"ay": "Aymara",
"as": "অসমীয়া",
"az": "Azərbaycan",
"be": "Беларуская",
"bg": "Български",
"bho": "Bhojpuri",
"bm": "Bambara",
"bho": "भोजपुरी",
"bm": "Bamanakan",
"bn": "বাংলা",
"bs": "Bosanski",
"ca": "Català",
"ceb": "Cebuano",
"ckb": "Central Kurdish",
"co": "Corsican",
"ckb": "کوردیی ناوەندی",
"cs": "Čeština",
"cy": "Cymraeg",
"da": "Dansk",
"de": "Deutsch",
"de_CH": "Deutsch (Schweiz)",
"doi": "Dogri",
"dv": "Divehi",
"ee": "Ewe",
"doi": "डोगरी",
"ee": "Eʋegbe",
"el": "Ελληνικά",
"en": "English",
"eo": "Esperanto",
Expand All @@ -34,25 +31,20 @@
"fi": "Suomi",
"fil": "Filipino",
"fr": "Français",
"fy": "Western Frisian",
"ga": "Irish",
"gd": "Scottish Gaelic",
"fy": "Frysk",
"ga": "Gaeilge",
"gd": "Gàidhlig",
"gl": "Galego",
"gn": "Guarani",
"gom": "Goan Konkani",
"gu": "ગુજરાતી",
"ha": "Hausa",
"haw": "Hawaiian",
"haw": "ʻŌlelo Hawaiʻi",
"he": "עברית",
"hi": "हिन्दी",
"hmn": "Hmong",
"hr": "Hrvatski",
"ht": "Créole Haïtien",
"hu": "Magyar",
"hy": "Հայերեն",
"id": "Indonesia",
"ig": "Igbo",
"ilo": "Iloko",
"is": "Íslenska",
"it": "Italiano",
"ja": "日本語",
Expand All @@ -61,83 +53,76 @@
"km": "ខ្មែរ",
"kn": "ಕನ್ನಡ",
"ko": "한국어",
"kri": "Krio",
"ky": "Kyrgyz",
"la": "Latin",
"lb": "Luxembourgish",
"lg": "Ganda",
"ln": "Lingala",
"lo": "Lao",
"ku": "Kurdî",
"ky": "Кыргызча",
"lb": "Lëtzebuergesch",
"lg": "Luganda",
"ln": "Lingála",
"lo": "ລາວ",
"lt": "Lietuvių",
"lus": "Mizo",
"lv": "Latviešu",
"mai": "Maithili",
"mai": "मैथिली",
"mg": "Malagasy",
"mi": "Māori",
"mk": "Македонски",
"ml": "Malayalam",
"ml": "മലയാളം",
"mn": "Монгол",
"mni_Mtei": "Manipuri",
"mr": "मराठी",
"ms": "Melayu",
"mt": "Maltese",
"my": "Burmese",
"mt": "Malti",
"my": "မြန်မာ",
"nb": "Norsk Bokmål",
"ne": "नेपाली",
"nl": "Nederlands",
"nn": "Norsk Nynorsk",
"nso": "Northern Sotho",
"ny": "Nyanja",
"oc": "Occitan",
"om": "Oromo",
"or": "Odia",
"pa": "Punjabi",
"om": "Oromoo",
"or": "ଓଡ଼ିଆ",
"pa": "ਪੰਜਾਬੀ",
"pl": "Polski",
"ps": "پښتو",
"pt": "Português",
"pt_BR": "Português (Brasil)",
"qu": "Quechua",
"qu": "Runasimi",
"ro": "Română",
"ru": "Русский",
"rw": "Kinyarwanda",
"sa": "Sanskrit",
"sa": "संस्कृत भाषा",
"sc": "Sardu",
"sd": "Sindhi",
"sd": "سنڌي",
"si": "සිංහල",
"sk": "Slovenčina",
"sl": "Slovenščina",
"sm": "Samoan",
"sn": "Shona",
"so": "Somali",
"sn": "Chishona",
"so": "Soomaali",
"sq": "Shqip",
"sr_Cyrl": "Српски",
"sr_Latn": "Serbian",
"sr_Latn_ME": "Serbian (Montenegro)",
"st": "Southern Sotho",
"su": "Sundanese",
"sr_Latn": "Srpski",
"sr_Latn_ME": "Srpski (Crna Gora)",
"su": "Basa Sunda",
"sv": "Svenska",
"sw": "Kiswahili",
"ta": "Tamil",
"te": "Telugu",
"ta": "தமிழ்",
"te": "తెలుగు",
"tg": "Тоҷикӣ",
"th": "ไทย",
"ti": "Tigrinya",
"ti": "ትግርኛ",
"tk": "Türkmen Dili",
"tl": "Tagalog",
"tr": "Türkçe",
"ts": "Tsonga",
"tt": "Tatar",
"tt": "Татар",
"ug": "ئۇيغۇرچە",
"uk": "Українська",
"ur": "اردو",
"uz_Cyrl": "Uzbek",
"uz_Cyrl": "Ўзбекча",
"uz_Latn": "O‘zbek",
"vi": "Tiếng Việt",
"xh": "Xhosa",
"yi": "Yiddish",
"yo": "Yoruba",
"xh": "Isixhosa",
"yi": "ייִדיש",
"yo": "Èdè Yorùbá",
"zh_CN": "中文 (中国)",
"zh_HK": "中文 (中国香港特别行政区)",
"zh_TW": "中文 (台湾)",
"zu": "Zulu"
"zu": "Isizulu"
}
Loading

0 comments on commit 1ce8db0

Please sign in to comment.