Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2011-10-18 05:50:38 +0400
committermattpiwik <matthieu.aubry@gmail.com>2011-10-18 05:50:38 +0400
commit88359e6bd7f58b37b4e98a2441fda1716a6dbe5a (patch)
treefb0a488f1ee2c70ef1a9f0188751e34e7d817f3e /plugins/LanguagesManager
parent89969e125940b482fcb59cfc539466fb81afe70b (diff)
Adding Farsi language (Persian)!
Also updating other languages git-svn-id: http://dev.piwik.org/svn/trunk@5320 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/LanguagesManager')
-rw-r--r--plugins/LanguagesManager/tests/LanguagesManager.test.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/LanguagesManager/tests/LanguagesManager.test.php b/plugins/LanguagesManager/tests/LanguagesManager.test.php
index 2ffa3214cb..730fd4024e 100644
--- a/plugins/LanguagesManager/tests/LanguagesManager.test.php
+++ b/plugins/LanguagesManager/tests/LanguagesManager.test.php
@@ -30,6 +30,7 @@ class Test_LanguagesManager extends UnitTestCase
{
$englishStringsWithParameters[$stringLabel] = $count;
}
+ $englishStringsIndexed[$stringLabel] = $stringValue;
$expectedLanguageKeys[] = $stringLabel;
}
@@ -75,9 +76,9 @@ class Test_LanguagesManager extends UnitTestCase
echo "$language: The string $stringLabel was not found in the English language file, removing the line. <br/>\n";
$cleanedStrings[$stringLabel] = false;
}
- // checking that translated strings have the same number of %s as the english source strings
else
{
+ // checking that translated strings have the same number of %s as the english source strings
if(isset($englishStringsWithParameters[$stringLabel]))
{
$englishParametersCount = $englishStringsWithParameters[$stringLabel];
@@ -100,6 +101,18 @@ class Test_LanguagesManager extends UnitTestCase
$cleanedStrings[$stringLabel] = $stringValue;
}
}
+
+ // If the translation is the same as in English, we remove it from the translation file (as it might have been copied by
+ // the translator but this would skew translation stats
+ if(isset($englishStringsIndexed[$stringLabel])
+ && $englishStringsIndexed[$stringLabel] == $stringValue
+ //Currently hackjed for Persian since only the Farsi translation seems affected by "english copy paste"
+ && $language == 'fa')
+ {
+ $writeCleanedFile = true;
+ echo "$language: The string $stringLabel is the same as in English, removing... <br/>\n";
+ $cleanedStrings[$stringLabel] = false;
+ }
// remove excessive line breaks (and leading/trailing whitespace) from translations
if(!empty($cleanedStrings[$stringLabel]))
{