]> git.wh0rd.org Git - tt-rss.git/blob - utils/update-js-translations.sh
unify update_daemon, update_feeds and update_feedbrowser into update.php; move update...
[tt-rss.git] / utils / update-js-translations.sh
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 echo "This script is not used anymore."
9
10 exit 0 # disabled
11
12 cat >localized_js.php <<HEADER
13 <?php 
14 error_reporting(E_ERROR | E_WARNING | E_PARSE);
15 define('DISABLE_SESSIONS', true);
16
17 require "functions.php";
18 header("Content-Type: text/plain; charset=UTF-8");
19
20 function 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
34 var T_messages = new Object();
35
36 function __(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
46 HEADER
47
48 cat *js | ./utils/extract-i18n-js.pl | sort | uniq >> localized_js.php
49
50 cat >>localized_js.php <<FOOTER
51 ?>
52 FOOTER