Student projects/Language editing interface
Note: This page outlines ideas for the Web 2.0 language editing interface. It's a specification under construction! If you have any comments or suggestions, please add them to the page comments.
Moodle is designed to be translated into many languages, and currently has over 70 language packs.
The existing language editing interface enables translators to check for untranslated words or phrases and also enables Moodle administrators to change words or phrases used in Moodle. However, it could really benefit from some improvements.
A brief overview of current implementation is given below:
- Moodle Language editing features allow you to edit different word, phrases in the Moodle interface and text in Help Documentation.
- A language pack is a php file with a dictionary of variables containing representation of some string in another language. - Different strings can be accessed by calling function: get_string(string_to_find). - The English language pack is stored in /root/moodle/lang/ folder. - Language packs for other languages are stored in /moodledata/lang/xx_encoding/ for any language other than English. - When the files are edited from the website, variables in the base file are overlaid by variables in a new custom directory say /home/moodledata/lang/xx_encoding_local/ - All these strings are stored in a variable called $strings. - When the function get_string(...) is called with some string as an argument, the function checks for the argument as key in the variable $strings. If a value is found, the value is returned otherwise false is returned.
- Project title: Web 2.0 language editing interface
- Student: Avi Mehta
- Mentors: David Mudrak, Petr Skoda (Skodak), Koen Roggemans
Improvements Suggested (Overview)
- Improve the User Interface(Read: Inline editing, suggested translations etc. Suggestions welcome... ).
- Detect syntax errors and common problems in translated strings
- Include a search and replace feature for changing a particular word, for example the word "Course", in every language string
- Display the differences between local and parent language packs
- Spell checker
In addition, the project may also include:
- A local modification import/export feature
- Further language pack import improvements (Please use the comments to point out what you want to be fixed!!)
- Work on other long-standing language-related issues ( Comment!! and it might be included in the project ;) )
This part lists some of the technical details.
Improve the User Interface (Inline Editing)
- Allow administrator to activate "In-place Translation" setting. The setting will allow administrator to specify users who can access the language editing feature.
- The server side modifications would include:
- Modifying the code to add certain markers to HTML so that localizable strings can be identified correctly.
Improve the User Interface (Translation Suggestions)
- Use Google Translate to automatically do a preliminary translation.
- The functionality of this extension would be:
- Whenever the "On" Button is clicked on a page, In addition to contacting the server, js code also contacts Google servers to access translation API to get a preliminary version of the strings. - The preliminary strings are not shown to user by default. This is done so that user can look at the actual English string first. When the user clicks on the string, the preliminary string is shown to the user. - When the user saves the string, the result gets reflected on the page.
Display Differences between local and parent languagepacks
- This feature can nicely be integrated within the framework proposed for feature 1 by letting the user see a "wiki like" hierarchical history of string changes.
- This feature would require minor changes in the admin\lang.php file.
- Details to be decided
Search & Replace
- Details to be decided.
Comments & Suggestions
Being a work in progress, We welcome all your suggestions, improvements and comments on anything detailed above. Please post comments on this page or in the Using Moodle Language editing interface forum discussion.
Last Modified: 05/23/2008