Template for merge pages in different Portuguese variants

Fragment of a discussion from Village pump/en

If was not set any value for the parameter with the user language (or one of it's fallbacks), the template uses the parameter which corresponds to {{SUBPAGENAME}} (I'm supposing that at least "code=something" should be set in a page like "Page/code"). So, at "Page/pt", it is shown:

  • the text passed to "pt-br=...", if the user choose "pt-br"
  • the text passed to "pt=...", if the user choose "pt"
  • the text passed to "pt=..." (because SUBPAGENAME is equals to "pt" in this case), if the user choose anything else (like Dutch).

(I just was not able to show this in the examples at Template:Language variation, because it has no "/code" in its title =) )

Maybe it is better to use {{GetFallback|{{SUBPAGENAME}}}}?

The template should be usable for other languages as well (for example to have en and en-gb at the same page, changin according to the user preferences).

By the way, I've added one line at Template:GetFallback

Helder20:15, 9 December 2009