Mi blog lah! Το ιστολόγιό μου

8Apr/0912

Towards a GNOME CLI translation management tool

Update 7/June/2009: The repository was moved to https://github.com/simos/gnome-i18n-manage-vcs/. There was some confusion between this script and intltools, which now is a general localisation tool, not tied to GNOME.

In Designing a command-line translation tool for GNOME, I described how a CLI translation management tool would be used to ease the work of a translator with commit access. The discussion was continued with Leonardo‘s post Parsing damned-lies’ releases.xml.in in the command line.

The stage we are now is that we have a tool (not official GNOME tool, but rather at beta testing phase!) that can manage the repositories for us, so that the checking out and committing can be fairly automated. The source is available at https://github.com/simos/gnome-i18n-manage-vcs/.

We show two working examples.

Let’s say we want to update the documentation for gcalctool. We run

$ ./intltool-manage-vcs --language el --release gnome-2-26 \
--username simos --module gcalctool --transtype doc --init
Release  : gnome-2-26
Language : el
    Category: admin-tools
    Category: dev-tools
    Category: dev-platform
    Category: desktop
        Module:              gcalctool, Branch: gnome-2-26

Download completed successfully.
$ _

In the PO/ subdirectory there is a PO file for gcalctool. We update it using our favourite translation tool, and then

$ ./intltool-manage-vcs --language Greek --commit
Sending        el/el.po
Transmitting file data .
Committed revision 2475.
$ _

Let’s see another example. We want to update the gnome-games documentation. These are several individual PO files, for each of the games.

$ ./intltool-manage-vcs --language el --release gnome-2-26 \
--username simos --module gnome-games --transtype doc --init
Release  : gnome-2-26
Language : el
    Category: admin-tools
    Category: dev-tools
    Category: dev-platform
    Category: desktop
        Module:            gnome-games, Branch: gnome-2-26

Download completed successfully.
$ _

There are several files,

$ ls PO
aisleriot.gnome-2-26.el.po  gnibbles.gnome-2-26.el.po
gnotravex.gnome-2-26.el.po  README
blackjack.gnome-2-26.el.po  gnobots2.gnome-2-26.el.po
gnotski.gnome-2-26.el.po    same-gnome.gnome-2-26.el.po
glchess.gnome-2-26.el.po    gnome-sudoku.gnome-2-26.el.po
gtali.gnome-2-26.el.po      START
glines.gnome-2-26.el.po     gnometris.gnome-2-26.el.po
iagno.gnome-2-26.el.po      gnect.gnome-2-26.el.po
gnomine.gnome-2-26.el.po    mahjongg.gnome-2-26.el.po
$ _

We enter the PO/ subdirectory and we update those files we wish. We can also run scripts on the PO files. For example, all these documentation files contain the same fragment of the FDL license, so we can translate the license once, and then merge automatically to all translations.

Finally,

$ ./intltool-manage-vcs --language Greek --commit
Sending        el/el.po
Transmitting file data .
Committed revision 9014.
Sending        el/el.po
Transmitting file data .
Committed revision 9015.
Sending        el/el.po
Transmitting file data .
Committed revision 9016.
$ _

In the above example, we updated the documentation of three of the games.

Here are tips when using this tool

  • There is a –dry-run option that is useful when experimenting or trying for the first time.
  • You can filter which group of a release to download, based on category. Existing categories are desktop, admin-tools, dev-tools, dev-platform. Also, on translation type, either documentation or UI (if you do not specify, we get both). On module, by providing the module name.

And the current limitations

  • We currently only support SVN. This will change once the repositories move to git.gnome.org, in about two weeks time.
  • You need to have at least an initial translation (currently, the script does not svn add files). To be fixed once we move to git.
  • We do not currently update ChangeLog files. That’s why gnome-games is so cool for these experiments. Due to the git move, we would not need to mess with ChangeLog files.
  • We are dependent on the http://l10n.gnome.org/languages/el/gnome-2-26/xml URLs (replace el with your language). These URLs expose the release modules information in a nice XML file. Previously, the information used to exist in an XML file in the repository of damned-lies. Now, the information lies in the mysql database of damned-lies+vertimus, and is exposed through the above type of URL.
  • Due to the previous point, we commit to branch or trunk, depending on what is available in the latest release (gnome-2-26). That means, my translation fixes in gnome-games have not made it to trunk (HEAD). This is something that can be fixed with a workaround. It would be actually cool to use this tool to commit to both gnome-2-xx and master at the same time.
  • We currently do not deal with figures.

Considering that damned-lies+vertimus will be having commit functionality soon, I think that having more than one option for easy commiting translations is good.

12Aug/04Off

Τι καιρό κάνει;

Το gweather, το πρόγραμμα εμφάνισης καιρικών συνθηκών στο GNOME έχει ανανεωθεί και επιτρέπει την μετάφραση των ονομάτων των πόλεων (κάθε αεροδρόμιο στον κόσμο πρέπει να διαθέτει στο κοινό πληροφορίες για τις καιρικές συνθήκες που επικρατούν. το gweather λαμβάνει αυτές τις δημόσιες πληροφορίες). Δείτε εδώ για το BUG 89746.

Για την Ελλάδα έχουμε την παρακάτω λίστα. Όποιος είναι διαθέσιμος, παρακαλώ να μεταφράσει. Ίσως χρειαστεί λίγη έρευνα για το που είναι μερικά αεροδρόμια (LGXX, LGPR;;;). Η λίστα αποτελείται από το επίσημο όνομα του αεροδρομίου κατά ICAO και την κωδική της ονομασία τεσσάρων γραμμάτων.

Name ICAO ID

AGRINION (MIL)	LGAG
ALEXANDROUPOLIS/DIMOKRITOS	LGAL
ANDRAVIDA (MIL)	LGAD
ARAXOS (MIL)	LGRX
ASTYPALAIA	LGPL
ATHINAI (ACC,FIC,FIR,UIR)	LGGG
ATHINAI/ELEFTHERIOS VENIZELOS	LGAV
ATHINAI/HELLINIKON	LGAT
CHANIA/LOANNIS DASKALOGIANNIS	LGSA
CHIOS	LGHI
DEKELIA/TATOI (MIL)	LGTT
ELEFSIS (MIL)	LGEL
IKARIA	LGIK
IOANNINA	LGIO
IRAKLION/NIKOS KAZANTZAKIS	LGIR
KALAMATA (MIL)	LGKL
KARPATHOS	LGKP
KASOS	LGKS
KASTELI(MIL)	LGTL
KASTELORIZO	LGKJ
KASTORIA/ARISTOTELIS	LGKA
KAVALA MEGAS ALEXANDROS	LGKV
KEFALLINIA	LGKF
KERKIRA/IOANNIS KAPODISTRIAS	LGKR
KITHIRA	LGKC
KOS/IPPOKRATIS	LGKO
KOZANI/FILIPPOS	LGKZ
LARISA (MIL)	LGLR
LEROS	LGLE
LGPR "S"	LGPR
LGXX "M"	LGXX
LIMNOS	LGLM
MAKEDONIA (ACC,FIC)	LGMD
MARATHON	LGMR
MARATHON/KOTRONI (MIL)	LGKN
MEGARA (MIL)	LGMG
MIKONOS	LGMK
MILOS	LGML
MITILINI/ODYSSEAS ELITIS	LGMT
NAXOS	LGNX
NEA ANCHIALOS (MIL)	LGBL
PAROS	LGPA
PORTO CHELI	LGHL
PREVEZA/AKTION (MIL)	LGPZ
RODOS/DIAGORAS	LGRP
RODOS/MARITSA	LGRD
SAMOS	LGSM
SANTORINI	LGSR
SITIA	LGST
SKIATHOS	LGSK
SKIROS (MIL)	LGSY
SPARTI	LGSP
SYROS	LGSO
TANAGRA (MIL)	LGTG
THESSALONIKI/MAKEDONIA	LGTS
TRIPOLIS (MIL)	LGTP
ZAKINTHOS/DIONISIOS SOLOMOS	LGZA

Ο αρχικός συγγραφέας του gweather είναι ο Σπύρος Παπαδημητρίου.

   

Switch to our mobile site