开发者

Choosing language

开发者 https://www.devze.com 2023-01-22 12:59 出处:网络
Choosing language I see http://github.com/ and OpenBSD.org got 2 examples how to. Github has a dropdown and openbsd.org just links. Which kind of UI for this use case could you recommend?

Choosing language I see http://github.com/ and OpenBSD.org got 2 examples how to. Github has a dropdown and openbsd.org just links. Which kind of UI for this use case could you recommend? I now take the parameter hl=el for instance for greek which switches i18n internals to greek or other language and present available languages like this

{% get_current_language as LANGUAGE_CODE %}&nbsp;<b>{{ LANGUAGE_CODE }}</b>{% get_available_languages as LANGUAGES %}{% for LANGUAGE in LANGUAGES %}{% ifnotequal LANGUAGE_CODE LANGUAGE.0 %}&nbsp;<a href='?hl={{ LANGUAGE.0 }}'>{{ LANGUAGE.0 }}</a>{% endifnotequal %}{% endfor %}

It's possi开发者_StackOverflow社区ble to think other parameter handling than for instance http get hl=el for a greek ui and there is no obvious standard. Most sites seem to use a dropdown where a combined dropdown with most common languages directly by links also look feasible option. I hope you can comment or recommend these alternatives.


The default l10n middleware looks for a session variable or cookie with the name django_language.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号