[Xfce-i18n] Translatable Xfce 4.4 core packages ::

Andrey Fedoseev andrey.fedoseev at gmail.com
Sun Apr 16 19:43:04 CEST 2006


> > If so, please look at http://grove.org.ru/trac/translations/translations
> 
> Exactly what I (or we) want.

I'm not sure that my implementation could fit your needs. The main
reason is that it was developed as a plugin to Trac, so Trac (and
python, of course) is a necessary component. Xfce project now uses
Bugzilla for bugtracking and Dokuwiki for wiki. I suppose there's no
need to switch to Trac only to display translation statistics.

> I think this is the best place to discuss, one thing I'd
> like to know is, is that possible to create sub-menu
> inside Xffm like attached text (xfce-i18n-statistics-modified.txt)?

At the moment my plugin doesn't support complex hierarchy, and it's not
in my plans. But I can describe the concepts that I used:

I have two database tables: 

  1. translation_categories [ id | name ]
  2. translation_files [ id | name | path | category_id | rev | total |
translated | fuzzy | untranslated ]

It allows me to build simple two-level hierarchy. The top level contains
translation categories (e.g. xfce, xfce-goodies, etc.) and the bottom
level contains the data related to po-files.
We only make translations for one language (Russian), so multiple
languages aren't supported. Though it can be implemented by creating an
additional table:

  3. languages [ id | name ]

In that case additional column must be added to translation_files:
language_id. Having such data model you can group files by category or
by language.

In translation_files I store the name of a package (e.g. thunar) and its
location in SVN repository (e.g. xfce4/thunar/trunk/po/ru.po). When a
web page is loading for the first time, it looks for that file in SVN,
then gets its content, then tries to parse it to get the statistics. If
the parsing was successful, the revision number and the statistics of
that file are stored in appropriate columns. On the next page load, I
check if the revision of the file was changed. If the file wasn't
updated I just show the values from the database, otherwise I parse it
again. Such behavior allows to avoid parsing the file each time the page
is loaded.

As you see it's pretty easy :) Hope this will help.

-- 
Regards! Andrey Fedoseev
<andrey.fedoseev at gmail.com>




More information about the Xfce-i18n mailing list