Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
translation.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Sep 2012 at 22:39 UTC
Updated:
4 Jan 2014 at 02:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lars toomre commentedHere is an initial untested patch for this issue. This patch includes format_string() conversions as well.
Comment #3
lars toomre commentedThis error is caused by the problem noted in #1798382: Random Test failures in Entity translation tests.
Comment #4
lars toomre commented#1: 1798376-1-t-translation.patch queued for re-testing.
Comment #5
dcam commented#1 no longer applies due to changes in TranslationTest.php.
Comment #6
lars toomre commentedHere is a locally untested re-roll of the patch from #1.
While doing the re-roll, I discovered two other uses of t() for assert messages that needed to be converted to format_string(). Hence, I made those conversions as well and am including an interdiff as well.
Comment #7
dcam commentedI've tested #6 and the patch looks good to me. I didn't find any additional t()'s around assert messages.
Comment #8
jhodgdonfixing component, and assigning to me to do final review/commit.
Comment #9
jhodgdonThanks! This is committed to 8.x and ready for backport (I assume?)
Comment #10
dcam commentedBackported #6 to D7.
Comment #11
dcam commented#10: 1798376-10-t-translation.patch queued for re-testing.
Comment #12
dcam commentedTagging as Novice.
Comment #13
jhodgdon#10: 1798376-10-t-translation.patch queued for re-testing.
Comment #14
lazysoundsystem commentedThis one also looks good. RTBC.
Comment #15
jhodgdonThanks! Committed to 7.x.
Comment #16.0
(not verified) commentedUpdated number of counts for this issue.
Comment #17
sivaji_ganesh_jojodae commentedI think this is not fully resolved yet. I still see the following lines using t(). Should i create new issue or re-open this issue?
./translation.test:46: $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), 'Basic page content type has been updated.'); ./translation.test:57: $this->assertRaw(t('Language negotiation configuration saved.'), 'URL language detection enabled.'); ./translation.test:99: $this->assertRaw(t('A translation of %title in %language already exists', array('%title' => $node_title, '%language' => $languages['es']->name)), 'Message regarding attempted duplicate translation is displayed.'); ./translation.test:118: $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_title)), 'Original node updated.'); ./translation.test:122: $this->assertRaw('' . t('outdated') . '', 'Translation marked as outdated.'); ./translation.test:129: $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_translation_title)), 'Translated node updated.'); ./translation.test:152: $this->assertRaw(t('Translations of %title', array('%title' => $node->title)), 'Translation overview page available with only one language enabled.'); ./translation.test:300: $this->assertRaw(t('The language %language has been created and can now be used. More information is available on the help screen.', array('%language' => $languages[$language_code]->name, '@locale-help' => url('admin/help/locale'))), 'Language has been created.'); ./translation.test:311: $this->assertRaw(t('Configuration saved.'), 'Language successfully enabled.'); ./translation.test:337: $this->assertRaw(t('Basic page %title has been created.', array('%title' => $title)), 'Basic page created.'); ./translation.test:373: $this->assertRaw(t('Basic page %title has been created.', array('%title' => $title)), 'Translation created.');Comment #18
jhodgdonThose t() statements are wrapping Drupal UI text, which still should be translated. This issue was about removing t() from test assertion messages, which should not be translated. For instance, in that last line, "Translation created" is the assertion message, and it is (correctly) not translated, while the assertRaw is looking for the text "Basic page (title) has been created" in the UI, so that needs to be translated.
Comment #19
sivaji_ganesh_jojodae commented@jhodgdon, makes sense now. Thanks for the clarification.