Topic on Talk:Universal Language Selector

Is there some expression that evaluates to the current language?

2
Larrydberg (talkcontribs)

E.g., something like {{CURRENTLANGUAGE}} that gives me the code for the current interface language?

Background, in case there's another solution: My wiki is multilingual. I use categories heavily, for example Category:Dances. The text at the top of that page should be displayed in the current interface language. So on that page I put {{int:CategoryDancesHeader}} and create pages MediaWiki:CategoryDancesHeader/XX as appropriate. This works fine.

For Hebrew I also must set the overall right-to-left orientation of the page. On a normal page I do that by putting {{PAGELANGUAGE:he}} at the top. But that doesn't work in this case. It looks like setting PAGELANGUAGE on a page doesn't effect pages into which that page is transcluded.

A solution is to set PAGELANGUAGE at the top of Category:Dances itself with something like {{PAGELANGUAGE:{{CURRENTLANGUAGE}}}}. How can I get my hands on the current language in order to do this?

I'd also think this functionality is useful enough to be provided directly, e.g., let {{SETPAGELANGUAGECURRENT}} to set the page language to the current language.

Nemo bis (talkcontribs)

No, there isn't. The request to add one has been rejected/delayed many times because it would allegedly break Wikimedia projects' caching system, see bugzilla:2085. Wikis are using a hack which achieves the same effect anyway (so allegedly breaking thier cache, but nobody cares), that is a custom message Lang called with int magic word, which will return the language code of the user's interface. I can't tell if it's the appropriate solution for you, but you can do the same or locally hack your MediaWiki installation as e.g. translatewiki.net does (I think some patches were published on the bug or elsewhere).

Reply to "Is there some expression that evaluates to the current language?"