aboutsummaryrefslogtreecommitdiffstats
path: root/langs/report_tx_git.php
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2014-12-23 10:54:17 +0100
committerfilip <filip.komar@gmail.com>2014-12-23 10:54:17 +0100
commitb5084d09d4f180ed8bf7481a860c20e1cab0ae0f (patch)
tree93df024fbe2366d62e7a9a75ed46408af5812cfa /langs/report_tx_git.php
parente1c6d13ee94d5f989ba9c5e9e28f50a0f172174d (diff)
downloadwww-b5084d09d4f180ed8bf7481a860c20e1cab0ae0f.tar
www-b5084d09d4f180ed8bf7481a860c20e1cab0ae0f.tar.gz
www-b5084d09d4f180ed8bf7481a860c20e1cab0ae0f.tar.bz2
www-b5084d09d4f180ed8bf7481a860c20e1cab0ae0f.tar.xz
www-b5084d09d4f180ed8bf7481a860c20e1cab0ae0f.zip
speed improvement for differences between Tx and our git report
Diffstat (limited to 'langs/report_tx_git.php')
-rw-r--r--langs/report_tx_git.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php
index dc4f5e8bb..a305142f3 100644
--- a/langs/report_tx_git.php
+++ b/langs/report_tx_git.php
@@ -140,8 +140,9 @@ function build_links($git_resource_name, $language_code, $resource_type, $stat_d
function generating_report($language_codes, $resource_names, $path = NULL, $pot_name = NULL)
{
$report = array();
- foreach ($language_codes as $l) {
- foreach ($resource_names as $f) {
+ foreach ($resource_names as $f) {
+ $source_strings = NULL;
+ foreach ($language_codes as $l) {
$references = '';
if (is_null($pot_name)) {
$resource = _extract_resource($f);
@@ -153,14 +154,14 @@ function generating_report($language_codes, $resource_names, $path = NULL, $pot_
$langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : '');
}
if (!is_null($path) || file_exists($langF)) {
- $stat = _po_diff($l, $resource, $path);
+ $stat = _po_diff($l, $resource, $source_strings, $path);
$num_of_fuzzy_or_missing = count($stat['fuzzy_or_missing']);
- $num_of_untranslated = count($stat['notrans']);
} else { // file $langF doesn't exists in 'Webpages' $resource_type
- $stat = _po_diff('en', $resource);
+ $stat = _po_diff('en', $resource, $source_strings);
$num_of_fuzzy_or_missing = 0;
- $num_of_untranslated = count($stat['notrans']);
}
+ $num_of_untranslated = count($stat['notrans']);
+ $source_strings = $stat['source_strings'];
// unify resource names, navigation is a special exception
$resource_name = str_replace(array('../_nav/langs/en', 'en/', '.pot'), array('nav', '', ''), $f);
// create pt_BR from pt-br and alike to unify languages