Last modified: 2009-08-01 19:03:59 UTC
In "[Semediawiki-user] problem foaf import in Es-MW" e-mail, user David reports that MediaWiki:Smw_import_foaf doesn't work when used on a Spanish wiki, e.g. in the page Atributo:Nombre. The error I currently see is 'smw_wrong_importtype'. What I think is happening is SMW_Factbox.php lines 147-156 only test the namespace from the element's line in MediaWiki:Smw_import_Xxxx page against the translated namespace names. So a Spanish site won't work with name|Type:String because "Type" does not match the translated wgContLang->getNsText(SMW_NS_TYPE). If I'm right, the workaround is to use translated names in the MediaWiki:Smw_import_Xxxx page, e.g. name|Tipos de datos:String The fix is to change those lines in SMW_Factbox.php to work with namespace IDs, something like: $elem_ns_index = wgContLang->getNsIndex($namespace) switch ($elem_ns_index) { case SMW_NS_TYPE: $elemtype = ... case SMW_NS_PROPERTY ... etc. This should be faster code, too ;-)
Various changes have happened to the import code since this bug was filed. Currently, the type of the imported elements is not actually checked any more, which is not really a good solution either. Based on the observation that there are usually only few imported vocabulary terms in any wiki, I would like to have a redesigned import mechanism that allows for "vocabulary extensions" that provide their own predefined page names to which they are mapped as soon as the extension is enabled. This would be a future project, however ... interested contributors should contact me. I close this bug now as "INVALID" (which it has become over time -- shame on us ;-).