diff options
author | Filip Komar <filip@mageia.org> | 2014-03-08 21:21:32 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2014-03-08 21:21:32 +0000 |
commit | b0e15407a664677201a3b9b8251786652b5e147f (patch) | |
tree | 0b27bd5d843ba2f3e00831e4b90efdc73bf271b9 /langs/lib.php | |
parent | 42fa789ce0ea2df5240c17e0ea35e2a1f1a6742c (diff) | |
download | www-b0e15407a664677201a3b9b8251786652b5e147f.tar www-b0e15407a664677201a3b9b8251786652b5e147f.tar.gz www-b0e15407a664677201a3b9b8251786652b5e147f.tar.bz2 www-b0e15407a664677201a3b9b8251786652b5e147f.tar.xz www-b0e15407a664677201a3b9b8251786652b5e147f.zip |
further preparation of l10n report family w/o 3 exceptions (nav, license, constitution) to gettext system
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() |