G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
Internationalization Namespace Reference

Functions

Utilities|Internationalization
FString GetNativeCulture (ELocalizedTextSourceCategory TextCategory)
 Get the native culture for the given localization category.
FString GetCultureDisplayName (FString Culture, bool Localized=true)
 Get the display name of the given culture.
FString GetCurrentAssetGroupCulture (const FName AssetGroup)
 Get the given asset group category culture. Note: Returns the current language if the group category doesn't have a culture override.
FString GetCurrentCulture ()
 Get the current culture as an IETF language tag:
FString GetCurrentLanguage ()
 Get the current language (for localization) as an IETF language tag:
FString GetCurrentLocale ()
 Get the current locale (for internationalization) as an IETF language tag:
TArray< FString > GetLocalizedCultures (bool IncludeGame=true, bool IncludeEngine=false, bool IncludeEditor=false, bool IncludeAdditional=false)
 Get the list of cultures that have localization data available for them.
void ClearCurrentAssetGroupCulture (const FName AssetGroup, bool SaveToConfig=false)
 Clear the given asset group category culture.
FString GetSuitableCulture (TArray< FString > AvailableCultures, FString CultureToMatch, FString FallbackCulture="en")
 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.
bool SetCurrentAssetGroupCulture (const FName AssetGroup, FString Culture, bool SaveToConfig=false)
 Set the given asset group category culture from an IETF language tag (eg, "zh-Hans-CN").
bool SetCurrentCulture (FString Culture, bool SaveToConfig=false)
 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.
bool SetCurrentLanguage (FString Culture, bool SaveToConfig=false)
 Set only the current language (for localization). Note: Unless you're doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.
bool SetCurrentLanguageAndLocale (FString Culture, bool SaveToConfig=false)
 Set the current language (for localization) and locale (for internationalization).
bool SetCurrentLocale (FString Culture, bool SaveToConfig=false)
 Set only the current locale (for internationalization). Note: Unless you're doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.

Variables

Variables
const FString CurrentLanguage
const FString CurrentLocale
const FString CurrentCulture

Function Documentation

◆ ClearCurrentAssetGroupCulture()

void ClearCurrentAssetGroupCulture ( const FName AssetGroup,
bool SaveToConfig = false )

Clear the given asset group category culture.

Parameters
AssetGroupThe asset group to clear the culture for.
SaveToConfigIf true, save the new setting to the users' "GameUserSettings" config so that it persists after a reload.

◆ GetCultureDisplayName()

FString GetCultureDisplayName ( FString Culture,
bool Localized = true )

Get the display name of the given culture.

Parameters
CultureThe culture to get the display name of, as an IETF language tag (eg, "zh-Hans-CN")
LocalizedTrue 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.

◆ GetCurrentAssetGroupCulture()

FString GetCurrentAssetGroupCulture ( const FName AssetGroup)

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

Parameters
AssetGroupThe asset group to get the culture for.
Returns
The culture as an IETF language tag (eg, "zh-Hans-CN").

◆ GetCurrentCulture()

FString GetCurrentCulture ( )

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").

◆ GetCurrentLanguage()

FString GetCurrentLanguage ( )

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").

◆ GetCurrentLocale()

FString GetCurrentLocale ( )

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").

◆ GetLocalizedCultures()

TArray< FString > GetLocalizedCultures ( bool IncludeGame = true,
bool IncludeEngine = false,
bool IncludeEditor = false,
bool IncludeAdditional = false )

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

Parameters
IncludeGameCheck for localized game resources.
IncludeEngineCheck for localized engine resources.
IncludeEditorCheck for localized editor resources.
IncludeAdditionalCheck for localized additional (eg, plugin) resources.
Returns
The list of cultures as IETF language tags (eg, "zh-Hans-CN").

◆ GetNativeCulture()

FString GetNativeCulture ( ELocalizedTextSourceCategory TextCategory)

Get the native culture for the given localization category.

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

◆ GetSuitableCulture()

FString GetSuitableCulture ( TArray< FString > AvailableCultures,
FString CultureToMatch,
FString FallbackCulture = "en" )

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
AvailableCulturesList of available cultures to filter against (see GetLocalizedCultures).
CultureToMatchCulture to try and match (see GetCurrentLanguage).
FallbackCultureThe 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").

◆ SetCurrentAssetGroupCulture()

bool SetCurrentAssetGroupCulture ( const FName AssetGroup,
FString Culture,
bool SaveToConfig = false )

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

Parameters
AssetGroupThe asset group to set the culture for.
CultureThe culture to set, as an IETF language tag (eg, "zh-Hans-CN").
SaveToConfigIf 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.

◆ SetCurrentCulture()

bool SetCurrentCulture ( FString Culture,
bool SaveToConfig = false )

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
CultureThe culture to set, as an IETF language tag (eg, "zh-Hans-CN").
SaveToConfigIf 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.

◆ SetCurrentLanguage()

bool SetCurrentLanguage ( FString Culture,
bool SaveToConfig = false )

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

Parameters
CultureThe language to set, as an IETF language tag (eg, "zh-Hans-CN").
SaveToConfigIf 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.

◆ SetCurrentLanguageAndLocale()

bool SetCurrentLanguageAndLocale ( FString Culture,
bool SaveToConfig = false )

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

Parameters
CultureThe language and locale to set, as an IETF language tag (eg, "zh-Hans-CN").
SaveToConfigIf 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.

◆ SetCurrentLocale()

bool SetCurrentLocale ( FString Culture,
bool SaveToConfig = false )

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

Parameters
CultureThe locale to set, as an IETF language tag (eg, "zh-Hans-CN").
SaveToConfigIf 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.

Variable Documentation

◆ CurrentCulture

const FString CurrentCulture

◆ CurrentLanguage

const FString CurrentLanguage

◆ CurrentLocale

const FString CurrentLocale