xbmc/xbmc — pull request #5561 by Montellese (2014-10-23 06:15:54+00:00)
Title: Language addons

Last weekend I was thining that it would be nice if we would support addons that simply provide files that could be used by internal code and/or by other addons. There would be no logic and nothing to be executed in those addons. An example use case would be image package addons that could be used by multiple skins (e.g. an image package of all studio logos). I started working on it and added a basic "resource" addon which is exposed through our VFS under a `resource://`path.

Since I don't know much about skinning I decided to try another possible resource addon and came up with language addons. Every language in Kodi basically consists of a `langinfo.xml` and a `strings.po` so there are only files and no other logic. So I came up with the `xbmc.resource.language` addon extension point and `resource.language.` addons. The files of a language are available through `resource://language//`.

I have adjusted the startup code (had to move addon initialization before language loading) and added some logic to handle updates coming from old configurations. I have also added reloading of language strings if the addon providing the currently used language is updated. Furthermore I have added a dialog asking the user if he wants to switch to a newly installed language (same as for skins).

I have converted all existing languages to addons but I'm pretty sure that I messed some of them up. Furthermore I noticed that not all of the languages with a strings.po have a langinfo.xml. How does that work? Last but not least the `German` language also had a `keyboardmap.xml` file which doesn't seem to be used/referenced anywhere in our code base so I removed it.

I have also tried to adjust the build scripts but that's completely untested right now. On win32 it's also not possible right now to choose the installed languages in the installation wizard. Furthermore Xcode will need updating.

I have no idea how this fits into the tools used by @alanwww1 and our transifex project. Maybe with this it could become possible for language-specific teams to create an updated addon of their language themselves and submit them to the official repository to lessen the work @alanwww1 has to do on his own right now.