Niklas Laxström wrote:
On 3 April 2010 20:53, Ilmari Karonen nospam@vyznev.net wrote:
(For example, {{PLURAL:}} really _has_ to be parsed according to the language the page/message is written for, since the meaning of the params varies between languages. What making {{PLURAL:}} useful in multilingual page content really needs is a syntax for specifying the intended language inline.
In my opinion that's the wrong way. We do not want to hack individually the syntax of every language dependent magic word.
There should be a way to tag the language of whole blocks of text and the parser should be made aware of it. We should do the tagging already on the basis that marking up correctly the language of everything is the right thing to do.
Yeah, that would work too.
The easy way, I think, would be with a parser function. Something like {{lang:en|this, for example}}.
Another possibility would be to try and extract lang attributes from HTML tags, but AFAIK this wouldn't fit into the current parser workflow very well -- brace expansion happens long before normal HTML tags (as opposed to special ones like <nowiki>) are even looked at. I could be wrong about that, though.
Also, <span lang="en"></span> takes more effort to type than {{lang:en|}}. :) Although, on the other hand, turning the latter into correct HTML would be somewhat nontrivial, at least unless we want to just replace it with span tags and let Tidy take care of little details like correct nesting.