Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit02839b7

Browse files
committed
Add txpull utility for pulling translations from Transifex
1 parent5ab569c commit02839b7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎txpull

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp