From c4ddc8031f4fd12345a326697439c6136cb59dbd Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 19 Aug 2014 12:45:03 -0700 Subject: Add Italian translation and synchronize locale files --- scripts/sync-locales.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 scripts/sync-locales.php (limited to 'scripts') diff --git a/scripts/sync-locales.php b/scripts/sync-locales.php new file mode 100755 index 00000000..00d6c897 --- /dev/null +++ b/scripts/sync-locales.php @@ -0,0 +1,43 @@ +#!/usr/bin/env php + $value) { + + if (isset($outdated[$key])) { + //$output .= " '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $value)."',\n"; + $output .= " '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $outdated[$key])."',\n"; + } + else { + //$output .= " // '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $value)."',\n"; + $output .= " // '".str_replace("'", "\'", $key)."' => '',\n"; + } + } + + $output .= ");\n"; + return $output; +} + + +foreach (new DirectoryIterator('app/Locales') as $fileInfo) { + + if (! $fileInfo->isDot() && $fileInfo->isDir() && $fileInfo->getFilename() !== $reference_lang) { + + $filename = 'app/Locales/'.$fileInfo->getFilename().'/translations.php'; + + echo $fileInfo->getFilename().' ('.$filename.')'.PHP_EOL; + + file_put_contents($filename, update_missing_locales($reference, $filename)); + } +} -- cgit v1.2.3