Outside of plex, I can find the locale in python several ways. This code:
[codebox]import locale
import os
print os.environ[‘LANG’]
print os.getenv(‘LANG’)
print locale.getdefaultlocale()[0][/codebox]
Gives this output (on my machine, in the UK):
en_GB.UTF-8
en_GB.UTF-8
en_GB
However, these (and a few other more desperate attempts, such as locale.LC_MONETARY) don’t work in Plex; usually crashing the script.
How do I find the locale when I’m running a script from inside Plex?
Oh, and I just discovered that xbmc.getLanguage() returns “English (US)”; that’s not helpful to me as I’m a UK user. It does make me wonder whether there’s some language setting in Plex that I’m missing (I have looked, honest!).
Also xbmc.getRegion(‘datelong’) returns d MMMM yyyy, which I presume is the same for Macs in the US?
We’ve moved to handling locales differently than the old XBMC code used to, and it’s possible (likely?) that the internal scripting stuff has been left behind. To be honest, we’re supporting the Media Server plug-ins and not the actual Plex python stuff these days, as historically it’s been a moving target and a source of instability.
(The Plex Media Server plug-ins receive the Plex locale as an HTTP header)
If you let me know what you’re working on, I would be happy to recommend a path 
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.