Templates and translations

Carles Pina carles at pina.cat
Sun May 22 03:42:26 PDT 2011


Hello,

I've noticed that to translate Cups to other languages it's needed to generate a new .po file (as usually) and also it's needed to translate the .tmpl files.

The .tmpl files are a bit difficult (or uncomfortable) to translate, because it's easy to do some HTML mistakes (potentially leaving Cups unusable in some language), difficult (afaik) to re-use translations between versions, not possible to use the standard tools to mark strings as fuzzy and a long etc.

Is there any reason that Cups is not using some tags in the .tmpl files and then translating it on the fly using gettext?

Thinking for example that job-restart.tmpl could be (it's just an example):
-----
<DIV CLASS="indent">

<H2 CLASS="title">_("Reprint Job {job_id}")</H2>

<P><A HREF="{job_printer_uri}">_("Job {job_id}</A> has been restarted.")

</DIV>
-----
Then, some script could extract the strings in _("") and generate the .pot file (something similar to xgettext, since it seems that xgettext cannot do it). Using the .pot file the translators could work as usually. It could be in a different gettext domain than the existing .po files.

Of course this would need further changes in Cups code.

I'm thinking to implement it, but I wanted to ask if there is some reason that it's not done, or it's not done just because nobody has done it yet but would be interesting for Cups and potentially could be added in Cups.

Regards,

Carles Pina




More information about the cups-devel mailing list