Changes between Version 44 and Version 45 of Event/2012/GSoC/Translation
- Timestamp:
- 07/21/12 06:36:15 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Event/2012/GSoC/Translation
v44 v45 31 31 1)''' Retrieval and storage of all strings based on modules''' :- Initially, a python script would be run to collect all the strings in the Eden system based on the input module. This collection of strings will be stored in a separate file (different from the languages files) such that each row would contain the original (untranslated) string, its location(pathname/line number), comments and a flag to indicate if it has been translated or not (initially all flags will be unset). Note that the same string appearing in two different files will be placed in two different rows. 32 32 Currently, we are focusing on the python parse tree generated by using the python parser library to get the strings from the ".py" files. Also file dependencies and structure are studied to discover which strings are grouped under the given module. The active modules will be passed as parameters to the function and later on it can be taken as input from the developer using GUI checkboxes. Also settings such as "deployment.setting.variable_name" (inside T(...) ) will be extracted as it is initially and later their value will be retreived. (The strings inside both T(...) and M(...) will be retrieved. ) 33 For HTML and few JS files, we are using regular expressions to extract the strings inside T(). 33 34 34 35 2) '''Building a spreadsheet for translators''' :- The strings retreived from the previous step will be converted to .csv format. This spreadsheet would then be available to translators for translating (along with location and comments for each string, if any). For this, first the translate-toolkit will be used to study the required format of .csv file and then using the xlwt library of python, the spreadsheet will be created. The current web2py language file will be checked for existing translations. If any string is already translated, its translation will be fetched into the spreadsheet so that the translator need not translate it again. This also gives the translator an option to overwrite the existing translation with something more appropriate.