Other LG Functions - Grisgram/gml-raptor GitHub Wiki

LG_init

/// @function		LG_init(locale_to_use = undefined)
/// @description	Initializes the LG system. If LG_AUTO_INIT_ON_STARTUP is set to false, 
///			it must be called at the start of the game.
///			Subsequent calls will re-initialize and reload the language file of the current language.
///			To "hot-swap" the display language, use the LG_hotswap(...) function.
/// @param {string} 	locale_to_use - If not supplied or undefined, the OS language will be used.
///			Here you can supply the locale that the user might have set in your game's options
///			from your game's settings files.

LG_get_stringmap

/// @function		LG_get_stringmap()
/// @description	Gets the string map of the currently active locale file.
///			This returns the entire string struct. Treat as read-only!

LG_get_fallback_stringmap

/// @function		LG_get_fallback_stringmap()
/// @description	Gets the fallback string map (the default language if a key is not found in the string map)
///			This returns the entire string struct. Treat as read-only!

LG_hotswap

/// @function		LG_hotswap(new_locale)
/// @param {string} 	new_locale	The new locale to switch to.
/// @description	Reload the LG system with a new language.
///	+------------------------------------------------------------------------------------------------+
///	| (!) ATTENTION! This function will call LG_Init(), load the file, and restart the current room! |
///	+------------------------------------------------------------------------------------------------+

LG_resolve

/// @function		LG_resolve(str)
/// @description	Resolve a string in the format of object instance variables.
///			These strings either start with == or =. If neither is true, str is returned unmodified.
/// @param {string} str The string to resolve
/// @returns {string}	The resolved string or str unmodified if it didn't start with at least one "="