Skip to content

Commit 9a698b6

Browse files
committed
add predefined aliases for zh-Hans/Hant and pt-PT/BR
1 parent 30e53f0 commit 9a698b6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Commands/NovaLangPublish.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class NovaLangPublish extends Command
1818
{locales? : Comma-separated list of languages}
1919
{--all : Publish all languages}
2020
{--alias= : Publish files with a different filename for the locale}
21+
{--zhHans : Publish Chinese translations preferring \'script\' or \'region\' }
22+
{--ptBR : Publish Portuguese translations preferring \'BR\' or \'PT\' }
2123
{--force : Override existing files}';
2224

2325
/**
@@ -153,7 +155,13 @@ protected function getLocaleAliases($single = false): Collection
153155
{
154156
$aliases = collect();
155157

156-
if ($input = $this->option('alias')) {
158+
$input = implode(',', array_filter([
159+
$this->option('alias'),
160+
$this->option('ptBR') ? 'pt:pt-PT,pt-BR:pt' : null,
161+
$this->option('zhHans') ? 'zh-CN:zh-Hans,zh-TW:zh-Hant' : null,
162+
]));
163+
164+
if ($input) {
157165

158166
$inputs = explode(',', $input);
159167

0 commit comments

Comments
 (0)