This is an old revision of the document!
Whenever SOFA has lots of new strings:
Don't make your own! Just use the ones from launchpad - they always work. Use the download link and select mo as output.
Hello!
Launchpad Maintain your project's translation import queue
Whenever someone imports a new translation or template file into your project in Launchpad, that file gets reviewed to make sure it's correctly formatted.
Up until recently, the Launchpad team looked after those reviews. Now, you can review your project's translations import queue yourself.
To review your project's queue, follow the “import queue” link on your project's translations overview page.
When reviewing the queue, you're looking to make sure that the files are correctly named, that the file really is intended for your project and that templates contain only English strings. There's more in our guide here:
https://help.launchpad.net/Translations/YourProject/ImportingTemplates
Once you've manually approved a file, Launchpad will automatically approve any future updates to it.
If you need help, feel free to join us in #launchpad on FreeNode.
Thanks,
Matthew Revell and the Launchpad team.
The charset line at the top of a po file must be appropriate for the encoding.
If you don't match the file encoding to the alleged charset you get this sort of thing:
sofa_gl_ES.po:146:40: invalid multibyte sequence
msgfmt: too many errors, aborting
For Ubuntu, utf-8 will always work. In Windows, charset and encoding has to handled on a case-by-case basis. Different mo files will be required for Windows because it doesn't handle utf-8.
Thanks. Translation is pretty streamlined these days thanks to Launchpad. The place to go is https://translations.launchpad.net/sofastatistics. Near the bottom right click the link “View all languages”. If you have any questions, please do not hesitate to contact me. If you manage to translate a reasonable proportion of the English strings please let me know and I will add the <LANGUAGE NAME HERE> language pack to the installers.
Unicode strings only (with escaped backslashes when dealing with Windows paths). We must assume that international characters will be stored in databases, variable lists, value labels, project names etc etc etc. Even a path could have a user name in it like René.
As long as all references to paths are stored as unicode e.g. u“C:\\Users\\john\\sofa …” we should be all right.
User-entered paths will need to be saved as unicode with escaped backslashes.
The database interface modules such as MySQLdb return unicode (NB in the case of MySQLdb, “use_unicode” must be explicitly set to True when setting up the connection).
All strings must be wrapped with _() so that they are exposed to translations.
Use unicode() rather than str().
Must be able to cope with Microsoft-derived, non-unicode text e.g. smart quotes pasted from Word or Excel using cp1252.
When reading from any user-editable text file, must cope with (i.e. strip off the start) the BOM if present. E.g. project files, variable details files, html report files, css files. The error you might get if you don't is “encoding declaration in Unicode string”.
project.GetProjSettings populates a dictionary from a text file using exec. It reads text like u“C:\\Users\…” successfully as unicode strings.
project.OnOK writes all the variables to the project file as text. The unicode strings are all written with a u“…” so that they will be read as unicode strings.
util.clean_bom_utf8 strips the BOM off the front of text that Notepad sticks on the front. TODO handle utf-16 and utf-32 better.
Pre-reversed images so they are correct when the OS/toolkit reverses them again - wx.Image has a Mirror() method.
Shift some non-images from left to right or vice versa.
def currentLanguageIsRightToLeft(): return wx.GetApp().GetLayoutDirection() == wx.Layout_RightToLeft
window.SetLayoutDirection(wx.Layout_RightToLeft))
Possible to set for all windows in the application at once?
wxApp.SetLayoutDirection(wx.Layout_RightToLeft) ?
There is a SetLayoutDirection method for wx.DC
http://wxpython-users.1045709.n5.nabble.com/Right-to-left-language-support-td2367233.html