Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwclouser@mozilla.com <wclouser@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2009-02-26 02:30:50 (GMT)
committer wclouser@mozilla.com <wclouser@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2009-02-26 02:30:50 (GMT)
commitd45ee460eb572c4d50ec9b70af5fa2c448c97b1d (patch)
treed94ddfa6f133128769708db50187d025d23f1963
parent462cc39f027b01dbf5c288ed4434f3233e84eddc (diff)
Adding a check for valid msgids
git-svn-id: http://svn.mozilla.org/addons/trunk@22648 4eb1ac78-321c-0410-a911-ec516a8615a5
-rw-r--r--site/app/tests/languageConfig.test.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/site/app/tests/languageConfig.test.php b/site/app/tests/languageConfig.test.php
index a9d87c1..56fe679 100644
--- a/site/app/tests/languageConfig.test.php
+++ b/site/app/tests/languageConfig.test.php
@@ -100,6 +100,22 @@ class LanguageConfigTest extends WebTestHelper {
}
/**
+ * Our msgids should conform to the AMO L10n standards. Details at
+ * https://wiki.mozilla.org/Update:Remora_Localization#L10n_standards
+ *
+ * We'll only check en-US here, but the others are built off en-US so it should be a good indicator.
+ */
+ function testLangFileIsValid() {
+ $_language_file = "{$this->language_config->text_domain}/en_US/LC_MESSAGES/messages.po";
+
+ $_language_file_contents = file_get_contents($_language_file);
+
+ // If this test fails there is a string with spaces in it which is most likely an English string or
+ // sentence. This should be fixed before merging en-US -> all locales
+ $this->assertEqual(preg_match('/^msgid\ ".*?\ .*?"$/m', $_language_file_contents), 0);
+ }
+
+ /**
* Checks and makes sure index pages will load with all valid languages
*/
function testLocalizedPagesLoad()