Community
Participate
Working Groups
Created attachment 96275 [details] Screen shot of the UI which has this issue Build ID: N/A Steps To Reproduce: 1. Download German language pack from babel update site 2. Start Eclipse on German locale --> You'll see that line breack is not correctly used More information: This may related with bug 227363. Also, root cause might be how those strings are imported into database Followings are related entries from English / German property file English one: ChooseWorkspaceDialog_dialogMessage= \ {0} stores your projects in a folder called a workspace.\n\ Choose a workspace folder to use for this session. German one (no line break & incorrect line break \\n\\\n): ChooseWorkspaceDialog_dialogMessage={0} speichert Ihre Projekte in einem Ordner, der als Arbeitsbereich bezeichnet wird.\\n\\\nW\u00e4hlen Sie einen Arbeitsbereichsordner aus, der f\u00fcr diese Sitzung verwendet werden soll.
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.