]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/update_po_templates.php
Don't accept non-objects before testing with "instanceof".
[quix0rs-gnu-social.git] / scripts / update_po_templates.php
index 0bfa62a22e79d2c47a8bfb84094a6d3cb4c3bf5e..a5730e6d2f7f43955e08db8173ec5049c671ae36 100755 (executable)
@@ -34,7 +34,7 @@ function update_core($dir, $domain)
 xgettext \
     --from-code=UTF-8 \
     --default-domain=$domain \
-    --output=locale/$domain.po \
+    --output=locale/$domain.pot \
     --language=PHP \
     --add-comments=TRANS \
     --keyword="_m:1,1t" \
@@ -43,6 +43,7 @@ xgettext \
     --keyword="_m:1c,2,3,4t" \
     --keyword="pgettext:1c,2" \
     --keyword="npgettext:1c,2,3" \
+    index.php \
     actions/*.php \
     classes/*.php \
     lib/*.php \
@@ -64,7 +65,7 @@ function do_update_plugin($dir, $domain)
 xgettext \
     --from-code=UTF-8 \
     --default-domain=$domain \
-    --output=locale/$domain.po \
+    --output=locale/$domain.pot \
     --language=PHP \
     --add-comments=TRANS \
     --keyword='' \
@@ -81,45 +82,6 @@ END;
     chdir($old);
 }
 
-function do_translatewiki_plugin($basedir, $plugin)
-{
-    $yamldir = "$basedir/locale/TranslateWiki";
-    if (!file_exists($yamldir)) {
-        mkdir($yamldir);
-    }
-    $outfile = "$yamldir/StatusNet-{$plugin}.yml";
-    $pluginlc = strtolower( $plugin );
-    $data = <<<END
----
-BASIC:
-  id: out-statusnet-{$pluginlc}
-  label: StatusNet - {$plugin}
-  description: "{{int:bw-desc-statusnet-plugin-{$pluginlc}}}"
-  namespace: NS_STATUSNET
-  display: out/statusnet/{$pluginlc}
-  class: GettextMessageGroup
-
-FILES:
-  class: GettextFFS
-  sourcePattern: %GROUPROOT%/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
-  targetPattern: plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
-  codeMap:
-    en-gb: en_GB
-    no: nb
-    pt-br: pt_BR
-    zh-hans: zh_CN
-    zh-hant: zh_TW
-
-MANGLER
-  class: StringMatcher
-  prefix: {$pluginlc}-
-  patterns:
-    - "*"
-
-END;
-    file_put_contents($outfile, $data);
-}
-
 function get_plugins($dir)
 {
     $plugins = array();
@@ -168,7 +130,6 @@ function update_plugin($basedir, $name)
     $dir = "$basedir/plugins/$name";
     if (plugin_using_gettext($dir)) {
         do_update_plugin($dir, $name);
-        do_translatewiki_plugin($basedir, $name);
         return true;
     } else {
         return false;
@@ -200,8 +161,6 @@ foreach ($args as $arg) {
     }
 }
 
-
-
 if ($all || $core) {
     echo "core...";
     update_core(INSTALLDIR, 'statusnet');