{"action":"created","issue":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/5561","labels_url":"https://api.github.com/repos/xbmc/xbmc/issues/5561/labels{/name}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/5561/comments","events_url":"https://api.github.com/repos/xbmc/xbmc/issues/5561/events","html_url":"https://github.com/xbmc/xbmc/pull/5561","id":46592312,"number":5561,"title":"Language addons","user":{"login":"Montellese","id":75864,"avatar_url":"https://avatars.githubusercontent.com/u/75864?v=3","gravatar_id":"","url":"https://api.github.com/users/Montellese","html_url":"https://github.com/Montellese","followers_url":"https://api.github.com/users/Montellese/followers","following_url":"https://api.github.com/users/Montellese/following{/other_user}","gists_url":"https://api.github.com/users/Montellese/gists{/gist_id}","starred_url":"https://api.github.com/users/Montellese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Montellese/subscriptions","organizations_url":"https://api.github.com/users/Montellese/orgs","repos_url":"https://api.github.com/users/Montellese/repos","events_url":"https://api.github.com/users/Montellese/events{/privacy}","received_events_url":"https://api.github.com/users/Montellese/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Feature","name":"Feature","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/xbmc/xbmc/milestones/58","html_url":"https://github.com/xbmc/xbmc/milestones/I*******%2015.0-alpha2","labels_url":"https://api.github.com/repos/xbmc/xbmc/milestones/58/labels","id":946522,"number":58,"title":"I******* 15.0-alpha2","description":"","creator":{"login":"Montellese","id":75864,"avatar_url":"https://avatars.githubusercontent.com/u/75864?v=3","gravatar_id":"","url":"https://api.github.com/users/Montellese","html_url":"https://github.com/Montellese","followers_url":"https://api.github.com/users/Montellese/followers","following_url":"https://api.github.com/users/Montellese/following{/other_user}","gists_url":"https://api.github.com/users/Montellese/gists{/gist_id}","starred_url":"https://api.github.com/users/Montellese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Montellese/subscriptions","organizations_url":"https://api.github.com/users/Montellese/orgs","repos_url":"https://api.github.com/users/Montellese/repos","events_url":"https://api.github.com/users/Montellese/events{/privacy}","received_events_url":"https://api.github.com/users/Montellese/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":0,"state":"open","created_at":"2015-01-22T07:34:16Z","updated_at":"2015-02-27T16:14:02Z","due_on":"2015-03-30T22:00:00Z","closed_at":null},"comments":123,"created_at":"2014-10-23T06:15:54Z","updated_at":"2015-02-28T21:58:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/5561","html_url":"https://github.com/xbmc/xbmc/pull/5561","diff_url":"https://github.com/xbmc/xbmc/pull/5561.diff","patch_url":"https://github.com/xbmc/xbmc/pull/5561.patch"},"body":"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.\r\n\r\nSince 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.<language id>` addons. The files of a language are available through `resource://language/<language id>/<file>`.\r\n\r\nI 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).\r\n\r\nI 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.\r\n\r\nI 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.\r\n\r\nI 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.\r\n\r\nTODOs:\r\n- [x] decide whether we want to go with `ll_CC` everywhere or `ll` and `ll_CC` where necessary\r\n- [x] check all usages of `locale.language` which might rely on the old language names\r\n- [x] rename `xbmc.resource` to `kodi.resource`\r\n- [x] update `subtitles.languages` setting's value\r\n- [x] decide whether to store the full addon id or only the locale in `locale.language`\r\n- [x] decide whether to use `resource://<addon id>` or `resource://<resource type>/<resource identifier>` URL schema"},"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/comments/76549214","html_url":"https://github.com/xbmc/xbmc/pull/5561#issuecomment-76549214","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/5561","id":76549214,"user":{"login":"Montellese","id":75864,"avatar_url":"https://avatars.githubusercontent.com/u/75864?v=3","gravatar_id":"","url":"https://api.github.com/users/Montellese","html_url":"https://github.com/Montellese","followers_url":"https://api.github.com/users/Montellese/followers","following_url":"https://api.github.com/users/Montellese/following{/other_user}","gists_url":"https://api.github.com/users/Montellese/gists{/gist_id}","starred_url":"https://api.github.com/users/Montellese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Montellese/subscriptions","organizations_url":"https://api.github.com/users/Montellese/orgs","repos_url":"https://api.github.com/users/Montellese/repos","events_url":"https://api.github.com/users/Montellese/events{/privacy}","received_events_url":"https://api.github.com/users/Montellese/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T21:58:56Z","updated_at":"2015-02-28T21:58:56Z","body":"OK I have unified the way we load/change the displayed language so that all call paths go through setting the `locale.language` setting and then going through `CLangInfo::SetLanguage()` which contains the logic to determine new language addon IDs from old language names and to fallback to English if the language can't be found.\r\n\r\nI've also noticed that we currently have a bug that we don't set the proper audio and subtitle languages when loading another profile. We simply keep using the ones from the master profile.\r\n\r\njenkins build this please"}}