|
|
Log in / Subscribe / Register

Mozilla releases a machine-translation plugin

Mozilla releases a machine-translation plugin

Posted Jun 9, 2022 17:40 UTC (Thu) by tbelaire (subscriber, #141140)
In reply to: Mozilla releases a machine-translation plugin by nye
Parent article: Mozilla releases a machine-translation plugin

Ok, well here it is.

https://github.com/vicwomg/pikaraoke/blob/master/template...

I have it hooked up with pybabel and flask_babel, and jinja2.ext.i18n for inflating the templates. I see the context correctly when editing the translation files, but I don't think the context is used for a lookup? That would be pgettext right?

https://docs.python.org/3/library/gettext.html#gettext.pg...

Oh, I see that the jinja2 extension mentions pgettext

https://jinja.palletsprojects.com/en/3.1.x/extensions/#i1...

But I'm not sure how to wire it up to the {% trans %} blocks, and it was easier to just upstream it. I was doing this as a hobby and I'm not a pro in this area.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds