diff options
author | Filip Komar <filip@mageia.org> | 2013-08-10 14:55:24 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2013-08-10 14:55:24 +0000 |
commit | 4e92fedb5a6314351b255ae19d64227339b95274 (patch) | |
tree | c4524a4585359adb8d24ac416a6ecab0470aa402 /langs.inc.php | |
parent | fc6c1393fde5eba8d2491d3510e3bd4ecea69cd3 (diff) | |
download | www-4e92fedb5a6314351b255ae19d64227339b95274.tar www-4e92fedb5a6314351b255ae19d64227339b95274.tar.gz www-4e92fedb5a6314351b255ae19d64227339b95274.tar.bz2 www-4e92fedb5a6314351b255ae19d64227339b95274.tar.xz www-4e92fedb5a6314351b255ae19d64227339b95274.zip |
report page extended to show duplicate strings in lang files
Diffstat (limited to 'langs.inc.php')
-rw-r--r-- | langs.inc.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/langs.inc.php b/langs.inc.php index b06cfed04..da15b73d4 100644 --- a/langs.inc.php +++ b/langs.inc.php @@ -338,10 +338,11 @@ class i18n * Get all locales from given file. * * @param string $file + * @param string $return_duplicates optional switch * * @return array */ - public static function _lang_return($file) + public static function _lang_return($file, $return_duplicates = false) { $strings = array(); @@ -356,9 +357,15 @@ class i18n if ($C === ';' && !empty($f[$k+1])) { $j = trim(substr($v, 1)); $j = str_replace(array("\'", "\""), array("'", '"'), $j); + if ($return_duplicates && !empty($strings[$j])) { + $duplicates[] = $j; + } $strings[$j] = trim($f[$k+1]); } } + if (!empty($duplicates)) { + $strings['duplicates'] = $duplicates; + } } return $strings; @@ -404,5 +411,3 @@ function _e($s = null, $args = null) { return i18n::_e($s, $args); } function _h($s = null, $args = null, $tag = 'p') { return i18n::_h($s, $args, $tag); } function _lang_load($locale, $domain) { return i18n::_lang_load($locale, $domain); } - - |