i18n_get_locales()

The i18n_get_locales() function is used to get the all of the initialized locales in the GM-I18n system by using I18nLocaleInit struct.

This function can only be used after the i18n_create() function is called.

Syntax

Usage
i18n_get_locales([i18n]);
Signature
function i18n_get_locales(
    i18n?: I18n | boolean           // default = false (using global i18n struct)
): I18nLocaleInit[]

Parameters

NameTypeDefaultDescription
i18nBoolean | I18nfalseThe i18n struct reference, or leave it empty to use the global i18n struct.

Returns

I18nLocaleInit[]

Examples

Create Event
// assume the system is initialized on global variable

// get the initialized locales
var init_locales = i18n_get_locales();

The returned I18nLocaleInit struct contains the code, name, and file property. So, if you want to get the locale code, you can use init_locales[0].code, and so on, or just use i18n_get_locales_code() function instead.
These structs are returned as reference. So, if you change the value of the struct, it will affect the original struct in the GM-I18n system.