Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.18
diff -u -p -r1.18 locale.test
--- modules/locale/locale.test	22 Feb 2009 20:55:18 -0000	1.18
+++ modules/locale/locale.test	24 Feb 2009 00:21:35 -0000
@@ -55,13 +55,13 @@ class LocaleConfigurationTest extends Dr
 
     // Add custom language.
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     $edit = array(
       'langcode' => $langcode,
       'name' => $name,
@@ -188,13 +188,13 @@ class LocaleTranslationFunctionalTest ex
     // User to translate and delete string.
     $translate_user = $this->drupalCreateUser(array('translate interface', 'access administration pages'));
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language. This will be translated.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     // This is the language indicator on the translation search screen for
     // untranslated strings. Copied straight from locale.inc.
     $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> ";
@@ -314,13 +314,13 @@ class LocaleTranslationFunctionalTest ex
     // User to add language and strings.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface'));
     $this->drupalLogin($admin_user);
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language. This will be translated.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     // This is the language indicator on the translation search screen for
     // untranslated strings. Copied straight from locale.inc.
     $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> ";
@@ -381,13 +381,13 @@ class LocaleTranslationFunctionalTest ex
     $translate_user = $this->drupalCreateUser(array('translate interface', 'access administration pages'));
 
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language. This will be translated.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     // This is the language indicator on the translation search screen for
     // untranslated strings. Copied straight from locale.inc.
     $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> ";
@@ -655,22 +655,14 @@ class LocaleImportFunctionalTest extends
    * is enabled.
    */
   function testAutomaticModuleTranslationImportLanguageEnable() {
-    // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    // Code for the language - manually set to match the test translation file.
+    $langcode = 'xx';
     // The English name for the language.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
-
-    // Create a .po file.
-    $translations_dir = drupal_get_path('module', 'locale_test') .  '/translations/';
-    if (!file_exists($translations_dir)) {
-      mkdir($translations_dir);
-    }
-    $filename = $translations_dir . $langcode . '.po';
-    file_put_contents($filename, $this->getPoFile());
+    $prefix = $langcode;
 
     // Create a custom language.
     $edit = array(
@@ -695,9 +687,6 @@ class LocaleImportFunctionalTest extends
     );
     $this->drupalPost('admin/build/translate/translate', $search, t('Filter'));
     $this->assertNoText(t('No strings found for your search.'), t('String successfully imported.'));
-
-    // Remove our temporary .po file.
-    unlink($filename);
   }
 
   /**
@@ -1102,13 +1091,13 @@ class LocaleUserLanguageFunctionalTest e
     // Add custom language.
     $this->drupalLogin($admin_user);
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = 'xx';
     $edit = array(
       'langcode' => $langcode,
       'name' => $name,
@@ -1120,13 +1109,13 @@ class LocaleUserLanguageFunctionalTest e
 
     // Add custom language and disable it.
     // Code for the language.
-    $langcode_disabled = $this->randomName(6, 'si-');
+    $langcode_disabled = 'xx-yy';
     // The English name for the language. This will be translated.
     $name_disabled = $this->randomName(16);
     // The native name for the language.
     $native_disabled = $this->randomName(16);
     // The domain prefix.
-    $prefix_disabled = strtolower(str_replace('si-', '', $langcode_disabled));
+    $prefix_disabled = $langcode_disabled;
     $edit = array(
       'langcode' => $langcode_disabled,
       'name' => $name_disabled,
@@ -1195,13 +1184,13 @@ class LocalePathFunctionalTest extends D
     // Add custom language.
     $this->drupalLogin($admin_user);
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     $edit = array(
       'langcode' => $langcode,
       'name' => $name,
@@ -1281,13 +1270,13 @@ class LocaleContentFunctionalTest extend
     // Add custom language.
     $this->drupalLogin($admin_user);
     // Code for the language.
-    $langcode = $this->randomName(6, 'si-');
+    $langcode = 'xx';
     // The English name for the language.
     $name = $this->randomName(16);
     // The native name for the language.
     $native = $this->randomName(16);
     // The domain prefix.
-    $prefix = strtolower(str_replace('si-', '', $langcode));
+    $prefix = $langcode;
     $edit = array(
       'langcode' => $langcode,
       'name' => $name,
@@ -1299,13 +1288,13 @@ class LocaleContentFunctionalTest extend
 
     // Add disabled custom language.
     // Code for the language.
-    $langcode_disabled = $this->randomName(6, 'si-');
+    $langcode_disabled = 'xx-yy';
     // The English name for the language.
     $name_disabled = $this->randomName(16);
     // The native name for the language.
     $native_disabled = $this->randomName(16);
     // The domain prefix.
-    $prefix_disabled = strtolower(str_replace('si-', '', $langcode_disabled));
+    $prefix_disabled = $langcode_disabled;
     $edit = array(
       'langcode' => $langcode_disabled,
       'name' => $name_disabled,
Index: modules/locale/tests/translations/test.xx.po
===================================================================
RCS file: modules/locale/tests/translations/test.xx.po
diff -N modules/locale/tests/translations/test.xx.po
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/locale/tests/translations/test.xx.po	24 Feb 2009 00:21:35 -0000
@@ -0,0 +1,28 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 7\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\\n"
+
+msgid "Monday"
+msgstr "lundi"
+
+msgid "Tuesday"
+msgstr "mardi"
+
+msgid "Wednesday"
+msgstr "mercredi"
+
+msgid "Thursday"
+msgstr "jeudi"
+
+msgid "Friday"
+msgstr "vendredi"
+
+msgid "Saturday"
+msgstr "samedi"
+
+msgid "Sunday"
+msgstr "dimanche"
