Hi Chilly, yes, you can get what language the player currently has by doing:
const language = monogatari.preference ('Language');
There are also some very useful events you could listen to if you need to know the exact moment:
// This event runs whenever the game is going to get localized (the process where strings get replaced)
// with the correct ones for the language chosen by the user and it gets triggered in three scenarios:
// 1. The user just clicked on one of the languages in the language picker screen
// 2. The user just changed languages from the settings screen
// 3. Every time the game gets initialized (once every time the game is opened then)
monogatari.on('willLocalize', () => {
});
// This event runs once the localization process finished
monogatari.on('didLocalize', () => {
});
If you need to know what language they chose on the language selection screen, then you can mix the events with a global property that indicates whether this is the first time they opened the game or not (which is the one used to show the language selection screen itself)
monogatari.on('willLocalize', () => {
// This property will only be true the first time they run the game
if (monogatari.global('_first_run') === true) {
// Get the language they chose
const language = monogatari.preference ('Language');
}
});