Skip to content

Commit ee47a0b

Browse files
authored
Standalone development commands (#270)
1 parent c022f38 commit ee47a0b

20 files changed

+1091
-1078
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
/.gitattributes export-ignore
22
/.gitignore export-ignore
33
/.styleci.yml export-ignore
4+
/dev export-ignore
5+
/docs export-ignore
6+
/nova-lang export-ignore
7+
/contributors.json export-ignore
8+
/development-commands.md export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
vendor
22
composer.lock
33
.idea
4+
.github_token
5+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/dev',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->ignoreDotFiles(true)
11+
->ignoreVCS(true);
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@PSR12' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
18+
'no_unused_imports' => true,
19+
'not_operator_with_successor_space' => true,
20+
'trailing_comma_in_multiline' => true,
21+
'phpdoc_scalar' => true,
22+
'unary_operator_spaces' => true,
23+
'binary_operator_spaces' => true,
24+
'blank_line_before_statement' => [
25+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
26+
],
27+
'phpdoc_single_line_var_spacing' => true,
28+
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method' => 'one',
32+
],
33+
],
34+
'method_argument_space' => [
35+
'on_multiline' => 'ensure_fully_multiline',
36+
'keep_multiple_spaces_after_comma' => true,
37+
],
38+
'single_trait_insert_per_statement' => true,
39+
])
40+
->setFinder($finder);

README.md

Lines changed: 47 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,69 @@ composer require coderello/laravel-nova-lang
1414

1515
## Usage
1616
### Publish Command
17-
* Publish translations for one language:
18-
```bash
19-
php artisan nova-lang:publish de
20-
```
21-
22-
* Publish translations for multiple languages (comma-separated):
23-
```bash
24-
php artisan nova-lang:publish de,ru
25-
```
26-
27-
* Publish translations for all available languages:
28-
```bash
29-
php artisan nova-lang:publish --all
30-
```
31-
32-
* Publish translations and override existing files:
33-
```bash
34-
php artisan nova-lang:publish de,ru --force
35-
```
17+
##### Publish translations for one language:
18+
```bash
19+
php artisan nova-lang:publish de
20+
```
21+
22+
##### Publish translations for multiple languages (comma-separated):
23+
```bash
24+
php artisan nova-lang:publish de,ru
25+
```
26+
27+
##### Publish translations for all available languages:
28+
```bash
29+
php artisan nova-lang:publish --all
30+
```
31+
32+
##### Publish translations and override existing files:
33+
```bash
34+
php artisan nova-lang:publish de,ru --force
35+
```
3636

3737
#### Aliases
3838
The language codes chosen for the files in this repository may not match the preferences for your project. You can use the `‑‑alias` option to publish locales using a different filename.
3939

40-
* Publish translations for one language with an alias, using the simple format `{alias}`:
41-
```bash
42-
php artisan nova-lang:publish de --alias=de-DE
43-
```
44-
This will publish the file `de-DE.json`.
40+
##### Publish translations for one language with an alias, using the simple format `{alias}`:
41+
```bash
42+
php artisan nova-lang:publish de --alias=de-DE
43+
```
44+
45+
This will publish the file `de-DE.json`.
46+
47+
##### Publish translations for multiple languages with multiple aliases, using the format `{locale}:{alias}` (comma-separated):
48+
```bash
49+
php artisan nova-lang:publish de,ru,fr --alias=de:de-DE,ru:ru-RU
50+
```
4551

46-
* Publish translations for multiple languages with multiple aliases, using the format `{locale}:{alias}` (comma-separated):
47-
```bash
48-
php artisan nova-lang:publish de,ru,fr --alias=de:de-DE,ru:ru-RU
49-
```
50-
This will publish the files `de-DE.json`, `ru-RU.json` and `fr.json` (no alias).
52+
This will publish the files `de-DE.json`, `ru-RU.json` and `fr.json` (no alias).
5153

52-
* Aliases can also be used with the `--all` flag:
54+
##### Aliases can also be used with the `--all` flag:
5355

54-
```bash
55-
php artisan nova-lang:publish --all --alias=es:es-ES
56-
```
57-
You do not need to supply an alias for every locale that is to be published, only those that you wish to override.
56+
```bash
57+
php artisan nova-lang:publish --all --alias=es:es-ES
58+
```
5859

59-
* Here are some example aliases for common use cases:
60+
You do not need to supply an alias for every locale that is to be published, only those that you wish to override.
6061

61-
* Use Chinese with scripts instead of regions: `zh-CN:zh-Hans,zh-TW:zh-Hant`
62-
* Default to Brazilian Portuguese over European: `pt:pt-PT,pt-BR:pt`
63-
* Default to Serbian in Latin script over Cyrillic: `sr-Latn:sr,sr:sr-Cyrl`
62+
Here are some example aliases for common use cases:
6463

64+
* Use Chinese with scripts instead of regions: `zh-CN:zh-Hans,zh-TW:zh-Hant`
65+
* Default to Brazilian Portuguese over European: `pt:pt-PT,pt-BR:pt`
66+
* Default to Serbian in Latin script over Cyrillic: `sr-Latn:sr,sr:sr-Cyrl`
6567

66-
* There is also an `‑‑underscore` or `‑U` switch to publish locales with an underscore separator instead of a hyphen. This can be used in combination with aliases.
68+
69+
There is also an `--underscore` or `-U` switch to publish locales with an underscore separator instead of a hyphen. This can be used in combination with aliases.
6770

6871
### Development Commands
6972

70-
Documentation of development commands for contributors is available at [Development Commands](development-commands.md).
73+
Documentation of development commands for contributors and maintainers is available at [Development Commands](development-commands.md).
7174

7275
## Available Languages
7376

74-
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.
77+
We welcome new languages and additions/improvements to existing languages! Please read our [contributing guidelines](CONTRIBUTING.md) and raise a PR.
78+
79+
**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.
7580

7681
Total languages ![44](https://img.shields.io/badge/44-gray?style=flat-square)
7782
Total lines translated ![17,207 (92.2%)](https://img.shields.io/badge/17,207-92%25-yellow?style=flat-square)
@@ -121,47 +126,4 @@ Total lines translated ![17,207 (92.2%)](https://img.shields.io/badge/17,207-92%
121126
| `sl` | Slovenian | [`php`](resources/lang/sl) [`json`](resources/lang/sl.json) | ![351 (82.8%)](https://img.shields.io/badge/351-82%25-red?style=flat-square) | [morpheus7CS](https://github.com/morpheus7CS) |
122127
| `lt` | Lithuanian | [`php`](resources/lang/lt) [`json`](resources/lang/lt.json) | ![350 (82.5%)](https://img.shields.io/badge/350-82%25-red?style=flat-square) | [minved](https://github.com/minved) |
123128
| `bg` | Bulgarian | [`php`](resources/lang/bg) [`json`](resources/lang/bg.json) | ![348 (82.1%)](https://img.shields.io/badge/348-82%25-red?style=flat-square) | [BKirev](https://github.com/BKirev) |
124-
| `tl` | Tagalog | [`php`](resources/lang/tl) [`json`](resources/lang/tl.json) | ![344 (81.1%)](https://img.shields.io/badge/344-81%25-red?style=flat-square) | [rcjavier](https://github.com/rcjavier) |
125-
126-
## Missing Languages
127-
128-
The following languages are supported for the main Laravel framework by the excellent [laravel-lang/lang](https://github.com/laravel-lang/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.
129-
130-
Parity with `laravel-lang/lang` ![42/76 (55.3%)](https://img.shields.io/badge/42%2F76-55%25-red?style=flat-square)
131-
132-
| Code | Language | Lines translated |
133-
| --- | --- | --- |
134-
| `sq` | Albanian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
135-
| `hy` | Armenian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
136-
| `az` | Azerbaijani | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
137-
| `bn` | Bangla | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
138-
| `be` | Belarusian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
139-
| `zh‑HK` | Chinese (Hong Kong) | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
140-
| `et` | Estonian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
141-
| `gl` | Galician | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
142-
| `de‑CH` | German (Switzerland) | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
143-
| `el` | Greek | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
144-
| `he` | Hebrew | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
145-
| `is` | Icelandic | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
146-
| `kn` | Kannada | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
147-
| `kk` | Kazakh | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
148-
| `ko` | Korean | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
149-
| `lv` | Latvian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
150-
| `mk` | Macedonian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
151-
| `ms` | Malay | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
152-
| `mr` | Marathi | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
153-
| `mn` | Mongolian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
154-
| `cnr` | Montenegrin | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
155-
| `ne` | Nepali | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
156-
| `nn` | Norwegian Nynorsk | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
157-
| `oc` | Occitan | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
158-
| `ps` | Pashto | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
159-
| `sc` | Sardinian | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
160-
| `si` | Sinhala | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
161-
| `sw` | Swahili | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
162-
| `tg` | Tajik | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
163-
| `th` | Thai | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
164-
| `ug` | Uyghur | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
165-
| `uz‑Cyrl` | Uzbek (Cyrillic) | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
166-
| `vi` | Vietnamese | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
167-
| `cy` | Welsh | ![0 (0%)](https://img.shields.io/badge/0-0%25-lightgray?style=flat-square) |
129+
| `tl` | Tagalog | [`php`](resources/lang/tl) [`json`](resources/lang/tl.json) | ![344 (81.1%)](https://img.shields.io/badge/344-81%25-red?style=flat-square) | [rcjavier](https://github.com/rcjavier) |

composer.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,32 @@
55
"type": "library",
66
"license": "MIT",
77
"require": {
8-
"php": "^7.1|^8.0",
9-
"laravel/framework": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0"
8+
"php": "^7.1|^8.0"
9+
},
10+
"require-dev": {
11+
"php": "^8.0",
12+
"ext-curl": "*",
13+
"laravel/nova": "~3.0",
14+
"illuminate/console": "^8.0",
15+
"illuminate/filesystem": "^8.0",
16+
"illuminate/events": "^8.0"
1017
},
1118
"autoload": {
1219
"psr-4": {
1320
"Coderello\\LaravelNovaLang\\": "src/"
1421
}
1522
},
23+
"autoload-dev": {
24+
"psr-4": {
25+
"Coderello\\LaravelNovaLang\\": "dev/"
26+
}
27+
},
28+
"repositories": [
29+
{
30+
"type": "composer",
31+
"url": "https://nova.laravel.com"
32+
}
33+
],
1634
"extra": {
1735
"laravel": {
1836
"providers": [

contributors.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@
3232
"json": true,
3333
"php": true
3434
},
35-
"ka": {
36-
"name": "Georgian",
37-
"complete": 424,
38-
"contributors": {
39-
"akalongman": 364,
40-
"zgabievi": 77
41-
},
42-
"json": true,
43-
"php": true
44-
},
4535
"de": {
4636
"name": "German",
4737
"complete": 424,
@@ -415,6 +405,15 @@
415405
"json": true,
416406
"php": true
417407
},
408+
"ka": {
409+
"name": "Georgian",
410+
"complete": 351,
411+
"contributors": {
412+
"akalongman": 364
413+
},
414+
"json": true,
415+
"php": true
416+
},
418417
"hi": {
419418
"name": "Hindi",
420419
"complete": 351,

0 commit comments

Comments
 (0)