Skip to content

manabuishii/galaxy-translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

galaxy-translation

Tool for Galaxy tool's xml translation

Theoricaly & Praticaly

To translate XML tool in other languages this tool begins by creating a ".pot" file with the original ".xml" file. A ".pot" (for ".po" template) is a text file with commented information in the beginning and numerous paired lines:

  • first a misguided line who contains the original text
  • second a msgstr line who is empty

After translation (automatically or manually) a ".po" file need to be created with a full ".pot". This ".po" is converted to a binary dictionary ".mo" file with the following line:

msgcat file.po | msgfmt -o file.mo -

This is _init_.py (from galaxy/lib/galaxy/tools/) who use ".mo" file to translate ".xml".

CAUTION ".mo" must be name like that :

 [...]/tool_dir/language/LC_MESSAGES/default.mo

Where language is language set in LANGUAGE environment variable of Galaxy (e.g. ja for Japan, fr for French, etc).

The upload.py file come from galaxy/lib/galaxy/webapps/tool_shed/controllers/ and create ".pot" when user upload ".xml" in the tool_shed (in the same directory).

Require

pip install lxml

FAQ

What is a "pot", "po" and "mo" ?

What is a "msgid" and "msgstr" ?

Dynamically change the language ?

No.

Cureently we can not change the language dynamically.

We want to that , in the future we support it.

What happens if a tag is empty on a po file?

If msgstr is empty, it is used msgid.

msgid "Input text files(s)"
msgstr ""

In this case, "Input text files(s)" is displayed.

Releases

No releases published

Packages

No packages published

Languages