Determining system language

JavaFXpert
Member
 
Posts: 18
Joined: Sat Jun 01, 2019 23:33
GitHub: JavaFXpert

Determining system language

by JavaFXpert » Wed Oct 02, 2019 17:00

I realize that minetest.setting_get('language') will return the language setting in minetest.conf, but if it's not set, then it doesn't seem to return a language code. How can a mod know the system language? Is available via an API call within Minetest?
 

User avatar
rubenwardy
Moderator
 
Posts: 5859
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Determining system language

by rubenwardy » Wed Oct 02, 2019 17:02

Try os.getlocale I know setlocale exists, not sure about the counter part

Or os.getenv("LANG"), but not sure if that's portable
 

JavaFXpert
Member
 
Posts: 18
Joined: Sat Jun 01, 2019 23:33
GitHub: JavaFXpert

Re: Determining system language

by JavaFXpert » Wed Oct 02, 2019 17:28

Thanks. os.setlocale() doesn't seem to exist, and os.getenv("LANG") doesn't seem to be portable. Minetest seems to sense the system language, so hopefully there is, or will be, some way to retrieve it.
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 3 guests