diff --git a/README.md b/README.md index 8754972..bfd7e0c 100644 --- a/README.md +++ b/README.md @@ -137,11 +137,13 @@ Ensure you have created a GitHub personal access token and saved it as a `GITHUB Note: There is no need to update the count of translated strings and add your username below, as this is done by script when your PR is merged. Total languages ![42](https://img.shields.io/badge/42-gray?style=flat-square) -Total lines translated ![16,196 (94.5%)](https://img.shields.io/badge/16,196-94%25-yellow?style=flat-square) +Total lines translated ![16,209 (94.6%)](https://img.shields.io/badge/16,209-94%25-yellow?style=flat-square) | Code | Language | Translated files | Lines translated | Thanks to | | --- | --- | --- | --- | --- | | `en` | English | [`php`](resources/lang/en) [`json`](resources/lang/en.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [taylorotwell](https://github.com/taylorotwell), [bonzai](https://github.com/bonzai), [davidhemphill](https://github.com/davidhemphill), [jbrooksuk](https://github.com/jbrooksuk), [themsaid](https://github.com/themsaid), [kitbs](https://github.com/kitbs), [dillingham](https://github.com/dillingham) | +| `ar` | Arabic | [`php`](resources/lang/ar) [`json`](resources/lang/ar.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [saleem-hadad](https://github.com/saleem-hadad), [danyelkeddah](https://github.com/danyelkeddah), [omarfathy13](https://github.com/omarfathy13), [CaddyDz](https://github.com/CaddyDz), [i3asm](https://github.com/i3asm), [Arryan](https://github.com/Arryan) | +| `cs` | Czech | [`php`](resources/lang/cs) [`json`](resources/lang/cs.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [walaskir](https://github.com/walaskir), [theimerj](https://github.com/theimerj), [genesiscz](https://github.com/genesiscz), [walaski](https://github.com/walaski) | | `nl` | Dutch | [`php`](resources/lang/nl) [`json`](resources/lang/nl.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [DannyvdSluijs](https://github.com/DannyvdSluijs), [happyDemon](https://github.com/happyDemon), [steefmin](https://github.com/steefmin), [jschram](https://github.com/jschram), [sebastiaanspeck](https://github.com/sebastiaanspeck), [preliot](https://github.com/preliot), [webovatenl](https://github.com/webovatenl), [daniel-de-wit](https://github.com/daniel-de-wit) | | `fr` | French | [`php`](resources/lang/fr) [`json`](resources/lang/fr.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [MarceauKa](https://github.com/MarceauKa), [Yannik-Slym](https://github.com/Yannik-Slym), [InfinityWebMe](https://github.com/InfinityWebMe), [kitbs](https://github.com/kitbs), [shaffe-fr](https://github.com/shaffe-fr), [Arryan](https://github.com/Arryan), [voidgraphics](https://github.com/voidgraphics), [KillianH](https://github.com/KillianH) | | `de` | German | [`php`](resources/lang/de) [`json`](resources/lang/de.json) | ![408 (100%)](https://img.shields.io/badge/408-100%25-brightgreen?style=flat-square) | [pille1842](https://github.com/pille1842), [shieraki](https://github.com/shieraki), [kitbs](https://github.com/kitbs), [tobiasthaden](https://github.com/tobiasthaden), [dakira](https://github.com/dakira) | @@ -152,7 +154,6 @@ Total lines translated ![16,196 (94.5%)](https://img.shields.io/badge/16,196-94% | `ru` | Russian | [`php`](resources/lang/ru) [`json`](resources/lang/ru.json) | ![407 (99.8%)](https://img.shields.io/badge/407-99%25-green?style=flat-square) | [hivokas](https://github.com/hivokas), [sanasol](https://github.com/sanasol), [den1n](https://github.com/den1n), [deadem](https://github.com/deadem), [soulshockers](https://github.com/soulshockers), [estim](https://github.com/estim) | | `pt‑BR` | Brazilian Portuguese | [`php`](resources/lang/pt-BR) [`json`](resources/lang/pt-BR.json) | ![406 (99.5%)](https://img.shields.io/badge/406-99%25-green?style=flat-square) | [henryavila](https://github.com/henryavila), [pedrofurtado](https://github.com/pedrofurtado), [eduardokum](https://github.com/eduardokum), [saulo-silva](https://github.com/saulo-silva), [chbbc](https://github.com/chbbc), [IgorDePaula](https://github.com/IgorDePaula), [emtudo](https://github.com/emtudo) | | `ca` | Catalan | [`php`](resources/lang/ca) [`json`](resources/lang/ca.json) | ![406 (99.5%)](https://img.shields.io/badge/406-99%25-green?style=flat-square) | [joebordes](https://github.com/joebordes), [gerardnll](https://github.com/gerardnll) | -| `cs` | Czech | [`php`](resources/lang/cs) [`json`](resources/lang/cs.json) | ![405 (99.3%)](https://img.shields.io/badge/405-99%25-green?style=flat-square) | [walaskir](https://github.com/walaskir), [theimerj](https://github.com/theimerj), [walaski](https://github.com/walaski) | | `nb` | Norwegian Bokmål | [`php`](resources/lang/nb) [`json`](resources/lang/nb.json) | ![405 (99.3%)](https://img.shields.io/badge/405-99%25-green?style=flat-square) | [einar-johan](https://github.com/einar-johan) | | `ro` | Romanian | [`php`](resources/lang/ro) [`json`](resources/lang/ro.json) | ![405 (99.3%)](https://img.shields.io/badge/405-99%25-green?style=flat-square) | [BTeodorWork](https://github.com/BTeodorWork), [dtix](https://github.com/dtix), [alexgiuvara](https://github.com/alexgiuvara) | | `sv` | Swedish | [`php`](resources/lang/sv) [`json`](resources/lang/sv.json) | ![405 (99.3%)](https://img.shields.io/badge/405-99%25-green?style=flat-square) | [tanjemark](https://github.com/tanjemark), [slackernrrd](https://github.com/slackernrrd) | @@ -164,12 +165,11 @@ Total lines translated ![16,196 (94.5%)](https://img.shields.io/badge/16,196-94% | `ja` | Japanese | [`php`](resources/lang/ja) [`json`](resources/lang/ja.json) | ![400 (98%)](https://img.shields.io/badge/400-98%25-green?style=flat-square) | [Tsumagari](https://github.com/Tsumagari), [storyn26383](https://github.com/storyn26383) | | `fa` | Farsi | [`php`](resources/lang/fa) [`json`](resources/lang/fa.json) | ![399 (97.8%)](https://img.shields.io/badge/399-97%25-green?style=flat-square) | [alirezamirsepassi](https://github.com/alirezamirsepassi), [mziraki](https://github.com/mziraki), [zareismail](https://github.com/zareismail) | | `tk` | Turkmen | [`php`](resources/lang/tk) [`json`](resources/lang/tk.json) | ![399 (97.8%)](https://img.shields.io/badge/399-97%25-green?style=flat-square) | [kakajansh](https://github.com/kakajansh) | -| `ar` | Arabic | [`php`](resources/lang/ar) [`json`](resources/lang/ar.json) | ![398 (97.5%)](https://img.shields.io/badge/398-97%25-green?style=flat-square) | [saleem-hadad](https://github.com/saleem-hadad), [danyelkeddah](https://github.com/danyelkeddah), [omarfathy13](https://github.com/omarfathy13), [Arryan](https://github.com/Arryan) | | `pl` | Polish | [`php`](resources/lang/pl) [`json`](resources/lang/pl.json) | ![397 (97.3%)](https://img.shields.io/badge/397-97%25-green?style=flat-square) | [pzmarzly](https://github.com/pzmarzly), [Strus](https://github.com/Strus), [marekfilip](https://github.com/marekfilip), [mslepko](https://github.com/mslepko), [wiktor-k](https://github.com/wiktor-k) | | `zh‑CN` | Chinese (Simplified) | [`php`](resources/lang/zh-CN) [`json`](resources/lang/zh-CN.json) | ![393 (96.3%)](https://img.shields.io/badge/393-96%25-green?style=flat-square) | [jcc](https://github.com/jcc), [zacksleo](https://github.com/zacksleo), [masterwto](https://github.com/masterwto) | | `zh‑TW` | Chinese (Traditional) | [`php`](resources/lang/zh-TW) [`json`](resources/lang/zh-TW.json) | ![393 (96.3%)](https://img.shields.io/badge/393-96%25-green?style=flat-square) | [CasperLaiTW](https://github.com/CasperLaiTW), [zacksleo](https://github.com/zacksleo), [storyn26383](https://github.com/storyn26383) | | `pt` | Portuguese | [`php`](resources/lang/pt) [`json`](resources/lang/pt.json) | ![377 (92.4%)](https://img.shields.io/badge/377-92%25-yellow?style=flat-square) | [Pedrocssg](https://github.com/Pedrocssg) | -| `da` | Danish | [`php`](resources/lang/da) [`json`](resources/lang/da.json) | ![356 (87.3%)](https://img.shields.io/badge/356-87%25-orange?style=flat-square) | [olivernybroe](https://github.com/olivernybroe), [rugaard](https://github.com/rugaard) | +| `da` | Danish | [`php`](resources/lang/da) [`json`](resources/lang/da.json) | ![356 (87.3%)](https://img.shields.io/badge/356-87%25-orange?style=flat-square) | [olivernybroe](https://github.com/olivernybroe), [rugaard](https://github.com/rugaard), [peterchrjoergensen](https://github.com/peterchrjoergensen) | | `eu` | Basque | [`php`](resources/lang/eu) [`json`](resources/lang/eu.json) | ![354 (86.8%)](https://img.shields.io/badge/354-86%25-orange?style=flat-square) | [JonPaternain](https://github.com/JonPaternain) | | `hr` | Croatian | [`php`](resources/lang/hr) [`json`](resources/lang/hr.json) | ![352 (86.3%)](https://img.shields.io/badge/352-86%25-orange?style=flat-square) | [defart](https://github.com/defart), [walaski](https://github.com/walaski) | | `fil` | Filipino | [`php`](resources/lang/fil) [`json`](resources/lang/fil.json) | ![352 (86.3%)](https://img.shields.io/badge/352-86%25-orange?style=flat-square) | [granaderos](https://github.com/granaderos) | @@ -188,7 +188,7 @@ Total lines translated ![16,196 (94.5%)](https://img.shields.io/badge/16,196-94% The following languages are supported for the main Laravel framework by the excellent [caouecs/laravel-lang](https://github.com/caouecs/Laravel-lang) package. We would love for our package to make these languages available for Nova as well. If you are able to contribute to any of these or other languages, please read our [contributing guidelines](CONTRIBUTING.md) and raise a PR. -Parity with `caouecs/laravel-lang` ![39/74 (52.7%)](https://img.shields.io/badge/39%2F74-52%25-red?style=flat-square) +Parity with `caouecs/laravel-lang` ![40/75 (53.3%)](https://img.shields.io/badge/40%2F75-53%25-red?style=flat-square) | Code | Language | Lines translated | | --- | --- | --- | @@ -201,6 +201,7 @@ Parity with `caouecs/laravel-lang` ![39/74 (52.7%)](https://img.shields.io/badge | `gl` | Galician | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `de‑CH` | German (Switzerland) | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `el` | Greek | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | +| `hy` | Armenian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `he` | Hebrew | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `is` | Icelandic | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `kn` | Kannada | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | @@ -225,5 +226,4 @@ Parity with `caouecs/laravel-lang` ![39/74 (52.7%)](https://img.shields.io/badge | `ug` | Uyghur | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `uz‑Cyrl` | Uzbek (Cyrillic) | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `vi` | Vietnamese | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | -| `cy` | Welsh | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | -| `hy` | Armenian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | \ No newline at end of file +| `cy` | Welsh | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | \ No newline at end of file diff --git a/contributors.json b/contributors.json index edaa765..84ea07c 100644 --- a/contributors.json +++ b/contributors.json @@ -14,6 +14,32 @@ "json": true, "php": true }, + "ar": { + "name": "Arabic", + "complete": 408, + "contributors": { + "saleem-hadad": 56, + "danyelkeddah": 50, + "omarfathy13": 26, + "CaddyDz": 12, + "i3asm": 10, + "Arryan": 3 + }, + "json": true, + "php": true + }, + "cs": { + "name": "Czech", + "complete": 408, + "contributors": { + "walaskir": 362, + "theimerj": 56, + "genesiscz": 12, + "walaski": 1 + }, + "json": true, + "php": true + }, "nl": { "name": "Dutch", "complete": 408, @@ -150,17 +176,6 @@ "json": true, "php": true }, - "cs": { - "name": "Czech", - "complete": 405, - "contributors": { - "walaskir": 362, - "theimerj": 56, - "walaski": 1 - }, - "json": true, - "php": true - }, "nb": { "name": "Norwegian Bokmål", "complete": 405, @@ -272,18 +287,6 @@ "json": true, "php": true }, - "ar": { - "name": "Arabic", - "complete": 398, - "contributors": { - "saleem-hadad": 56, - "danyelkeddah": 50, - "omarfathy13": 26, - "Arryan": 3 - }, - "json": true, - "php": true - }, "pl": { "name": "Polish", "complete": 397, @@ -333,7 +336,8 @@ "complete": 356, "contributors": { "olivernybroe": 364, - "rugaard": 8 + "rugaard": 8, + "peterchrjoergensen": 3 }, "json": true, "php": true @@ -501,6 +505,11 @@ "complete": 0, "contributors": [] }, + "hy": { + "name": "Armenian", + "complete": null, + "contributors": [] + }, "he": { "name": "Hebrew", "complete": 0, @@ -625,10 +634,5 @@ "name": "Welsh", "complete": 0, "contributors": [] - }, - "hy": { - "name": "Armenian", - "complete": null, - "contributors": [] } } \ No newline at end of file diff --git a/docs/introduction.md b/docs/introduction.md index b41e808..5b13282 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -12,9 +12,11 @@ This is not an official Laravel package, but is built from community contributio ### Available Languages Total languages **42** -Total lines translated **16,196 (94.5%)** +Total lines translated **16,209 (94.6%)** * `en` English · **408 (100%)** +* `ar` Arabic · **408 (100%)** +* `cs` Czech · **408 (100%)** * `nl` Dutch · **408 (100%)** * `fr` French · **408 (100%)** * `de` German · **408 (100%)** @@ -25,7 +27,6 @@ Total lines translated **16,196 (94.5%)** * `ru` Russian · **407 (99.8%)** * `pt‑BR` Brazilian Portuguese · **406 (99.5%)** * `ca` Catalan · **406 (99.5%)** -* `cs` Czech · **405 (99.3%)** * `nb` Norwegian Bokmål · **405 (99.3%)** * `ro` Romanian · **405 (99.3%)** * `sv` Swedish · **405 (99.3%)** @@ -37,7 +38,6 @@ Total lines translated **16,196 (94.5%)** * `ja` Japanese · **400 (98%)** * `fa` Farsi · **399 (97.8%)** * `tk` Turkmen · **399 (97.8%)** -* `ar` Arabic · **398 (97.5%)** * `pl` Polish · **397 (97.3%)** * `zh‑CN` Chinese (Simplified) · **393 (96.3%)** * `zh‑TW` Chinese (Traditional) · **393 (96.3%)** diff --git a/src/Commands/NovaLangStats.php b/src/Commands/NovaLangStats.php index b134fae..f9fdfd0 100644 --- a/src/Commands/NovaLangStats.php +++ b/src/Commands/NovaLangStats.php @@ -304,7 +304,13 @@ protected function getCaouecsLocales(): Collection protected function getJsonKeys(string $path): array { if ($this->filesystem->exists($path)) { - return array_diff(array_keys(json_decode($this->filesystem->get($path), true)), static::IGNORED_KEYS); + $json = json_decode($this->filesystem->get($path), true); + + if (!is_array($json)) { + throw new \Exception('Invalid JSON file: '.$path); + } + + return array_diff(array_keys($json), static::IGNORED_KEYS); } return []; @@ -315,7 +321,14 @@ protected function getPhpKeys(string $path): array return collect($this->filesystem->glob($path.'/*.php')) ->map(function (string $path) { $file = basename($this->filesystem->basename($path), '.php'); - $keys = collect(array_keys($this->filesystem->getRequire($path))) + + $php = $this->filesystem->getRequire($path); + + if (!is_array($php)) { + throw new \Exception('Invalid JSON file: ' . $path); + } + + $keys = collect(array_keys($php)) ->map(function ($key) use ($file) { return "$file.$key"; }); @@ -343,6 +356,8 @@ protected function caouecsMapping(string $caouecs): string $mapping = [ 'uz-cyrillic' => 'uz-Cyrl', 'uz-latin' => 'uz-Latn', + 'sr-cyrillic' => 'sr', + 'sr-latin' => 'sr-Latn', 'sr' => 'sr-Latn', 'me' => 'cnr', ];