Designing a command-line translation tool for GNOME
March 3, 2008
One messy task with GNOME translations is the whole workflow of getting the PO files, translating/updating/fixing them, and then uploading them back. One would need to use command line, and several different commands to accomplish this.
KDE and KBabel has a nice feature that allows you to easily grab all translation files, work on them, then commit through SVN. All through the GUI! It helps a bit here that the translation files for a specific language are located under a single directory.
The current workflow in GNOME translations typically consists of
- Getting the PO file from the L10n server (for example, GNOME 2.22 Greek) (also possible to use intltool-update within po/)
- Translate using KBabel, POEdit, GTranslator, vim, emacs, etc.
- svn co the package making sure you have the correct branch. One may limit to the po/ directory.
- Put the updated file in po/
- Update the ChangeLog (either with emacs, or with that Perl script)
- Commit the translation.
- (If you committed on a branch, also commit on HEAD)
Tools such as Transifex (used currently in Fedora) take away altogether the use of command line tools, and one works here through a web-based interface. Apparently, Transifex is having a command-line tool in the TODO list.
What I would like to see in GNOME translations, is a tool that one can use to
- Grab all or a section of the PO files from GNOME 2.22. Put them in a local folder.
- Use the tools of my preference (translation tools, scripts, etc) to update those translations I need to update.
- Commit those translation files that changed (using my SVN account), automatically add ChangeLog entries, also commit to HEAD if required.
I would prefer to have a command-line tool for this, for now, though it would be great if GUI tools would get the same functionality at some point. For a command line tool, the workflow would look like
The workflow would be something like
$ ssh-add Enter passphrase for /home/simos/.ssh/id_rsa: Identity added: /home/simos/.ssh/id_dsa (/home/simos/.ssh/id_dsa)
$ tsfx --project=gnome-2.22 --language=el --collection=gnome-desktop --user=simos --action=checkout
Reading from http://svn.gnome.org/svn/damned-lies/trunk/releases.xml.in... done.
Getting alacarte (HEAD)... done.
Getting bug-buddy (branch: xyz)... done.
...
Completed in 4:11s.
$ _
Now we translate any of the files we downloaded, and we push back upstream (of course, only those files that were changed).
$ tsfx --action=commit
Found local repository, Project: gnome-2.22, Language: el, Collection: gnome-desktop, User: simos
Reading local files...
Found 6 changed files.
Uploading alacarte (HEAD)... done.
Uploading bug-buddy (branch:xyz, HEAD)... done.
...
Completed uploading translation files to gnome-2.22, language el.
$ _