Translating HTML templates

I’d like to try and re-translate some templates from english into a few languages. They are in sourceforge cclite project under /usr/share/cclite/templates/html/en

It’s pretty standard html but there are Perl variables inserted as $$variable, for example. Previously I made an ugly parser to parse out all the phrases and used Google (later I used Azure) translate API to get the bits back.

Can libretranslate manage this kind of work? I’m prepared to change the markings on the variables for example or make some other small hack to identify the non-translatable pieces of the English language templates.

You can do this with Gemma/LTEngine, as I did the same with my project to verify that Gemma works reliably.
If your “tags” aren’t easily parsable, or tend to interfere by offering a literal meaning (eg “speaking variable names”, then just make some hashing and replace with tags that do not interfere.
See also my last post. (How to avoid/work around this LibreTranslate bug?)

1 Like

Thanks, I’ll spin one up on Digital Ocean and try my luck. That’ll probably mean a day or two before I report back.