[wikka-community] Translations and XML

Dario Taraborelli dartar
Tue Jun 16 11:02:10 GMT 2009

Masin sort of answered to your questions :) There was a discussion  
somewhere (I am not sure it was on the dev mailing list or the  
website) as to whether we should use PHP constants or arrays or even a  
core method for string translation. We didn't consider XML for the  
reasons that Masin pointed out. I think we also discarded .po files as  
an option considering that this would scare away less *nix-minded  
translators. There would definitely be a mechanism to override the  
system defaults with custom translations (similar to what we are doing  
with plugin path overrides).


On 16 Jun 2009, at 09:10, Masin Al-Dujaili wrote:

> Hello Vincent,
> Am Dienstag, den 16.06.2009, 09:21 +0200 schrieb Vincent Mayoux:
>>> I would like to ask why you chose to store the translations in php  
>>> files.
>>> Why not XML ? It could be read, written and processed more easily  
>>> than
>>> a php file.
> I think, it's not. And that's mostly because in a PHP application you
> can simply include the file with the language constants, while an XML
> file needs to be parsed with a lot more of program logic.
>>> An other argument is that you can't redefine a constant in Php, so  
>>> if
>>> one need to customize some truncks of text to his site, he will have
>>> to modify the main translation file, and then lose his changes on  
>>> the
>>> next update of Wikka. XML would allow to store the changes in a
>>> separated file.
>>> Am I clear ?
> And how exactly wouldn't you have to consider some extra logic if we'd
> use XML files? Currently, with PHP constant definitions, you can use
> either those or constant literals. If you'd have to deviate from those
> strings in an XML file -- what would you do besides changing the
> language pack or hard coding the string.
> I guess, you think that the strings will stay in those PHP files
> containing the program logic. That's wrong. Currently, all used  
> strings
> are 'collected' at the top as an intermediate step to out-source  
> them to
> distinct files, thus enabling language packs (probably the next  
> release
> (as has been told the last 4 releases ;-))). All you'd have to do is  
> to
> keep your own customized language pack. I am sure, there'll be a  
> config
> option to point to your language pack.
> As for overwriting single strings, there might be some use indeed. But
> I'd prefer PHP arrays instead of XML nonetheless.
> Regards,
> Masin
> _______________________________________________
> WikkaWiki Community mailing list
> community at wikkawiki.org
> http://mail.wikkawiki.org/mailman/listinfo/community_wikkawiki.org

More information about the community mailing list