Skip to content

Commit 7b68d4b

Browse files
committed
Map iOS language names to iso language names
1 parent 337cb6c commit 7b68d4b

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

Scripts/export_localizations.sh

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
#!/bin/zsh
22

3+
set -e
4+
35
LANGUAGES=(ar es ru en zh-Hans nl fr de it nb pl ru es ja pt-BR vi da sv fi ro tr he sk)
46

57
argstring="${LANGUAGES[@]/#/-exportLanguage }"
68
IFS=" "; args=( $=argstring )
79

8-
xcodebuild -exportLocalizations -localizationPath xlocs $args
9-
10-
#mkdir -p xliff
11-
#find xclocs -name '*.xliff' -exec cp {} xliff \;
12-
#
13-
#cd xliff
14-
#
15-
#foreach lang in $LANGUAGES
16-
# echo lokalise2 \
17-
# --token $LOKALISE_TOKEN \
18-
# --project-id 8069387863cdd837d11dd0.82955128 \
19-
# file upload \
20-
# --file ${lang}.xliff \
21-
# --lang-iso ${lang}
22-
#end
10+
xcodebuild -exportLocalizations -localizationPath xclocs $args
11+
12+
mkdir -p xliff
13+
find xclocs -name '*.xliff' -exec cp {} xliff \;
14+
15+
cd xliff
16+
17+
foreach lang in $LANGUAGES
18+
19+
lang_iso=$(sed "s/zh-Hans/zh_Hans_CN/g; s/pt-BR/pt_BR/g" <<<"$lang")
20+
21+
lokalise2 \
22+
--token $LOKALISE_TOKEN \
23+
--project-id 8069387863cdd837d11dd0.82955128 \
24+
file upload \
25+
--file ${lang}.xliff \
26+
--lang-iso ${lang_iso}
27+
end

0 commit comments

Comments
 (0)