From 9ce6d646ff718cd62f6434c9a4c94e450436612a Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Sun, 12 Oct 2014 12:27:45 +0300 Subject: Revert "Updated Estonian translation" This reverts commit a0b2d09125d7911656fe4cb286f20643c4432281. --- tools/extract2lang.php | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 tools/extract2lang.php (limited to 'tools/extract2lang.php') diff --git a/tools/extract2lang.php b/tools/extract2lang.php new file mode 100644 index 000000000..17d8417ff --- /dev/null +++ b/tools/extract2lang.php @@ -0,0 +1,105 @@ + $strs) { + $f[] = sprintf('# Generated by extract2lang.php on %s', date('c')); + $f[] = sprintf('# Domain %s', $domain); + $f[] = '# include translation strings from:'; + $files = array_unique($files); + foreach ($files as $source) { + $f[] = sprintf('# %s', $source); + } + + foreach ($strs as $str => $info) { + $str = str_replace(array("\'", "\""), array("'", '"'), $str); + $f[] = ''; + $f[] = sprintf('# %s', $info[0]); + $f[] = ';' . $str; + $f[] = $str; + $f[] = ''; + } + $f = implode("\n", $f); + $dest = sprintf('%s/langs/%s/%s.%s.lang', APP_ROOT, 'en', $domain, 'en'); + $dir = dirname($dest); + + if (!is_dir($dir)) { + echo "making $dir\n"; + mkdir($dir, 0755, true); + } + echo sprintf("saved %d strings in %s\n", count($strs), $dest); + if (FALSE === file_put_contents($dest, $f)) + echo "Failed to write.\n"; +} +echo "Done. kthxbye.\n"; +exit($error); -- cgit v1.2.1