Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Automated Manipulation of Strings 2.0: Difference between revisions

From MoodleDocs
m (New page: {{Infobox Project |name = Automated manipulation of strings |state = Coding |tracker = TODO |discussion = TODO |assignee = David Mudrak }} {{Moodle 2.0}} AMOS stands...)
 
mNo edit summary
Line 1: Line 1:
{{Infobox Project
{{Infobox Project
|name = Automated manipulation of strings
|name = Automated manipulation of strings
|state = Coding
|state = Proposal
|tracker = TODO
|tracker = MDL-18797
|discussion = TODO
|discussion = TODO
|assignee = [[User:David Mudrak|David Mudrak]]
|assignee = [[User:David Mudrak|David Mudrak]]
Line 8: Line 8:
{{Moodle 2.0}}
{{Moodle 2.0}}


AMOS stands for Automated Manipulation of Strings. The name was chosen in honour of [http://en.wikipedia.org/wiki/John_Amos_Comenius John Amos Comenius], the author of ''Janua linguarum reserata'' (Gate to Languages Unlocked), who may be considered the father of modern education. AMOS is a central repository of Moodle strings and their history. It handles common translation tasks, gathers translations and generates language packages to be deployed on Moodle servers.
'''AMOS stands for Automated Manipulation of Strings. AMOS is a central repository of Moodle strings and their history. It tracks the addition of English strings into Moodle code, gathers translations, handles common translation tasks and generates language packages to be deployed on Moodle servers.'''
 
The name was chosen in honour of [http://en.wikipedia.org/wiki/John_Amos_Comenius John Amos Comenius], the author of ''Janua linguarum reserata'' (Gate to Languages Unlocked), who may be considered the father of modern education.
 
== Overall picture ==
 
[[Image:lang20amosflow.png]]
 
# Developers add new string by adding them into appropriate English $strings array definition file (eg /mod/workshop/lang/en/workshop.php). This file is committed into Moodle main CVS repository as a part of the code.
# CVS repository is mirrored automatically on the fly in a git repository. This git repository is used for further processing because parsing the strings file and tracking their history is much simpler in this system. The whole history is present in the git clone so there is no need to ask CVS server for anything once it is fetched.
# Git repository is regularly checked for any changes in string definition files. Once a modification is detected, the file is parsed and any addition, modification or removal of a string is recorded in an English strings database, together with a meta-information about the author of the change, timestamp, branch, commit identification (git commit hash) etc.
# Translators use the strings definition stored in the English strings database as a reference for their translation. Therefore the information about the origin (the branch and the revision) of the translated English string can be stored as meta-info together with the translation. Every translated string is linked with a certain revision of the English source so we can easily find strings there were modified in English to be re-checked etc.
# So called translation stage (or cache) is used during the translation. This is similar to the session cache when working with [[XMLDB]]. Once the translator is happy with the work, she/he commits (submits) the translation into the database of the translated strings.
# Non-English strings database contains the history of the translation of all Moodle strings in all supported languages. This database is used as a source to generate the up-to-date language package in various formats (ZIP to be deployed at the servers, XML to be used by an external translation tools etc).
# Moodle site administrators update their installed language packs by downloading the ZIP files generated from the database (or, in the future, they can fetch the pack in other format)

Revision as of 10:41, 8 February 2010

Automated manipulation of strings
Project state Proposal
Tracker issue MDL-18797
Discussion TODO
Assignee David Mudrak

Moodle 2.0


AMOS stands for Automated Manipulation of Strings. AMOS is a central repository of Moodle strings and their history. It tracks the addition of English strings into Moodle code, gathers translations, handles common translation tasks and generates language packages to be deployed on Moodle servers.

The name was chosen in honour of John Amos Comenius, the author of Janua linguarum reserata (Gate to Languages Unlocked), who may be considered the father of modern education.

Overall picture

lang20amosflow.png

  1. Developers add new string by adding them into appropriate English $strings array definition file (eg /mod/workshop/lang/en/workshop.php). This file is committed into Moodle main CVS repository as a part of the code.
  2. CVS repository is mirrored automatically on the fly in a git repository. This git repository is used for further processing because parsing the strings file and tracking their history is much simpler in this system. The whole history is present in the git clone so there is no need to ask CVS server for anything once it is fetched.
  3. Git repository is regularly checked for any changes in string definition files. Once a modification is detected, the file is parsed and any addition, modification or removal of a string is recorded in an English strings database, together with a meta-information about the author of the change, timestamp, branch, commit identification (git commit hash) etc.
  4. Translators use the strings definition stored in the English strings database as a reference for their translation. Therefore the information about the origin (the branch and the revision) of the translated English string can be stored as meta-info together with the translation. Every translated string is linked with a certain revision of the English source so we can easily find strings there were modified in English to be re-checked etc.
  5. So called translation stage (or cache) is used during the translation. This is similar to the session cache when working with XMLDB. Once the translator is happy with the work, she/he commits (submits) the translation into the database of the translated strings.
  6. Non-English strings database contains the history of the translation of all Moodle strings in all supported languages. This database is used as a source to generate the up-to-date language package in various formats (ZIP to be deployed at the servers, XML to be used by an external translation tools etc).
  7. Moodle site administrators update their installed language packs by downloading the ZIP files generated from the database (or, in the future, they can fetch the pack in other format)