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
Is starlette-i18n limited to provide only one extra locale? #15
Comments
Hi. yes, it is correct one translation locale by one request. I do not know examples as you need more one locale for request |
It is only example. You can use so many locales as you need. For example we use this library with 10 different locales. |
And users haven't reported translations being slightly mixed up or performance issues in cases of high load of the website?
In first discussion I referred Starlette developers seem to agree that Jinja2 i18n extension is not suitable for ASGI, because it uses global language state. In the second discussion the same point of using global gettext instead of isolated context for each locale is made in Jinja2 issue tracker referring to Aiohttp. How have you overcome this issue of Jinja i18n extension using global gettext functions, @bigbag? Since starlette-i18n seems to provide a wrapper for Jinja2 i18n extension, it has to handle these problems somehow, doesn't it? |
Do I understand correctly that starlette-i18n cannot provide more than one translation locale at a time? Examples here also deliver only one extra locale besides English as the default language. Is that intentional and expresses a limitation of using starlette-i18n and more generally jinja2.ext.i18n for ASGI frameworks like Starlette?
I found related discussions at encode/starlette#279 (comment) and pallets/jinja#1323 (comment), but maybe you @bigbag as the author of this localisation helper have further comments and maybe some practical suggestions on this?
The text was updated successfully, but these errors were encountered: