aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'langs.inc.php')
-rw-r--r--langs.inc.php11
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); }
-
-