diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php
index 7ff1799..8054ca1 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php
@@ -170,34 +170,64 @@ class LocalePluralFormatTest extends WebTestBase {
     $this->assertText('Singular form');
     $this->assertText('First plural form');
     $this->assertText('2. plural form');
-    // Plural values for both languages.
+    $this->assertNoText('3. plural form');
+
+    // Plural values for langcode hr.
     $this->assertText('@count sat');
     $this->assertText('@count sata');
     $this->assertText('@count sati');
-    $this->assertNoText('3. plural form');
 
-    // Edit some translations and see if that took effect.
+    // Edit langcode hr translations and see if that took effect.
     $edit = array(
       'strings[10][translations][1]' => '@count sata edited',
     );
     $this->drupalPost($path, $edit, t('Save translations'));
 
+    $search = array(
+      'langcode' => 'fr',
+    );
+    $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
+    // Plural values for the langcode fr.
+    $this->assertText('1 heure');
+    $this->assertText('@count heures');
+    $this->assertNoText('2. plural form');
+
+    // Edit langcode fr translations and see if that took effect.
+    $edit = array(
+      'strings[10][translations][0]' => '1 heure edited',
+    );
+    $this->drupalPost($path, $edit, t('Save translations'));
+
     // Inject a plural source string to the database. We need to use a specific
     // langcode here because the language will be English by default and will
     // not save our source string for performance optimization if we do not ask
     // specifically for a language.
     format_plural(1, '1 day', '@count days', array(), array('langcode' => 'fr'));
-    // Look up editing page for this plural string and check fields.
     $lid = db_query("SELECT lid FROM {locales_source} WHERE source = :source AND context = ''", array(':source' => "1 day" . LOCALE_PLURAL_DELIMITER . "@count days"))->fetchField();
-    $path = 'admin/config/regional/translate/edit/' . $lid;
+    // Look up editing page for this plural string and check fields.
+    $search = array(
+      'string' => '1 day',
+      'langcode' => 'fr',
+    );
+    $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
+
+    // Save complete translations for the string in langcode fr.
+    $edit = array(
+      "strings[$lid][translations][0]" => '1 jour',
+      "strings[$lid][translations][1]" => '@count jours',
+    );
+    $this->drupalPost($path, $edit, t('Save translations'));
 
-    // Save complete translations for the string in both languages.
+    // Save complete translations for the string in langcode hr.
+    $search = array(
+      'string' => '1 day',
+      'langcode' => 'hr',
+    );
+    $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
     $edit = array(
-      'translations[fr][0]' => '1 jour',
-      'translations[fr][1]' => '@count jours',
-      'translations[hr][0]' => '@count dan',
-      'translations[hr][1]' => '@count dana',
-      'translations[hr][2]' => '@count dana',
+      "strings[$lid][translations][0]" => '@count dan',
+      "strings[$lid][translations][1]" => '@count dana',
+      "strings[$lid][translations][2]" => '@count dana',
     );
     $this->drupalPost($path, $edit, t('Save translations'));
 
@@ -218,7 +248,6 @@ class LocalePluralFormatTest extends WebTestBase {
     $this->assertRaw("msgid \"1 day\"\nmsgid_plural \"@count days\"\nmsgstr[0] \"@count dan\"\nmsgstr[1] \"@count dana\"\nmsgstr[2] \"@count dana\"", t('Added Croatian plural translations exported properly.'));
   }
 
-
   /**
    * Imports a standalone .po file in a given language.
    *
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php
index 49f4fdf..4cd1f7b 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php
@@ -97,7 +97,7 @@ class LocaleTranslationTest extends WebTestBase {
       "translations[$langcode][0]" => $translation,
       'translations[en][0]' => $translation_to_en,
     );
-    $this->drupalPost(NULL, $edit, t('Save translations'));
+    $this->drupalPost('admin/config/regional/translate/translate', $edit, t('Save translations'));
     $this->assertText(t('The string has been saved.'), t('The string has been saved.'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
     $this->drupalGet($string_edit_url);
@@ -180,16 +180,29 @@ class LocaleTranslationTest extends WebTestBase {
     drupal_static_reset('language_list');
 
     // Build the JavaScript translation file.
-    $this->drupalGet('admin/config/regional/translate/translate');
 
-    // Retrieve the id of the first string available in the {locales_source}
-    // table and translate it.
-    $query = db_select('locales_source', 'l');
-    $query->addExpression('min(l.lid)', 'lid');
-    $result = $query->condition('l.location', '%.js%', 'LIKE')->execute();
-    $url = 'admin/config/regional/translate/edit/' . $result->fetchObject()->lid;
-    $edit = array('translations['. $langcode .'][0]' => $this->randomName());
-    $this->drupalPost($url, $edit, t('Save translations'));
+    // Retrieve the source string of the first string available in the
+    // {locales_source} table and translate it.
+    $source = db_select('locales_source', 'l')
+      ->fields('l', array('source'))
+      ->condition('l.location', '%.js%', 'LIKE')
+      ->range(0, 1)
+      ->execute()
+      ->fetchField();
+
+    $search = array(
+      'string' => $source,
+      'langcode' => $langcode,
+      'translation' => 'all',
+    );
+    $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
+
+    $textarea = current($this->xpath('//textarea'));
+    $lid = (string) $textarea[0]['name'];
+    $edit = array(
+      $lid => $this->randomName(),
+    );
+    $this->drupalPost('admin/config/regional/translate/translate', $edit, t('Save translations'));
 
     // Trigger JavaScript translation parsing and building.
     _locale_rebuild_js($langcode);
@@ -249,14 +262,14 @@ class LocaleTranslationTest extends WebTestBase {
     );
     $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
     // Find the edit path.
-    $content = $this->drupalGetContent();
-    $this->assertTrue(preg_match('@(admin/config/regional/translate/edit/[0-9]+)@', $content, $matches), t('Found the edit path.'));
-    $path = $matches[0];
+
+    $textarea = current($this->xpath('//textarea'));
+    $lid = (string) $textarea[0]['name'];
     foreach ($bad_translations as $key => $translation) {
       $edit = array(
-        "translations[$langcode][0]" => $translation,
+        $lid => $translation,
       );
-      $this->drupalPost($path, $edit, t('Save translations'));
+      $this->drupalPost(NULL, $edit, t('Save translations'));
       // Check for a form error on the textarea.
       $form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class');
       $this->assertNotIdentical(FALSE, strpos($form_class[0], 'error'), t('The string was rejected as unsafe.'));
@@ -294,6 +307,15 @@ class LocaleTranslationTest extends WebTestBase {
       'direction' => '0',
     );
     $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
+
+    $edit = array(
+      'predefined_langcode' => 'custom',
+      'langcode' => 'yy',
+      'name' => $this->randomName(16),
+      'direction' => '0',
+    );
+    $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
+
     // Add string.
     t($name, array(), array('langcode' => $langcode));
     // Reset locale cache.
@@ -335,15 +357,13 @@ class LocaleTranslationTest extends WebTestBase {
 
     // Add translation.
     // Assume this is the only result, given the random name.
-    $this->clickLink(t('edit'));
     // We save the lid from the path.
-    $matches = array();
-    preg_match('!admin/config/regional/translate/edit/(\d)+!', $this->getUrl(), $matches);
-    $lid = $matches[1];
+    $textarea = current($this->xpath('//textarea'));
+    $lid = (string) $textarea[0]['name'];
     $edit = array(
-      "translations[$langcode][0]" => $translation,
+      $lid => $translation,
     );
-    $this->drupalPost(NULL, $edit, t('Save translations'));
+    $this->drupalPost('admin/config/regional/translate/translate', $edit, t('Save translations'));
 
     // Ensure translated string does appear if searching on 'only
     // translated strings'.
@@ -387,7 +407,7 @@ class LocaleTranslationTest extends WebTestBase {
     // Ensure translated string doesn't appear if searching in System (English).
     $search = array(
       'string' => $translation,
-      'langcode' => LANGUAGE_SYSTEM,
+      'langcode' => 'yy',
       'translation' => 'all',
     );
     $this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc
index 082a2b4..9953d9b 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -168,8 +168,7 @@ function locale_translate_filter_form() {
       );
     }
     else {
-
-      $empty_option = isset( $filter['options'][$filter['default']]) ? $filter['options'][$filter['default']] : array();
+      $empty_option = isset($filter['options'][$filter['default']]) ? $filter['options'][$filter['default']] : array();
       $form['filters']['status'][$key] = array(
         '#title' => $filter['title'],
         '#type' => 'select',
