From b66e9364d984896e4a58074f537dcb842f1127ae Mon Sep 17 00:00:00 2001 From: Kit Burton-Senior Date: Sun, 25 Oct 2020 12:09:19 +0000 Subject: [PATCH] fix stats --- README.md | 4 ++-- contributors.json | 14 +++++++------- src/Commands/NovaLangStats.php | 8 +++++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 27494e8..cafadce 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,12 @@ Total lines translated ![16,234 (92%)](https://img.shields.io/badge/16,234-92%25 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` ![0/0 (0%)](https://img.shields.io/badge/0%2F0-0%25-lightgray?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 | | --- | --- | --- | | `sq` | Albanian | ![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) | | `az` | Azerbaijani | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `bn` | Bangla | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `be` | Belarusian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | @@ -145,7 +146,6 @@ Parity with `caouecs/laravel-lang` ![0/0 (0%)](https://img.shields.io/badge/0%2F | `km` | Khmer | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `ko` | Korean | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `lv` | Latvian | ![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) | | `mk` | Macedonian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `ms` | Malay | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | | `mr` | Marathi | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) | diff --git a/contributors.json b/contributors.json index a35f1cd..4f043a4 100644 --- a/contributors.json +++ b/contributors.json @@ -464,11 +464,6 @@ "json": true, "php": true }, - "sq": { - "name": "Albanian", - "complete": 0, - "contributors": [] - }, "az": { "name": "Azerbaijani", "complete": 0, @@ -544,13 +539,18 @@ "complete": 0, "contributors": [] }, + "mk": { + "name": "Macedonian", + "complete": 0, + "contributors": [] + }, "hy": { "name": "Armenian", "complete": null, "contributors": [] }, - "mk": { - "name": "Macedonian", + "sq": { + "name": "Albanian", "complete": 0, "contributors": [] }, diff --git a/src/Commands/NovaLangStats.php b/src/Commands/NovaLangStats.php index f9fdfd0..5a0b480 100644 --- a/src/Commands/NovaLangStats.php +++ b/src/Commands/NovaLangStats.php @@ -155,6 +155,10 @@ public function handle() return sprintf('| `%s` | %s | %s %s | ![%d (%s%%)](%s) | %s |', str_replace('-', '‑', $locale), $localeStat['name'], $hasJson, $hasPhp, $localeStat['complete'], $percent, $icon, $contributors); }); + $missing = $missing->sortBy(function($localeStat) { + return $localeStat['name']; + }); + $missing->transform(function($localeStat, $locale) use ($sourceCount) { $icon = $this->getPercentIcon(0, 0); @@ -353,6 +357,8 @@ protected function directoryCaouecsSource(): string protected function caouecsMapping(string $caouecs): string { + $caouecs = str_replace('_', '-', $caouecs); + $mapping = [ 'uz-cyrillic' => 'uz-Cyrl', 'uz-latin' => 'uz-Latn', @@ -362,7 +368,7 @@ protected function caouecsMapping(string $caouecs): string 'me' => 'cnr', ]; - return $mapping[$caouecs] ?? $caouecs; + return $mapping[strtolower($caouecs)] ?? $caouecs; } protected function getBlame(): array