From 3631839e54e9b86f75c56607961ed78c9edbd24b Mon Sep 17 00:00:00 2001 From: nikrou Date: Wed, 17 Mar 2010 09:22:51 +0000 Subject: Revert gettext stuff. Keep english values for language keys translation. Provide a script to use english values for key in language files. Todo : provide a script (to help transition) to keep using original keys in language files for translators. git-svn-id: http://piwigo.org/svn/trunk@5156 68402e56-0260-453c-a942-63ccdbb3a9ee --- tools/key2value.php | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100755 tools/key2value.php (limited to 'tools') diff --git a/tools/key2value.php b/tools/key2value.php new file mode 100755 index 000000000..c7c90bde0 --- /dev/null +++ b/tools/key2value.php @@ -0,0 +1,126 @@ +#!/usr/bin/php -qn + $value) + { + fwrite($fh, sprintf("\$lang_info['%s'] = \"%s\";\n", + $key, + $value + ) + ); + } + } + fwrite($fh, "\n\n"); + + foreach ($lang as $key => $value) + { + if (is_array($value)) + { + foreach ($value as $k => $v) + { + fwrite($fh, sprintf("\$lang['%s'][%s] = \"%s\";\n", + str_replace("'", "\'", trim($key)), + trim($k), + str_replace('"', '\"', trim($source_lang[$key][$k])) + ) + ); + } + } + elseif (in_array($key, $exclude_keys)) + { + fwrite($fh, sprintf("\$lang['%s'] = \"%s\";\n", + str_replace("'", "\'", trim($key)), + str_replace('"', '\"', trim($source_lang[$key])) + ) + ); + } + else + { + fwrite($fh, sprintf("\$lang['%s'] = \"%s\";\n", + str_replace("'", "\'", trim($value)), + str_replace('"', '\"', trim($source_lang[$key])) + ) + ); + } + } + fwrite($fh, '?>'); + fclose($fh); + } + catch (Exception $e) + { + print $e->getMessage(); + } +} + +function help() +{ + echo "\n"; + echo 'usage : ', basename($_SERVER['argv'][0]), " \n"; + echo "\n"; + exit(1); +} + +function copyright() +{ + return +' \ No newline at end of file -- cgit v1.2.3