D6-RC3 translated using the l10n_server translation interface.
All po.files are is uploaded during installation
Three strings are reported not to be translated (attached untranslated.png) despite the fact that their translation is available in the .po file (attached).

Upon investigation I have found the following:
The three string are the only strings which contain \n in the source string. To find these strings search for strings containing "\\\n" using the search tab on the Translate interface page.
When importing the po file the same string but without "\n" is listed in the translation interface (attached translated.png).

Source string in ./misc/drupal.js:
var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
which is the same as the source text in the .po file

js translation file (./sites/default/files/languages/nl_a1c4a100ca41f95b001b4f0bcda9f2f6.js:Drupal.locale) contains:
"An HTTP error @status occurred. \n@uri": "Een HTTP-fout @status is opgetreden. \r\n@uri"
which is the same as source and translation in the .po file

I can not force these errors to check if they get translated or not.

It looks like all t() translated text gets stripped of \n but these javascript strings keep their \n. Causing these to be (reported as) untranslated.

Comments

gábor hojtsy’s picture

Title: JavaScript strings containing "\n" not translated » JS strings with "\n" in them marked untranslated
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

Updated title to reflect that the strings are in fact translated, but marked as untranslated for some reason still. So this looks like a minor bug somewhere in the search code.

Since the JS translations are fine, there is evidence that the translations are in the database and are associated to the proper source strings. What about the editing pages? What if you edit the translations for one of these strings? Does it still present empty textarea(s) or the translations? Let's figure out if only the overview page is at error.

sutharsan’s picture

When I translate one of the these untranslated strings (containing \n) using the build-in interface it is listed as translated.

Takafumi’s picture

Version: 6.0-rc3 » 6.x-dev
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new766 bytes

This patch fixes this issue.
Please review it.

gábor hojtsy’s picture

Well, there are non-JS strings with \n which work, and also, \r (0x0d) and other special chars could just as well appear. A not too good but working example is the bbcode help translation: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/bbcode/po/h... (yes, this is a monster).

Sutharsan, could you please test the patch?

dpearcefl’s picture

Is this still an issue using current Drupal 6?

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.