Singleton class that manages display strings for FText. 更多...
#include <TextLocalizationManager.h>
Public 成员函数 | |
| bool | AddDisplayString (const FTextDisplayStringRef &DisplayString, const FTextKey &Namespace, const FTextKey &Key) |
| Attempts to register the specified display string, associating it with the specified namespace and key. 更多... | |
| FTextDisplayStringPtr | FindDisplayString (const FTextKey &Namespace, const FTextKey &Key, const FString *const SourceString=nullptr) |
| Finds and returns the display string with the given namespace and key, if it exists. 更多... | |
| bool | FindNamespaceAndKeyFromDisplayString (const FTextDisplayStringRef &InDisplayString, FString &OutNamespace, FString &OutKey) |
| Finds the namespace and key associated with the specified display string. 更多... | |
| bool | FindNamespaceAndKeyFromDisplayString (const FTextDisplayStringRef &InDisplayString, FTextKey &OutNamespace, FTextKey &OutKey) |
| Finds the namespace and key associated with the specified display string. 更多... | |
| FTextDisplayStringRef | GetDisplayString (const FTextKey &Namespace, const FTextKey &Key, const FString *const SourceString) |
| Returns a display string with the given namespace and key. 更多... | |
| TArray< FString > | GetLocalizedCultureNames (const ELocalizationLoadFlags InLoadFlags) const |
| Get a list of culture names that we have localized resource data for (ELocalizationLoadFlags controls which resources should be checked). | |
| uint16 | GetLocalRevisionForDisplayString (const FTextDisplayStringRef &InDisplayString) |
| Attempts to find a local revision history for the given display string. 更多... | |
| FString | GetNativeCultureName (const ELocalizedTextSourceCategory InCategory) const |
| Given a localization category, get the native culture for the category (if known). 更多... | |
| FString | GetRequestedLanguageName () const |
| Get the language that will be requested during localization initialization, based on the hierarchy of: command line -> configs -> OS default. | |
| FString | GetRequestedLocaleName () const |
| Get the locale that will be requested during localization initialization, based on the hierarchy of: command line -> configs -> OS default. | |
| uint16 | GetTextRevision () const |
| Returns the current text revision number. 更多... | |
| void | RefreshResources () |
| Reloads resources for the current culture. | |
| void | RegisterPolyglotTextData (const FPolyglotTextData &InPolyglotTextData, const bool InAddDisplayString=true) |
| Register a polyglot text data with the text localization manager. | |
| void | RegisterTextSource (const TSharedRef< ILocalizedTextSource > &InLocalizedTextSource, const bool InRefreshResources=true) |
| Register a localized text source with the text localization manager. | |
| bool | UpdateDisplayString (const FTextDisplayStringRef &DisplayString, const FString &Value, const FTextKey &Namespace, const FTextKey &Key) |
| Updates the underlying value of a display string and associates it with a specified namespace and key, then returns true. 更多... | |
| void | UpdateFromLocalizationResource (const FString &LocalizationResourceFilePath) |
| Updates display string entries and adds new display string entries based on localizations found in a specified localization resource. | |
静态 Public 成员函数 | |
| static FTextLocalizationManager & | Get () |
| Singleton accessor | |
Public 属性 | |
| FTextRevisionChangedEvent | OnTextRevisionChangedEvent |
| Event type for immediately reacting to changes in display strings for text. | |
友元 | |
| class | FLazySingleton |
Singleton class that manages display strings for FText.
| bool FTextLocalizationManager::AddDisplayString | ( | const FTextDisplayStringRef & | DisplayString, |
| const FTextKey & | Namespace, | ||
| const FTextKey & | Key | ||
| ) |
Attempts to register the specified display string, associating it with the specified namespace and key.
Returns true if the display string has been or was already associated with the namespace and key. Returns false if the display string was already associated with another namespace and key or the namespace and key are already in use by another display string.
| FTextDisplayStringPtr FTextLocalizationManager::FindDisplayString | ( | const FTextKey & | Namespace, |
| const FTextKey & | Key, | ||
| const FString *const | SourceString = nullptr |
||
| ) |
Finds and returns the display string with the given namespace and key, if it exists.
Additionally, if a source string is specified and the found localized display string was not localized from that source string, null will be returned.
| bool FTextLocalizationManager::FindNamespaceAndKeyFromDisplayString | ( | const FTextDisplayStringRef & | InDisplayString, |
| FString & | OutNamespace, | ||
| FString & | OutKey | ||
| ) |
Finds the namespace and key associated with the specified display string.
Returns true if found and sets the out parameters. Otherwise, returns false.
| bool FTextLocalizationManager::FindNamespaceAndKeyFromDisplayString | ( | const FTextDisplayStringRef & | InDisplayString, |
| FTextKey & | OutNamespace, | ||
| FTextKey & | OutKey | ||
| ) |
Finds the namespace and key associated with the specified display string.
Returns true if found and sets the out parameters. Otherwise, returns false.
| FTextDisplayStringRef FTextLocalizationManager::GetDisplayString | ( | const FTextKey & | Namespace, |
| const FTextKey & | Key, | ||
| const FString *const | SourceString | ||
| ) |
Returns a display string with the given namespace and key.
If no display string exists, it will be created using the source string or an empty string if no source string is provided. If a display string exists ... ... but it was not localized from the specified source string, the display string will be set to the specified source and returned. ... and it was localized from the specified source string (or none was provided), the display string will be returned.
| uint16 FTextLocalizationManager::GetLocalRevisionForDisplayString | ( | const FTextDisplayStringRef & | InDisplayString | ) |
Attempts to find a local revision history for the given display string.
This will only be set if the display string has been changed since the localization manager version has been changed (eg, if it has been edited while keeping the same key).
| FString FTextLocalizationManager::GetNativeCultureName | ( | const ELocalizedTextSourceCategory | InCategory | ) | const |
Given a localization category, get the native culture for the category (if known).
|
inline |
Returns the current text revision number.
This value can be cached when caching information from the text localization manager. If the revision does not match, cached information may be invalid and should be recached.
| bool FTextLocalizationManager::UpdateDisplayString | ( | const FTextDisplayStringRef & | DisplayString, |
| const FString & | Value, | ||
| const FTextKey & | Namespace, | ||
| const FTextKey & | Key | ||
| ) |
Updates the underlying value of a display string and associates it with a specified namespace and key, then returns true.
If the namespace and key are already in use by another display string, no changes occur and false is returned.