Michael Dale wrote:
> We really need a wikidata type site.
A very easy and ugly workaround would be to store an image on
Wikimedia Commons, containting the letters "Barack Obama" and
having the filename President_of_USA.png. Next time change comes
to the White House, the image is replaced with a new version.
Then each language article could contain: "The president of the
United States is [[file:President of USA.png]]", and the right
name would automatically appear there. You'd need such images for
the names of all officicials, population of all cities, and so on.
(Don't scream. I copied this idea from the visitor counters of
mid-1990s websites, which were implemented by transcluding
images presenting the current number of visitors.)
From this ugly hack, it's easy to conceive that Wikimedia Commons
could distribute not only images but also text snippets and data.
An easy way to do this is to treat the template namespace
similar to the file namespace. Files (images) that aren't found
on the local wiki, are imported from Wikimedia Commons. If the
template {{president of the USA}} is not found locally, that
template would be sought on Wikimedia Commons.
With the right parameter setup and #switch: constructs, it could
be handled with just a few templates, e.g. {{president|USA}}
containing {{#switch: {{{1}}}|USA=Obama|Russia=Medvedev}}.
Of course, we'd need similar templates for Cyrillic and Arabic
scripts. But they could be named {{Президент}} and contain
{{#switch:{{{1}}}|США=Обама|Россия=Медведев}}, etc.
Of course, this kind of transclusion doesn't help you to write the
article about Barack Obama, where it says that "he was elected
president of the United States in 2008 and took office in January
2009". But that is not a piece of text that needs to be
automatically updated.
It's interesting what would happen if the template imported from
Commons calls other templates, that do exist on the local wiki.
In programming language terms, it would imply that template
expansion has "dynamic scope", just like Emacs Lisp, rather than
static or lexical scope (like most languages),
http://en.wikipedia.org/wiki/Scope_(programming)
--
Lars Aronsson ([email protected])
Aronsson Datateknik - http://aronsson.se
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l