]>
Commit | Line | Data |
---|---|---|
10bccf7d AD |
1 | #!/bin/sh |
2 | ||
3 | if [ ! -f localized_js.php ]; then | |
4 | echo "please run this script from tt-rss directory" | |
5 | exit 1 | |
6 | fi | |
7 | ||
8 | cat >localized_js.php <<HEADER | |
9 | <?php | |
10 | error_reporting(E_ERROR | E_WARNING | E_PARSE); | |
11 | define('DISABLE_SESSIONS', true); | |
12 | ||
13 | require "functions.php"; | |
14 | header("Content-Type: text/plain; charset=UTF-8"); | |
15 | ||
16 | function T_js_decl(\$s1) { | |
17 | ||
18 | if (!\$s1) return; | |
19 | ||
20 | // \$T_s1 = __(\$s1); | |
21 | ||
22 | // if (\$T_s1 != \$s1) { | |
23 | return "T_messages[\"\$s1\"] = \"".__(\$s1)."\";\n"; | |
24 | // } else { | |
25 | // return ""; | |
26 | // } | |
27 | } | |
28 | ?> | |
29 | ||
30 | var T_messages = new Object(); | |
31 | ||
32 | function __(msg) { | |
33 | if (T_messages[msg]) { | |
34 | return T_messages[msg]; | |
35 | } else { | |
36 | debug('[gettext] not found: ' + msg); | |
37 | return msg; | |
38 | } | |
39 | } | |
40 | ||
41 | <?php | |
42 | HEADER | |
43 | ||
44 | cat *js | ./utils/extract-i18n-js.pl | sort | uniq >> localized_js.php | |
45 | ||
46 | cat >>localized_js.php <<FOOTER | |
47 | ?> | |
48 | FOOTER |