|Version 3 (modified by 10 years ago) ( diff ),|
Blueprint for an Upgrade to the Translation Functionality
Sahana Eden uses the translation features of web2py. For the application programmer this requires the use of the function T() when displaying strings which will be displayed on the screen and so will need to be translated. The core web2py translation functionality extracts the strings and stores them in a *.py file, unfortunately this file only has space for the original and the translated string. For the translator it is often helpful to have a comment that can explain the context of a particular phrase. For other features to be introduced as part of this work it would also be necessary to know the origin of the string, this would be the file and possibly also the line number. (Note the sting may have more than one origin, i.e. it appears in the code in more than one place).
Changes to the core translation functionality
The standard web2py function should be extended to support an optional comment, ideally this would be done with the call to T() but a alternative separated solution may be acceptable.
When an instance of Sahana-Eden is deployed it may require translation, if this is during an emergency their may not be a lot of time and so only a select subset of strings need to be translated. This subset might be the front facing part of the deployment or it may include just the modules that have been deployed. However, when the files for translation are created their is no link back to the code and so it is difficult to know where the string came from. What is required is for the function to extract the location of the string this can then be used to determine which module the string belongs to. This functionality may have several iterations but with the final goal of being able to download strings for translation that belong to various modules, this might involve a UI that allows the translation administrator to select which modules (or parts) of the system they want to translate.
Round-trip translation UI
For the translation code see web2py gluon/langauges.py file