Commit 33a56047 authored by catch's avatar catch

Issue #1623564 by droplet: Fixed Wrong text at translation UI.

parent fe0e9dd1
......@@ -167,9 +167,12 @@ function testPluralEditExport() {
$path = 'admin/config/regional/translate/edit/' . $lid;
$this->drupalGet($path);
// Labels for plural editing elements.
$this->assertText('Singular form');
$this->assertText('First plural form');
$this->assertText('2. plural form');
$this->assertFieldByXPath('//label[@for="edit-translations-hr-0"]', 'Singular form ');
$this->assertFieldByXPath('//label[@for="edit-translations-hr-1"]', 'First plural form ');
$this->assertFieldByXPath('//label[@for="edit-translations-hr-2"]', '2. plural form ');
$this->assertFieldByXPath('//label[@for="edit-translations-fr-0"]', 'Singular form ');
$this->assertFieldByXPath('//label[@for="edit-translations-fr-1"]', 'Plural form ');
// Plural values for both languages.
$this->assertFieldById('edit-translations-hr-0', '@count sat');
$this->assertFieldById('edit-translations-hr-1', '@count sata');
......
......@@ -386,7 +386,7 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
}
else {
// Dealing with plural strings.
if (isset($plural_formulas[$langcode]['plurals']) && $plural_formulas[$langcode]['plurals'] > 1) {
if (isset($plural_formulas[$langcode]['plurals']) && $plural_formulas[$langcode]['plurals'] > 2) {
// Add a textarea for each plural variant.
for ($i = 0; $i < $plural_formulas[$langcode]['plurals']; $i++) {
$form['translations'][$langcode][$i] = array(
......@@ -401,7 +401,7 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
// Fallback for unknown number of plurals.
$form['translations'][$langcode][0] = array(
'#type' => 'textarea',
'#title' => t('Sigular form'),
'#title' => t('Singular form'),
'#rows' => $rows,
'#default_value' => '',
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment