[cups.development] Templates and translations

Mike Sweet msweet at apple.com
Sun May 22 06:40:20 PDT 2011


The primary reason we don't translate using a normal message catalog is that things like layout need more than just translation of strings. For example, the jobs list needs to read right to left for some languages which would require localization of that HTML or some extensive changes to the HTML templating code to handle layout direction and other localization issues.

Also, by localizing HTML fragments in files a local site can more easily customize the web interface without code changes.

All in all I think the current system has served us well and we haven't seen a disproportionate number of errors compared to the po files. In fact, I see more errors in the po files, thus the "checkpo" program. (it would be nice to also have a checktmpl program, although I'm not sure how much work that would be...)

Sent from my iPad

On May 22, 2011, at 3:42 AM, Carles Pina <carles at pina.cat> wrote:

> 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
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev





More information about the cups mailing list