Skip to content

Commit

Permalink
Merge pull request #19 from Laravel-Lang/1.x
Browse files Browse the repository at this point in the history
Improved localization coverage for CLDR
  • Loading branch information
andrey-helldar authored Nov 11, 2023
2 parents 873d960 + 817940f commit c7ed1ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
run: |
IS_DIRTY=1
vendor/bin/lang sync
sudo php ./bin/native translate
sudo php ./bin/native collect
vendor/bin/lang sync
{ git add . && git commit -a -m "🔑 Synchronization of translation keys"; } || IS_DIRTY=0
Expand Down
8 changes: 8 additions & 0 deletions app/Processors/Cldr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace LaravelLang\Dev\Processors;

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

class Cldr extends Processor
Expand All @@ -37,6 +38,13 @@ protected function toInstall(): string
{
return collect(parent::locales())
->filter(fn (string $locale) => ! in_array($locale, $this->notSupported, true))
->map(fn (string $locale) => [
$locale,
Str::before($locale, '_'),
])
->flatten()
->unique()
->sort()
->map(fn (string $locale) => '+' . $locale)
->implode(',');
}
Expand Down

0 comments on commit c7ed1ef

Please sign in to comment.