Kodi Community Forum
Get user country or region? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Get user country or region? (/showthread.php?tid=343724)



Get user country or region? - smitchell6879 - 2019-05-08

So I know I can get users language with xbmc.geLanguage is there a way to get the users country and or region? Is that even something that gets set in Kodi?


RE: Get user country or region? - V8MEM - 2019-05-09

you can use JSON-RPC https://kodi.wiki/view/JSON-RPC_API/v8#Settings.GetSettingValue to get the locale.timezone or locale.timezonecountry setting, but this is not guaranteed to be set in every platform/install.


RE: Get user country or region? - smitchell6879 - 2019-05-09

(2019-05-09, 07:38)V8MEM Wrote: you can use JSON-RPC https://kodi.wiki/view/JSON-RPC_API/v8#Settings.GetSettingValue to get the locale.timezone or locale.timezonecountry setting, but this is not guaranteed to be set in every platform/install.

Thanks I will give it a try. If it is not set then I will just have it fallback to the USA so no big deal.