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