Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 02839b7

Browse filesBrowse files
committed
Add txpull utility for pulling translations from Transifex
1 parent 5ab569c commit 02839b7
Copy full SHA for 02839b7

File tree

Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed

‎txpull

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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."

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.