Using unregistered transliteration modules
I saw this edit of yours, which fixed the module error, but not the actual problem. The problem is that transliteration modules can only be accessed through Module:languages, which requires a language code and looks up the registered module, but Module:ar-translit is not registered (because it is incomplete and possibly still a work in progress). There needs to be a way to test these unregistered transliteration modules. I was thinking something like {{xlit|Module:ar-translit|...}}
should recognize that it was not given a language code and somehow access the module directly, but this clearly cannot be done directly from a template. Should we create a new template and module for this? Or should we add some sort support for this in Module:languages? Or is there already a way to do this that I'm missing?
I don't really know why the transliteration module was giving an error to begin with. I didn't look at it in much detail.
So what you're saying is that it could have been accessed directly, but the module itself was malfunctioning?
No, I was right to begin with. The error is caused by the fact that the tr function isn't meant to be invoked directly from a template. So everything I said in my first post here still stands.
It would be possible to add a "module_override" parameter to transliterate
in Module:languages. That way you could transliterate texts with a module other than the registered one. Your method would not work, because the language code is also passed to the transliteration module as a parameter.
We should make it clear though that this new function would only be for testing purposes, to avoid people using it too often. Maybe a tracking template should track all uses of this parameter?
That sounds like a good idea. I assume you mean something like {{xlit|module_override=Module:ar-translit}}
?
Well, the function I mentioned would also need such a parameter for it to work. But yes, {{xlit}}
would also need to support that parameter.
Oh I see, there are more intermediate functions. I think for the transliterate
function, "module_override" is a good parameter name, but for the {{xlit}}
it should probably be shorter. Something like {{xlit|mod=Module:ar-translit}}
, possibly even without the Module:
part if we know with 100% certainty that all modules will be in the module namespace.