Nice! ;-)
Do you think tables like these http://pt.wiktionary.org/wiki/Wikcion%C3%A1rio:Vers%C3%B5es da língua portuguesa/Tabela http://pt.wikipedia.org/wiki/Wikipedia:Vers%C3%B5es da língua portuguesa/tabela could be a start point to a similar conversion system for pt <-> pt-br?
Meanwhile, I was also trying to adapt the Template:LangSwitch from Wikimedia Commons (http://commons.wikimedia.org/wiki/Template:LangSwitch), in order to be able to use the template syntax like this: {{Language variations| pt = word 1| pt-br = word 2}}
For this, I've created two pages: * MediaWiki:Lang, with 'pt' * MediaWiki:Lang/pt-br, with 'pt-br'
and the template code is essentially: {{#switch:{{int:Lang}} |pt-br={{{pt-br|}}} |pt |#default={{{pt|}}} }}
But I wasn't able to create a param "default" in order we could set which of the variants will be shown by default for anonymous users. It would be good if we could use {{Language variations| default = pt-br | pt = word 1| pt-br = word 2}} to get: (a) word 2, for annonimous users; (b) word 1, for logged users which choose 'pt' in their preferences; (c) word 2, for logged users which choose 'pt-br' in their preferences; The option (a) would be necessary if we don't want to change an existing text from 'pt-br' to 'pt' (for anonymous users) just because we want the logged users to be able to choose the "content variant".
Is there any way of detect if the reader is logged in with something in the style {{#if: <what?> | foo| bar}}? (the problem with {{int:Lang}} is that for anonymous users and for users who choose 'pt' the result is the same: 'pt', so I can't distinguish these two cases at the template...)
Anyway, I think it would be better to have some kind of an automatized conversion system, even if it doesn't convert all cases ( at least for the words in the tables above it would be useful)
Thank you for all,
Helder
2009/9/9 Tim Starling tstarling@wikimedia.org:
Roan Kattouw wrote:
That's the alphabet variant thing I mentioned earlier. If the majority of the differences between pt and pt-br can be summed up with simple rules that a computer can handle, we might be able to work something out. However, that's usually not the case; I don't know Portugese, but I do know that handling even simple differences between en-us and en-gb is too complex already: a system that would successfully convert 'realise' to 'realize' may also try to wrongfully convert 'disguise'.
I don't know why you're writing this nonsense, you obviously haven't looked at the code at all.
The language variant system that we have could easily convert between US and UK English. In fact it already does convert between a language pair with a far more complex relationship, that is Simplified and Traditional Chinese.
The language conversion system is very simple, it's just a table of translated pairs, where the longest match takes precedence. The translation table in one direction (e.g. UK -> US) can be different to the table in the other direction (US -> UK). You would not list "ize -> ise", you would list every word in the dictionary with an -ize ending that can be translated to -ise without controversy. The current software could handle 50k pairs or so without serious performance problems, and it could be extended and optimised to allow millions of pairs if there was a need for that.
It's possible to handle any pair of languages which are separated only by vocabulary, and transliteration or spelling. It's only differences in grammar, such as word order, that would give it trouble.
-- Tim Starling
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l