GNOME Bugzilla – Bug 641166
Unit conversion fails when some strings are translated.
Last modified: 2011-02-17 03:05:24 UTC
There are strings marked for translation such as "meter,meters,m", "yard,yards,yd", "fathom,fathoms,ftm" etc. If these strings are translated conversion is not working for the units they correspond to. If the translated string is the same as the original, the conversion will work. Steps to reproduce: 1. Install the gettext package, If it is not already installed. This will provided the command "msgfmt". 2. Install the intltool package if it is not already installed. This will provide the command "intltool-update". 3. Select a locale that gcalctool supports. If you don't have supported locale fin your system, find out how to generate one in your distribution. $ locale -a bg_BG.utf8 C [cut] en_GB.utf8 [cut] In this report "en_GB.utf8" will be used. 4. Update the localisation strings $ cd gcalctool/po gcalctool/po$ cp en_GB.po new_en_GB.po gcalctool/po$ intltool-update new_en_GB # Without the .po suffix 5. Edit the updated new_en_GB.po file Find one or more strings of the specified type. Type something for the translation of the string that is not the same as the original. This is to simulate a translation, where the words will be different. Save the file. Example strings: "meter,meters,m" "yard,yards,yd" "fathom,fathoms,ftm" The string does not matter, as long as you test with the same unit later. 6. Prepare a compiled catalog. gcalctool/po$ msgfmt new_en_GB.po -o new_en_GB.mo If no errors were found, the program should quit without output. 7. Copy the compiled catalog where the program can find and use it. I am testing with JHBuild, so I used the JHBuild configured installation path / prefix "~/gnome-trunk/". The rest should be the same. gcalctool/po$ cp new_en_GB.mo ~/gnome-trunk/share/locale/en_GB/LC_MESSAGES/gcalctool.mo 7. Start the program with the prepared locale gcalctool/po$ LC_ALL=en_GB.utf8 jhbuild run gcalctool If you are testing without JHBuild, just add the "LC_ALL=en_GB.utf8" in front the actual command. For example: gcalctool/src$ LC_ALL=en_GB.utf8 ./gcalctool # local directory or $ LC_ALL=en_GB.utf8 gcalctool # system wide The locale alias should be taken from the output of the "locale -a" command in step 3. 8. Select Mode/Advanced 9. In the left combo box select the unit for which you changed the translation string. For example under "Length" choose "Yards" or "Meters". 10. Type a number in the input area. The conversion should fail. If you change the unit in the right combo box, the conversion will still fail. Other conversion for untranslated strings should work (step 11). 11. Working conversions In the left combo box select a unit that does not have translated string of the specified type. For example "Parsecs". In the right combo box select a unit that has no translation for the specified string type. For example "Light years". Conversion will fail when a unit with translated string of the specified type is selected in the right combo box. Without translation these conversions work. Start the program with "LC_ALL=C" in step 7. Follow the steps 7-10. If the translated strings are exactly the same as the original, conversions will work. To reproduce this behaviour, start at step 5, but copy the original string in the translated one. Follow steps 5-10. Other small issues in the same scope: - Conversion always fails from/to "Nautical miles" and "A*u*stronomical units" to any other unit. This happens with or without translation. - The "A*u*stronomical units" unit name ls misspelled.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.