如何获取模板中当前 URL 的本地化版本?
我正在将我的 language-in-url 引擎从 transurlvania 移动到 i18nurls (补丁已接受 < a href="https://docs.djangoproject.com/en/dev/topics/i18n/translation/#language-prefix-in-url-patterns" rel="nofollow">未来版本的 django),但我缺少类似于 transurlvania 的很棒的 {% this_page_in_lang 'cs' %}
来实现通用语言切换链接。
我不知道如何仅使用 django 来实现这一点。
I'm moving my language-in-url engine from transurlvania to i18nurls (a patch accepted to future version of django) but I'm missing something similar to transurlvania's awsome {% this_page_in_lang 'cs' %}
to implement generic language switching link.
I can't figure out how to achieve this using only django.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从阅读 https://docs.djangoproject.com/ en/dev/topics/i18n/translation/#std:templatetag-language,我想这个问题的答案应该是:
From reading https://docs.djangoproject.com/en/dev/topics/i18n/translation/#std:templatetag-language, I guess an answer to this question should be: