Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FInternationalization Class Reference

#include <Internationalization.h>

+ Collaboration diagram for FInternationalization:

Classes

struct  FCultureStateSnapshot
 

Public Member Functions

bool SetCurrentCulture (const FString &InCultureName)
 
FCultureRef GetCurrentCulture () const
 
bool SetCurrentLanguage (const FString &InCultureName)
 
FCultureRef GetCurrentLanguage () const
 
bool SetCurrentLocale (const FString &InCultureName)
 
FCultureRef GetCurrentLocale () const
 
bool SetCurrentLanguageAndLocale (const FString &InCultureName)
 
bool SetCurrentAssetGroupCulture (const FName &InAssetGroupName, const FString &InCultureName)
 
FCultureRef GetCurrentAssetGroupCulture (const FName &InAssetGroupName) const
 
void ClearCurrentAssetGroupCulture (const FName &InAssetGroupName)
 
FCulturePtr GetCulture (const FString &InCultureName)
 
FCultureRef GetDefaultCulture () const
 
FCultureRef GetDefaultLanguage () const
 
FCultureRef GetDefaultLocale () const
 
FCultureRef GetInvariantCulture () const
 
TArray< FCultureRefGetCurrentCultures (const bool bIncludeLanguage, const bool bIncludeLocale, const bool bIncludeAssetGroups) const
 
void BackupCultureState (FCultureStateSnapshot &OutSnapshot) const
 
void RestoreCultureState (const FCultureStateSnapshot &InSnapshot)
 
bool IsInitialized () const
 
void LoadAllCultureData ()
 
void AddCustomCulture (const TSharedRef< ICustomCulture > &InCustomCulture)
 
FCulturePtr GetCustomCulture (const FString &InCultureName) const
 
bool IsCultureRemapped (const FString &Name, FString *OutMappedCulture)
 
bool IsCultureAllowed (const FString &Name)
 
void RefreshCultureDisplayNames (const TArray< FString > &InPrioritizedDisplayCultureNames)
 
void RefreshCachedConfigData ()
 
void GetCultureNames (TArray< FString > &CultureNames) const
 
TArray< FStringGetPrioritizedCultureNames (const FString &Name)
 
void GetCulturesWithAvailableLocalization (const TArray< FString > &InLocalizationPaths, TArray< FCultureRef > &OutAvailableCultures, const bool bIncludeDerivedCultures)
 
TArray< FCultureRefGetAvailableCultures (const TArray< FString > &InCultureNames, const bool bIncludeDerivedCultures)
 
FCultureChangedEventOnCultureChanged ()
 

Static Public Member Functions

static FInternationalizationGet ()
 
static bool IsAvailable ()
 
static void TearDown ()
 
static FText ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText (const TCHAR *InTextLiteral, const TCHAR *InNamespace, const TCHAR *InKey)
 

Private Types

typedef FLegacyInternationalization FImplementation
 

Private Member Functions

 FInternationalization ()
 
 ~FInternationalization ()
 
void BroadcastCultureChanged ()
 
void Initialize ()
 
void Terminate ()
 

Private Attributes

bool bIsInitialized = false
 
FCultureChangedEvent CultureChangedEvent
 
TUniqueObj< FImplementationImplementation
 
FCulturePtr CurrentLanguage
 
FCulturePtr CurrentLocale
 
TArray< TTuple< FName, FCulturePtr > > CurrentAssetGroupCultures
 
FCulturePtr DefaultLanguage
 
FCulturePtr DefaultLocale
 
FCulturePtr InvariantCulture
 
TArray< FCultureRefCustomCultures
 

Friends

class FTextChronoFormatter
 
class FLazySingleton
 
class FLegacyInternationalization
 

Detailed Description

Definition at line 23 of file Internationalization.h.

Member Typedef Documentation

◆ FImplementation

Constructor & Destructor Documentation

◆ FInternationalization()

FInternationalization::FInternationalization ( )
private

◆ ~FInternationalization()

FInternationalization::~FInternationalization ( )
private

Member Function Documentation

◆ AddCustomCulture()

void FInternationalization::AddCustomCulture ( const TSharedRef< ICustomCulture > & InCustomCulture)

Add a new custom culture

◆ BackupCultureState()

void FInternationalization::BackupCultureState ( FCultureStateSnapshot & OutSnapshot) const

Backup the current culture state to the given snapshot struct.

◆ BroadcastCultureChanged()

void FInternationalization::BroadcastCultureChanged ( )
inlineprivate

Definition at line 218 of file Internationalization.h.

◆ ClearCurrentAssetGroupCulture()

void FInternationalization::ClearCurrentAssetGroupCulture ( const FName & InAssetGroupName)

Clear the given asset group category culture.

◆ ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText()

static FText FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText ( const TCHAR * InTextLiteral,
const TCHAR * InNamespace,
const TCHAR * InKey )
static

◆ Get()

static FInternationalization & FInternationalization::Get ( )
static
+ Here is the caller graph for this function:

◆ GetAvailableCultures()

TArray< FCultureRef > FInternationalization::GetAvailableCultures ( const TArray< FString > & InCultureNames,
const bool bIncludeDerivedCultures )

Given some culture names, populate a list of cultures that are available to be used. If bIncludeDerivedCultures, include cultures that are derived from those we passed.

◆ GetCulture()

FCulturePtr FInternationalization::GetCulture ( const FString & InCultureName)

Get the culture corresponding to the given name.

Returns
The culture for the given name, or null if it couldn't be found.
+ Here is the caller graph for this function:

◆ GetCultureNames()

void FInternationalization::GetCultureNames ( TArray< FString > & CultureNames) const

◆ GetCulturesWithAvailableLocalization()

void FInternationalization::GetCulturesWithAvailableLocalization ( const TArray< FString > & InLocalizationPaths,
TArray< FCultureRef > & OutAvailableCultures,
const bool bIncludeDerivedCultures )

Given some paths to look at, populate a list of cultures that we have available localization information for. If bIncludeDerivedCultures, include cultures that are derived from those we have localization data for.

Note
This function was deprecated as it only provides cultures that use localization resources. FTextLocalizationManager::GetLocalizedCultureNames provides a more complete list when using alternate sources, and FInternationalization::GetAvailableCultures can be used to build a culture array from that list.

◆ GetCurrentAssetGroupCulture()

FCultureRef FInternationalization::GetCurrentAssetGroupCulture ( const FName & InAssetGroupName) const

Get the given asset group category culture.

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

◆ GetCurrentCulture()

FCultureRef FInternationalization::GetCurrentCulture ( ) const
inline

Get the current culture.

Note
This function exists for legacy API parity with SetCurrentCulture and is equivalent to GetCurrentLanguage. It should never be used in internal localization/internationalization code!

Definition at line 59 of file Internationalization.h.

◆ GetCurrentCultures()

TArray< FCultureRef > FInternationalization::GetCurrentCultures ( const bool bIncludeLanguage,
const bool bIncludeLocale,
const bool bIncludeAssetGroups ) const

Get the current cultures in use, optionally including the current language, locale, and any asset groups.

◆ GetCurrentLanguage()

FCultureRef FInternationalization::GetCurrentLanguage ( ) const
inline

Get the current language (for localization).

Definition at line 73 of file Internationalization.h.

◆ GetCurrentLocale()

FCultureRef FInternationalization::GetCurrentLocale ( ) const
inline

Get the current locale (for internationalization).

Definition at line 87 of file Internationalization.h.

◆ GetCustomCulture()

FCulturePtr FInternationalization::GetCustomCulture ( const FString & InCultureName) const

Get a new custom culture from its name

◆ GetDefaultCulture()

FCultureRef FInternationalization::GetDefaultCulture ( ) const
inline

Get the default culture specified by the OS.

Note
This function exists for legacy API parity with GetCurrentCulture and is equivalent to GetDefaultLanguage. It should never be used in internal localization/internationalization code!

Definition at line 123 of file Internationalization.h.

◆ GetDefaultLanguage()

FCultureRef FInternationalization::GetDefaultLanguage ( ) const
inline

Get the default language specified by the OS.

Definition at line 131 of file Internationalization.h.

◆ GetDefaultLocale()

FCultureRef FInternationalization::GetDefaultLocale ( ) const
inline

Get the default locale specified by the OS.

Definition at line 139 of file Internationalization.h.

◆ GetInvariantCulture()

FCultureRef FInternationalization::GetInvariantCulture ( ) const
inline

Get the invariant culture that can be used when you don't care about localization/internationalization.

Definition at line 147 of file Internationalization.h.

◆ GetPrioritizedCultureNames()

TArray< FString > FInternationalization::GetPrioritizedCultureNames ( const FString & Name)

◆ Initialize()

void FInternationalization::Initialize ( )
private

◆ IsAvailable()

static bool FInternationalization::IsAvailable ( )
static

Checks to see that an internationalization instance exists, and has been initialized. Usually you would use Get(), however this may be used to work out whether TearDown() has been called when cleaning up on shutdown.

◆ IsCultureAllowed()

bool FInternationalization::IsCultureAllowed ( const FString & Name)

Is the given culture enabled or disabled in this build?

◆ IsCultureRemapped()

bool FInternationalization::IsCultureRemapped ( const FString & Name,
FString * OutMappedCulture )

Has the given culture been remapped in this build?

◆ IsInitialized()

bool FInternationalization::IsInitialized ( ) const
inline

Definition at line 167 of file Internationalization.h.

◆ LoadAllCultureData()

void FInternationalization::LoadAllCultureData ( )

Load and cache the data needed for every culture we know about (this is usually done per-culture as required)

◆ OnCultureChanged()

FCultureChangedEvent & FInternationalization::OnCultureChanged ( )
inline

Broadcasts whenever the current culture changes

Definition at line 211 of file Internationalization.h.

◆ RefreshCachedConfigData()

void FInternationalization::RefreshCachedConfigData ( )

Refresh any config data that has been cached

◆ RefreshCultureDisplayNames()

void FInternationalization::RefreshCultureDisplayNames ( const TArray< FString > & InPrioritizedDisplayCultureNames)

Refresh the display names of the cached cultures

◆ RestoreCultureState()

void FInternationalization::RestoreCultureState ( const FCultureStateSnapshot & InSnapshot)

Restore a previous culture state from the given snapshot struct.

◆ SetCurrentAssetGroupCulture()

bool FInternationalization::SetCurrentAssetGroupCulture ( const FName & InAssetGroupName,
const FString & InCultureName )

Set the given asset group category culture by name.

◆ SetCurrentCulture()

bool FInternationalization::SetCurrentCulture ( const FString & InCultureName)

Set the current culture by name.

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.
SetCurrentCulture should be avoided in Core/Engine code as it may stomp over Editor/Game user-settings.

◆ SetCurrentLanguage()

bool FInternationalization::SetCurrentLanguage ( const FString & InCultureName)

Set only the current language (for localization) by name.

Note
Unless you're doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.

◆ SetCurrentLanguageAndLocale()

bool FInternationalization::SetCurrentLanguageAndLocale ( const FString & InCultureName)

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

◆ SetCurrentLocale()

bool FInternationalization::SetCurrentLocale ( const FString & InCultureName)

Set only the current locale (for internationalization) by name.

Note
Unless you're doing something advanced, you likely want SetCurrentLanguageAndLocale or SetCurrentCulture instead.

◆ TearDown()

static void FInternationalization::TearDown ( )
static

◆ Terminate()

void FInternationalization::Terminate ( )
private

Friends And Related Symbol Documentation

◆ FLazySingleton

Definition at line 216 of file Internationalization.h.

◆ FLegacyInternationalization

friend class FLegacyInternationalization
friend

Definition at line 232 of file Internationalization.h.

◆ FTextChronoFormatter

friend class FTextChronoFormatter
friend

Definition at line 25 of file Internationalization.h.

Member Data Documentation

◆ bIsInitialized

bool FInternationalization::bIsInitialized = false
private

Definition at line 224 of file Internationalization.h.

◆ CultureChangedEvent

FCultureChangedEvent FInternationalization::CultureChangedEvent
private

Definition at line 226 of file Internationalization.h.

◆ CurrentAssetGroupCultures

TArray<TTuple<FName, FCulturePtr> > FInternationalization::CurrentAssetGroupCultures
private

The currently active asset group cultures (for package localization).

Note
This is deliberately an array for performance reasons (we expect to have a very small number of groups).

Definition at line 251 of file Internationalization.h.

◆ CurrentLanguage

FCulturePtr FInternationalization::CurrentLanguage
private

The currently active language (for localization).

Definition at line 240 of file Internationalization.h.

◆ CurrentLocale

FCulturePtr FInternationalization::CurrentLocale
private

The currently active locale (for internationalization).

Definition at line 245 of file Internationalization.h.

◆ CustomCultures

TArray<FCultureRef> FInternationalization::CustomCultures
private

Custom cultures registered via AddCustomCulture.

Definition at line 271 of file Internationalization.h.

◆ DefaultLanguage

FCulturePtr FInternationalization::DefaultLanguage
private

The default language specified by the OS.

Definition at line 256 of file Internationalization.h.

◆ DefaultLocale

FCulturePtr FInternationalization::DefaultLocale
private

The default locale specified by the OS.

Definition at line 261 of file Internationalization.h.

◆ Implementation

TUniqueObj<FImplementation> FInternationalization::Implementation
private

Definition at line 235 of file Internationalization.h.

◆ InvariantCulture

FCulturePtr FInternationalization::InvariantCulture
private

An invariant culture that can be used when you don't care about localization/internationalization.

Definition at line 266 of file Internationalization.h.


The documentation for this class was generated from the following file: