-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support internationalization / multi language templates #52
Comments
+1 |
+1 |
Haven't thought any deeper about this issue yet; I appreciate any design suggestions or ideas for supporting a good internationalization in templates. Ideas welcome! |
The most important functions are the tags "trans" and "blocktrans". |
Are there any gettext or other sort of translation libraries out there in the Go world you guys know of? I prefer using the PO file format since there are already some nice tools out there for creating/managing translations (for example Poedit). Doing so would require me to write a translation library first (for PO files/gettext) and to use this library in pongo2 afterwards. |
Would really suck to hard dependency on something like gettext, as I won't be using this for example and want to limit the number of dependencies I'm using. I like how light pongo2 is on dependencies, please bear this in mind :). |
Absolutely. pongo2 only uses the stdlib; any tags/filters which require external dependencies are in pongo2-addons. If it turns out we need/use some sort of external 3rd-party-library (which is not developed by me) it won't go into pongo2, but in pongo2-i18n or something like that which then will be easy importable like pongo2-addons. |
Any progress / best practice / example solutions for this issue? |
Dear all, any progress of the i18n support?
|
No progress yet. I'm happy to discuss proposals and accept pull requests. You can pass the function through the context and call it from there. |
Dear @flosch, Thanks for the reply. Maybe not the best solution, but want to share my idea:
Any idea / comment? |
Dear @flosch, Any comment? |
I just published an implementation of the 'trans'/'blocktrans'-tags that I've been using for a while in a private project. It contains an implementation that uses 'gotext' under the hood, but can be used with other translators if needed. The repo is here: https://github.com/yzzyx/pongo-trans As a bonus, I've published a related repo to extract the strings used in tags in templates and |
(stub)
i18n/i10n
Open questions:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: