Summary: | Line breaks are not imported / exported correctly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Technology] Babel | Reporter: | Masahiro Arai <masahiro.arai> | ||||||
Component: | Server | Assignee: | Babel Bugzilla inbox <babel.core-inbox> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P1 | CC: | kitlo, mori-m | ||||||
Version: | unspecified | Keywords: | contributed | ||||||
Target Milestone: | GANYMEDE | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Masahiro Arai
2008-04-16 11:57:40 EDT
I checked the database, the translation was saved properly in German (and all other languages). This is how the German translation looks like: {0} speichert Ihre Projekte in einem Ordner, der als Arbeitsbereich bezeichnet wird.\n\ Wählen Sie einen Arbeitsbereichsordner aus, der für diese Sitzung verwendet werden soll. The problem happens when we generate the language packs. json_encode($strings_row['trans']) was called. /* * Iterate over every character in the string, * escaping with a slash or encoding to UTF-8 where necessary */ for ($c = 0; $c < $strlen_var; ++$c) { $ord_var_c = ord($var{$c}); switch (true) { ... case $ord_var_c == 0x22: case $ord_var_c == 0x2F: case $ord_var_c == 0x5C: // double quote, slash, slosh $ascii .= '\\'.$var{$c}; break; ... json_encode() escaped the back-slashes in "\n\" and produced "\\n\\". Not sure if we should modify the json_encode() code not to escaped the back-slashes. Just saw that we are stripping the quotes around strings returned by json_encode(). Maybe we shoudl strip the extra back-slashes at the same time. # json_encode returns the string with quotes fore and aft. Need to strip them. $tr_string = preg_replace('/^"(.*)"$/', '${1}', json_encode($strings_row['trans'])); Created attachment 99900 [details]
patch for 227366
In accordance with the comment of Kit-san, we tried to make a patch for classes/export/generate1.php. However due to the complexity of making test environment, we have not enough tested it yet. Please check and test it.
Thanks for the patch. I have applied and committed it, and I ran a test update site. http://build.eclipse.org/technology/babel/test-updates/ Please confirm that the patch works as expected. Thank you for your cooperation. We checked the behavior of the tool and the result of .properties file. It worked as expected. We think this is related to bug 222660. Can you start launch a fresh copy of Eclipse and install the language pack from this update site, and see if the problem is solved: For Eclipse 3.4 : http://build.eclipse.org/technology/babel/test-updates/ganymede/ Thanks Closing as fixed -- I'm pretty confident this was a dupe of 222660. |