unreal.InternationalizationLibrary

class unreal.InternationalizationLibrary(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: BlueprintFunctionLibrary

Kismet Internationalization Library

C++ Source:

  • Module: Engine

  • File: KismetInternationalizationLibrary.h

classmethod clear_current_asset_group_culture(asset_group, save_to_config=False) None

Clear the given asset group category culture.

Parameters:
  • asset_group (Name) – The asset group to clear the culture for.

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

classmethod get_culture_display_name(culture, localized=True) str

Get the display name of the given culture.

Parameters:
  • culture (str) – The culture to get the display name of, as an IETF language tag (eg, “zh-Hans-CN”)

  • localized (bool) – True to get the localized display name (the name of the culture in its own language), or False to get the display name in the current language.

Returns:

The display name of the culture, or the given culture code on failure.

Return type:

str

classmethod get_current_asset_group_culture(asset_group) str

Get the given asset group category culture. note: Returns the current language if the group category doesn’t have a culture override.

Parameters:

asset_group (Name) – The asset group to get the culture for.

Returns:

The culture as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod get_current_culture() str
Get the current culture as an IETF language tag:
  • A two-letter ISO 639-1 language code (eg, “zh”).

  • An optional four-letter ISO 15924 script code (eg, “Hans”).

  • An optional two-letter ISO 3166-1 country code (eg, “CN”).

note: This function exists for legacy API parity with SetCurrentCulture and is equivalent to GetCurrentLanguage.

Returns:

The culture as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod get_current_language() str
Get the current language (for localization) as an IETF language tag:
  • A two-letter ISO 639-1 language code (eg, “zh”).

  • An optional four-letter ISO 15924 script code (eg, “Hans”).

  • An optional two-letter ISO 3166-1 country code (eg, “CN”).

Returns:

The language as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod get_current_locale() str
Get the current locale (for internationalization) as an IETF language tag:
  • A two-letter ISO 639-1 language code (eg, “zh”).

  • An optional four-letter ISO 15924 script code (eg, “Hans”).

  • An optional two-letter ISO 3166-1 country code (eg, “CN”).

Returns:

The locale as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod get_localized_cultures(include_game=True, include_engine=False, include_editor=False, include_additional=False) Array[str]

Get the list of cultures that have localization data available for them.

Parameters:
  • include_game (bool) – Check for localized game resources.

  • include_engine (bool) – Check for localized engine resources.

  • include_editor (bool) – Check for localized editor resources.

  • include_additional (bool) – Check for localized additional (eg, plugin) resources.

Returns:

The list of cultures as IETF language tags (eg, “zh-Hans-CN”).

Return type:

Array[str]

classmethod get_native_culture(text_category) str

Get the native culture for the given localization category.

Parameters:

text_category (LocalizedTextSourceCategory) –

Returns:

The culture as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod get_suitable_culture(available_cultures, culture_to_match, fallback_culture='en') str
Given a list of available cultures, try and find the most suitable culture from the list based on culture prioritization.

eg) If your list was [en, fr, de] and the given culture was “en-US”, this function would return “en”. eg) If your list was [zh, ar, pl] and the given culture was “en-US”, this function would return the fallback culture.

Parameters:
  • available_cultures (Array[str]) – List of available cultures to filter against (see GetLocalizedCultures).

  • culture_to_match (str) – Culture to try and match (see GetCurrentLanguage).

  • fallback_culture (str) – The culture to return if there is no suitable match in the list (typically your native culture, see GetNativeCulture).

Returns:

The culture as an IETF language tag (eg, “zh-Hans-CN”).

Return type:

str

classmethod set_current_asset_group_culture(asset_group, culture, save_to_config=False) bool

Set the given asset group category culture from an IETF language tag (eg, “zh-Hans-CN”).

Parameters:
  • asset_group (Name) – The asset group to set the culture for.

  • culture (str) – The culture to set, as an IETF language tag (eg, “zh-Hans-CN”).

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

Returns:

True if the culture was set, false otherwise.

Return type:

bool

classmethod set_current_culture(culture, save_to_config=False) bool

Set the current culture. note: This function is a sledgehammer, and will set both the language and locale, as well as clear out any asset group cultures that may be set.

Parameters:
  • culture (str) – The culture to set, as an IETF language tag (eg, “zh-Hans-CN”).

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

Returns:

True if the culture was set, false otherwise.

Return type:

bool

classmethod set_current_language(culture, save_to_config=False) bool

Set only the current language (for localization). note: Unless you’re doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.

Parameters:
  • culture (str) – The language to set, as an IETF language tag (eg, “zh-Hans-CN”).

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

Returns:

True if the language was set, false otherwise.

Return type:

bool

classmethod set_current_language_and_locale(culture, save_to_config=False) bool

Set the current language (for localization) and locale (for internationalization).

Parameters:
  • culture (str) – The language and locale to set, as an IETF language tag (eg, “zh-Hans-CN”).

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

Returns:

True if the language and locale were set, false otherwise.

Return type:

bool

classmethod set_current_locale(culture, save_to_config=False) bool

Set only the current locale (for internationalization). note: Unless you’re doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.

Parameters:
  • culture (str) – The locale to set, as an IETF language tag (eg, “zh-Hans-CN”).

  • save_to_config (bool) – If true, save the new setting to the users’ “GameUserSettings” config so that it persists after a reload.

Returns:

True if the locale was set, false otherwise.

Return type:

bool