diff options
Diffstat (limited to 'langs/lib.php')
-rw-r--r-- | langs/lib.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/langs/lib.php b/langs/lib.php index 05740418d..15f133131 100644 --- a/langs/lib.php +++ b/langs/lib.php @@ -91,13 +91,13 @@ function _po_diff($locale, $resource) $missing = array(); foreach ($source_l as $escaped_string => $subarray) { - if ($escaped_string == $subarray["msgid"]) { // filter out header + if (!empty($subarray["msgid"])) { // filter out header $pot_strings[$escaped_string] = $subarray["msgid"]; } } foreach ($target_l as $escaped_string => $subarray) { - if ($escaped_string == $subarray["msgid"]) { // filter out header + if (!empty($subarray["msgid"])) { // filter out header $po_strings[$escaped_string] = $subarray["msgstr"][0]; } } @@ -115,10 +115,10 @@ function _po_diff($locale, $resource) return array( 'a' => count($pot_strings), // # of original strings // 'b' => count($po_strings), // # of target strings - 'missing' => $missing, // probably could be empty array() of missing strings - 'notrans' => $untrans, // array of untranslated strings - 'extra' => array(), // could be empty array() of unused (old) strings - 'dup_str' => array(), // could be empty array() of duplicate strings + 'missing' => $missing, + 'notrans' => $untrans, + 'extra' => array(), + 'dup_str' => array(), ); } @@ -189,7 +189,9 @@ function _lang_file_switch($s, $l) */ function _po_file_switch($s, $l) { - $s = str_replace('.pot', '.po', $s); + if($l != 'en') { + $s = str_replace('.pot', '.po', $s); + } return str_replace('en/', $l . '/', $s); } @@ -208,9 +210,9 @@ function _extract_resource($source_file, $extension = '.pot') return str_replace('en/', '', $resource); } -function get_lang_references() +function get_lang_references($pattern = '*') { - return glob_recursive('en/*', GLOB_MARK); + return glob_recursive('en/' . $pattern, GLOB_MARK); } function get_other_langs() |