Skip to content

Commit

Permalink
fix stats
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbs committed Oct 25, 2020
1 parent 69b00fe commit b66e936
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand All @@ -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) |
Expand Down
14 changes: 7 additions & 7 deletions contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,6 @@
"json": true,
"php": true
},
"sq": {
"name": "Albanian",
"complete": 0,
"contributors": []
},
"az": {
"name": "Azerbaijani",
"complete": 0,
Expand Down Expand Up @@ -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": []
},
Expand Down
8 changes: 7 additions & 1 deletion src/Commands/NovaLangStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand All @@ -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
Expand Down

0 comments on commit b66e936

Please sign in to comment.