File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ if [ x" $1 " == x ];
4
+ then
5
+ echo " Usage: ./txpull <po file path> [<options or arguments for tx pull>]"
6
+ exit 1
7
+ fi
8
+
9
+ if [ ! -f " $1 " ];
10
+ then
11
+ echo " File $1 does not exist"
12
+ exit 1
13
+ fi
14
+
15
+ file=" $1 "
16
+ shift
17
+
18
+ resource_slug=" $( cat .tx/config | grep -B 1 $file | head -n 1 | sed ' s/\[\(.*\)\]/\1/' ) "
19
+ if [ x" $resource_slug " == x ];
20
+ then
21
+ echo " Resource of file $file not found"
22
+ exit 1
23
+ fi
24
+
25
+ echo " Pulling translations of $file from Transifex...\n"
26
+ echo " $ tx pull $@ -r $resource_slug "
27
+ tx pull $@ -r $resource_slug
28
+
29
+ echo " \nFixing format consistency in $file ...\n"
30
+ echo " $ poindent $file "
31
+ poindent $file
32
+
33
+ echo " sed -i '' -e 's/\" Language: zh-Hant\\\\ n\" /\" Language: zh_TW\\\\ n\" /' $file "
34
+ sed -i ' ' -e ' s/"Language: zh-Hant\\n"/"Language: zh_TW\\n"/' $file
35
+
36
+ echo " Done."
You can’t perform that action at this time.
0 commit comments