2013-04-22, 08:53
There must be a way to get the ISO-639-1 2-letter language code for the XBMC language? The best API I have found is xbmc.getLanguage() which returns something like "English".
(2013-04-22, 09:52)sphere Wrote: @Martijn:
If you want to develop such an add-on, feel free to copy some code from my iTunes Podcast Add-on.
But, personally I would prefer a core solution.
(2013-04-22, 12:00)ace20022 Wrote:(2013-04-22, 09:54)Martijn Wrote: i'd prefer a core solution to but for the time being.
I could try it if no one else is working on that.
(2013-04-22, 09:00)Martijn Wrote: preferred would be and optional in the xbmc.getLanguage() where you define what type you want to retrieve.
0: full language
1: two letter code
2: three letter code
(2013-04-22, 12:37)Martijn Wrote: yes please
core also has these language codes internally so just need to bee hooked up.
(2013-04-22, 13:39)moreginger Wrote: This sounds great!
Would we get access to regionalized variants, e.g. pt-br, en-gb? I don't know if XBMC regionalizes at that granularity, but TED subtitles do (at least for pt-br ).
(2013-04-22, 14:13)ace20022 Wrote:If they aren't available then the following happens:(2013-04-22, 13:39)moreginger Wrote: This sounds great!
Would we get access to regionalized variants, e.g. pt-br, en-gb? I don't know if XBMC regionalizes at that granularity, but TED subtitles do (at least for pt-br ).
Is this really reasonable? Do you have a use case? If so I will dig a bit deeper.
(2013-04-22, 09:52)sphere Wrote: @Martijn:
If you want to develop such an add-on, feel free to copy some code from my iTunes Podcast Add-on.
But, personally I would prefer a core solution.
(2013-04-22, 21:31)Martijn Wrote: For testing
https://github.com/xbmc/xbmc/pull/2643
Since that only handles the xbmc.getLanguage we should as an extra also be able to convert two to three letter code and vice versa and also back to complete language string. That would still be a job of a module I guess
Like convert_language() with the option to define what you want to get back.
(2013-04-22, 14:27)moreginger Wrote:Had a brief look, should be possible. @Martijn Shall I add a second bool param with default value false?(2013-04-22, 14:13)ace20022 Wrote:If they aren't available then the following happens:(2013-04-22, 13:39)moreginger Wrote: This sounds great!
Would we get access to regionalized variants, e.g. pt-br, en-gb? I don't know if XBMC regionalizes at that granularity, but TED subtitles do (at least for pt-br ).
Is this really reasonable? Do you have a use case? If so I will dig a bit deeper.
* Brazilian user selects XBMC language: Portuguese (Brazil) - assuming this is or will be possible.
* xbmc.getLanguage(...) returns 'pt'.
* Subtitles fetched in 'ordinary' Portuguese not 'pt-br'.
It's not exactly apocalyptic stuff (maybe Brazilians disagree ) but it would be nice.