Skip to content

Commit 885e4fe

Browse files
committed
rollback predefined aliases
1 parent d86844a commit 885e4fe

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ php artisan nova-lang:publish de,ru,fr --alias=de:de-DE,ru:ru-RU
5555
```
5656
You do not need to supply an alias for every locale that is to be published, only those that you wish to override.
5757

58-
* There are also some predefined option flags (case-sensitive) for common use cases:
58+
* Here are some example aliases for common use cases:
5959

60-
| Option | Explanation | Affected Languages | When Enabled | Default |
61-
| --- | --- | --- | --- | --- |
62-
| `‑‑zhHan` | Use Chinese scripts instead of regions. | Chinese&nbsp;(Simplified)<br>Chinese&nbsp;(Traditional) | `zh‑Hans`<br>`zh‑Hant` | `zh‑CN`<br>`zh‑TW` |
63-
| `‑‑ptBR` | Prefer Brazilian Portuguese. | Portuguese&nbsp;(Brazil)<br>Portuguese&nbsp;(Portugal) | `pt`<br>`pt‑PT` | `pt‑BR`<br>`pt` |
64-
| `‑‑srLatn` | Prefer Serbian in Latin script. | Serbian&nbsp;(Cyrillic)<br>Serbian&nbsp;(Latin) | `sr‑Cyrl`<br>`sr` | `sr`<br>`sr‑Latn` |
65-
| `‑U` or<br>`‑‑underscore` | Use underscore separator. | _(any)_ | _e.g._&nbsp;`zh_CN` | _e.g._&nbsp;`zh‑CN` |
60+
* `zh-CN:zh-Hans,zh-TW:zh-Hant` (Use Chinese scripts instead of regions.)
61+
* `pt:pt-PT,pt-BR:pt` (Brazilian Portuguese as default over European.)
62+
* `sr-Latn:sr,sr:sr-Cyrl` (Serbian in Latin script as default over Cyrillic.)
6663

67-
These can all be used alone or in combination with each other and the `--alias` option.
64+
65+
* There is also a `‑U` or`‑‑underscore` switch to publish locales with an underscore separator instead of a hyphen. This can be used in combination with aliases.
6866

6967
### Development Commands (debug mode only)
7068

src/Commands/NovaLangPublish.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ class NovaLangPublish extends Command
1818
{locales? : Comma-separated list of languages}
1919
{--all : Publish all languages}
2020
{--alias= : Publish files using a different filename for certain locales, in the format "locale:alias,..."}
21-
{--zhHan : Publish Chinese translations as "zh-Hans/Hant" instead of "zh-CN/TW" }
22-
{--ptBR : Publish Portuguese translations prioritizing "pt-BR" as "pt" over "pt-PT" }
23-
{--srLatn : Publish Serbian translations prioritizing "sr-Latn" as "sr" instead of "sr-Cyrl" }
2421
{--U|underscore : Use underscore instead of dash as locale separator }
2522
{--force : Override existing files}';
2623

@@ -161,12 +158,7 @@ protected function getLocaleAliases($single = false): Collection
161158
{
162159
$aliases = collect();
163160

164-
$input = implode(',', array_filter([
165-
$this->option('alias'),
166-
$this->option('ptBR') ? 'pt:pt-PT,pt-BR:pt' : null,
167-
$this->option('zhHan') ? 'zh-CN:zh-Hans,zh-TW:zh-Hant' : null,
168-
$this->option('srLatn') ? 'sr-Latn:sr,sr:sr-Cyrl' : null,
169-
]));
161+
$input = $this->option('alias');
170162

171163
if ($input) {
172164

0 commit comments

Comments
 (0)