Changes between Version 13 and Version 14 of Event/2012/GSoC/Translation

05/17/12 22:31:54 (12 years ago)



  • Event/2012/GSoC/Translation

    v13 v14  
    1010=== Project Plan ===
     12Below is the detailed project plan for the Upgrade Translation Functionality project :-
     14Project Deliverables :- The idea of the project is to automate the entire process of selective translation by providing a tool that helps the translators to translate only the relevant strings in the code when it is deployed. Also, when the code is changed, some strings may no longer be required for translation and some new strings might be added, this tool accounts for such changes for consistent translation. A GUI will be developed to present the translation status for each active module. Addition of comments to the T(...) function must also be facilitated. Finally, the tool will ensure that the translations made by the translators is integrated back into the main code of Eden.
     161) 1) Retrieval and storage of all strings :- Initially, a python script would be run to collect all the strings in the Eden system. 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). Let us refer to this file as all_strings.txt. Note that the same string appearing in two different files will be placed in two different rows. Also, the strings will be stored sorted first on their location and then on the original string value.
     17Currently, we are focusing on the python parse tree generated by using the python parser library to get the strings from the ".py" files.
     202) Building a spreadsheet for translators :- A python function will be run to check the currently active modules. 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. For further enhancement, the modules can be checked using the deployment settings in Then the strings in the all_strings.txt will be matched for these modules using binary search (as the strings are sorted by location) and those strings whose flag is not set will be selected. Note that all strings belonging to the core code (i.e the part of code that is always used) will be considered by default. Also, duplicate strings would be removed before being passed to the translator. This spreadsheet would then be available to translators for translating (along with location and comments for each string, if any).
     223) Converting back the spreadsheet :- Once the translations are made, all translated strings will be added back to the corresponding *.py and their flag will be set in the all_strings.txt . Also, in this step we validate the translations and original strings by checking that %s variable substitutions are labelled correctly.
     244) Updating strings due to modification of code :- There might be several changes made to the code from time to time and so we need to update the all_strings.txt accordingly. The frequency of update can be set manually. We need to consider two cases - when new strings are added and when some existing strings are deleted. Hence while updating we run step 1) as mentioned above. Then use the required *.py file and for each string in *.py we check for all its occurences in all_strings.txt. If none are found, then we remove the corresponding entry for *.py otherwise we set the flag corresponding to those strings(to indicate these are already translated). The above procedure ensures that those strings already translated earlier, are not selected again for translation. Hence, this completes the updation of strings and takes care of any modification of code.
     265) Allow comments : We want to have comments as an optional parameter to the T(...) function such that it becomes T(<string> , <comments>). Hence we could create a new T(...) function and over-ride the inbuilt web2py T(...) function. This new T(...) function would contain most of the code from the inbuilt function except that it would allow to pass comments as parameter.
     286) GUI for tracking status: The status of translations for each module must be available on a UI. This can be done by periodically reading the spreadsheet and checking for the percentage of untranslated strings.
    1231=== Project Goals and Timeline ===
    1433||= Due Date =||= SMART goal =||= Measure =||
    1534||||||'''First trimester (24 April - 20 May)'''||
    16 || 17 May ||  || ||
     35|| 17 May ||Work on retreival of all the relevant strings inside T(...) from the ".py" files and store the result in a file with complete location(file name and line number information).  || The required strings are correctly recieved when tested on eden python files ||
    1736||||||'''Second trimester (21 May - 9 July)'''||
    18 || 28 May ||  ||  ||
    19 || 4 June ||  ||  ||
     37|| 28 May || Identify the categorization of modules in Eden by studying the file structure and dependencies  || Retreived strings can be appropriately assigned module(s).  ||
     38|| 4 June || Group the retrieved strings by modules and select the strings in those modules which are currently active || The relevant strings are selected and displayed  ||
    2039|| 11 June ||  ||  ||
    2140|| 22 June ||  ||  ||