Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for new localization codes #7

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: vendor/bin/pest --compact
9 changes: 5 additions & 4 deletions app/Processors/Cldr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +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 = [
'tl',
'zh_CN',
'zh_HK',
'zh_TW',
];

public function handle(): void
Expand All @@ -43,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 @@ -40,15 +40,15 @@
},
"require-dev": {
"illuminate/support": "^10.0",
"laravel-lang/locale-list": "^1.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",
"vlucas/phpdotenv": "^5.6"
},
"minimum-stability": "stable",
"minimum-stability": "RC",
"prefer-stable": true,
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -82,6 +82,9 @@
],
"cldr": [
"php bin/native cldr"
],
"test": [
"php vendor/bin/pest --parallel"
]
}
}
Loading