I'm looking for the best way to set localization for programs outside of Kodi. Seems to be a topic that is very good for bursting some brains, because there are tons of paths and files where the setting can/must be stored and every distribution does it differently as well.
Without much Python knowledge I had a look at the locale addon.
In short it does the following:
- copy the files from /usr/share/i18n/locale into the addon directory
- also the program localedef
- set a few paths
- bend the system environment 'I18NPath' there
- create a compiled version of the language definition
- store 'LANG' and 'LOCPATH' variables in the file '10-locale.profile' in a profile.d directory under the addon directory.
And that's where I get stuck: What makes LE look for a profile file in an addon subdirectory? How can the environment variable be set permanently in a readonly system? Or are the settings only loaded when the plugin is running? Do you really need to copy the language definitions and localedef into a writable area?
Or in short, what would be the best way to permanently store the locale settings?
To clarify, I don't want to criticize the addon but learn from it.
Thanks in advance