Navigation
API > API/Developer > API/Developer/Localization
High-level access to the non-compiled localization resources (manifests and archives) in a way that abstracts some of their quirks. Each instance gives access to a single localization target consisting of a single manifest and several archives (a native archive, and one for each foreign culture).
| Name | FLocTextHelper |
| Type | class |
| Header File | /Engine/Source/Developer/Localization/Public/LocTextHelper.h |
| Include Path | #include "LocTextHelper.h" |
Syntax
class FLocTextHelper
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLocTextHelper
(
FString InTargetPath, |
Construct a helper for the given target information. | LocTextHelper.h | |
FLocTextHelper
(
const FLocTextHelper& |
Non-copyable | LocTextHelper.h | |
FLocTextHelper
(
FString InTargetName, |
Construct an empty helper. | LocTextHelper.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FEnumerateSourceTextsFuncPtr | TFunctionRef< bool(TSharedRef< FManifestEntry >)> | Enumerate all the source texts in the manifest, optionally skipping those entries from a dependent manifest. | LocTextHelper.h |
| FEnumerateTranslationsFuncPtr | TFunctionRef< bool(TSharedRef< FArchiveEntry >)> | Enumerate all the translations for the given culture. | LocTextHelper.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ArchiveName | FString | Name given to the archive files for this target (eg, Game.archive) | LocTextHelper.h | |
| Archives | TMap< FString, TSharedPtr< FInternationalizationArchive > > | Loaded archives | LocTextHelper.h | |
| ConflictTracker | FLocTextConflicts | Conflict tracker instance | LocTextHelper.h | |
| CopyrightNotice | FString | Optional copyright notice to insert into files that support it | LocTextHelper.h | |
| Dependencies | TArray< TSharedPtr< FInternationalizationManifest > > | LocTextHelper.h | ||
| DependencyPaths | TArray< FString > | Loaded dependencies | LocTextHelper.h | |
| ForeignCultures | TArray< FString > | Array of culture codes for the foreign cultures (does not include the native culture) | LocTextHelper.h | |
| LocFileNotifies | TSharedPtr< ILocFileNotifies > | Interface for allowing source control integration (may be null) | LocTextHelper.h | |
| Manifest | TSharedPtr< FInternationalizationManifest > | Loaded manifest | LocTextHelper.h | |
| ManifestName | FString | Name given to the manifest file for this target (eg, Game.manifest) | LocTextHelper.h | |
| NativeCulture | FString | Culture code of the native culture (eg, en), or an empty string if the native culture is unknown | LocTextHelper.h | |
| PlatformSplitMode | ELocTextPlatformSplitMode | How are we splitting localization data per-platform? | LocTextHelper.h | |
| TargetName | FString | The name of the target we're working with | LocTextHelper.h | |
| TargetPath | FString | The path to the localization target (the root of this path should contain the manifest, and the archives should be under culture code directories) | LocTextHelper.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddConflict
(
const FLocKey& InNamespace, |
Add a new conflict entry. | LocTextHelper.h | |
| Attempt to add a manifest dependency. | LocTextHelper.h | ||
bool AddSourceText
(
const FLocKey& InNamespace, |
Add a new source text entry to the manifest. | LocTextHelper.h | |
bool AddTranslation
(
const FString& InCulture, |
Add a new translation to the given archive. | LocTextHelper.h | |
bool AddTranslation
(
const FString& InCulture, |
Add a new translation to the given archive. | LocTextHelper.h | |
void EnumerateSourceTexts
(
const FEnumerateSourceTextsFuncPtr& InCallback, |
LocTextHelper.h | ||
void EnumerateSourceTextsParallel
(
const FEnumerateSourceTextsFuncPtr& InCallback, |
Enumerate in parallel all the source texts in the manifest, optionally skipping those entries from a dependent manifest. | LocTextHelper.h | |
void EnumerateTranslations
(
const FString& InCulture, |
LocTextHelper.h | ||
TSharedPtr< FManifestEntry > FindDependencyEntry
(
const FLocKey& InNamespace, |
Find an existing dependency entry using its namespace and context. | LocTextHelper.h | |
TSharedPtr< FManifestEntry > FindDependencyEntry
(
const FLocKey& InNamespace, |
Find an dependency entry using its namespace and key. | LocTextHelper.h | |
bool FindKeysForLegacyTranslation
(
const FString& InCulture, |
Given a culture, try and find all the keys that the source string should use by checking the manifest. | LocTextHelper.h | |
TSharedPtr< FManifestEntry > FindSourceText
(
const FLocKey& InNamespace, |
Find an existing source text entry using its namespace and key. | LocTextHelper.h | |
TSharedPtr< FManifestEntry > FindSourceText
(
const FLocKey& InNamespace, |
Find an existing source text entry using its namespace and context. | LocTextHelper.h | |
TSharedPtr< FArchiveEntry > FindTranslation
(
const FString& InCulture, |
Find an existing translation entry from its source text. | LocTextHelper.h | |
| LocTextHelper.h | |||
FString GetConflictReport() |
Get a conflict report that can be easily saved as a report summary. | LocTextHelper.h | |
const FString & GetCopyrightNotice() |
LocTextHelper.h | ||
void GetExportText
(
const FString& InCulture, |
Given some source text, work out which text should be exported (eg, when exporting to PO). | LocTextHelper.h | |
| LocTextHelper.h | |||
TSharedPtr< ILocFileNotifies > GetLocFileNotifies() |
LocTextHelper.h | ||
const FString & GetNativeCulture() |
LocTextHelper.h | ||
ELocTextPlatformSplitMode GetPlatformSplitMode() |
How are we splitting localization data per-platform? | LocTextHelper.h | |
| Get the platforms names that should be split, based on the active split mode. | LocTextHelper.h | ||
void GetRuntimeText
(
const FString& InCulture, |
Given some source text, work out which text is our current "best" translation (eg, when compiling to LocRes). | LocTextHelper.h | |
const FString & GetTargetName() |
LocTextHelper.h | ||
const FString & GetTargetPath() |
LocTextHelper.h | ||
FLocTextWordCounts GetWordCountReport
(
const FDateTime& InTimestamp, |
Get a word count report for the current state of the manifest and archives. | LocTextHelper.h | |
bool HasArchive
(
const FString& InCulture |
Check to see whether we've loaded the given archive (native or foreign). | LocTextHelper.h | |
bool HasForeignArchive
(
const FString& InCulture |
Check to see whether we've loaded the given foreign archive. | LocTextHelper.h | |
bool HasManifest() |
Check to see whether we've loaded the manifest. | LocTextHelper.h | |
bool HasNativeArchive() |
Check to see whether we've loaded the native archive. | LocTextHelper.h | |
bool ImportTranslation
(
const FString& InCulture, |
Import a previously exported translation (generated using GetExportText) back into the archive. | LocTextHelper.h | |
bool LoadAll
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the manifest and all archive files specified during construction. | LocTextHelper.h | |
bool LoadAllArchives
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) all archive files. | LocTextHelper.h | |
bool LoadArchive
(
const FString& InCulture, |
Attempt to load (or create) an foreign file (native or foreign) from the given file path. | LocTextHelper.h | |
bool LoadArchive
(
const FString& InCulture, |
Attempt to load (or create) an archive file (native or foreign). | LocTextHelper.h | |
bool LoadForeignArchive
(
const FString& InCulture, |
Attempt to load (or create) a foreign archive file from the given file path. | LocTextHelper.h | |
bool LoadForeignArchive
(
const FString& InCulture, |
Attempt to load (or create) a foreign archive file. | LocTextHelper.h | |
bool LoadManifest
(
const FString& InManifestFilePath, |
Attempt to load (or create) the manifest file from the given file path. | LocTextHelper.h | |
bool LoadManifest
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the manifest file. | LocTextHelper.h | |
bool LoadNativeArchive
(
const FString& InArchiveFilePath, |
Attempt to load (or create) the native archive file from the given file path. | LocTextHelper.h | |
bool LoadNativeArchive
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the native archive file. | LocTextHelper.h | |
bool SaveAll
(
FText* OutError |
Attempt to save the manifest and all archive files specified during construction. | LocTextHelper.h | |
bool SaveAllArchives
(
FText* OutError |
Attempt to save all (native and foreign) archive files. | LocTextHelper.h | |
bool SaveArchive
(
const FString& InCulture, |
Attempt to save an archive file (native or foreign) to the given file path. | LocTextHelper.h | |
bool SaveArchive
(
const FString& InCulture, |
Attempt to save an archive file (native or foreign). | LocTextHelper.h | |
bool SaveConflictReport
(
const FString& InReportFilePath, |
Save the conflict report summary to disk. | LocTextHelper.h | |
bool SaveForeignArchive
(
const FString& InCulture, |
Attempt to save a foreign archive file. | LocTextHelper.h | |
bool SaveForeignArchive
(
const FString& InCulture, |
Attempt to save a foreign archive file to the given file path. | LocTextHelper.h | |
bool SaveManifest
(
FText* OutError |
Attempt to save the manifest file. | LocTextHelper.h | |
bool SaveManifest
(
const FString& InManifestFilePath, |
Attempt to save the manifest file to the given file path. | LocTextHelper.h | |
bool SaveNativeArchive
(
FText* OutError |
Attempt to save the native archive file. | LocTextHelper.h | |
bool SaveNativeArchive
(
const FString& InArchiveFilePath, |
Attempt to save the native archive file to the given file path. | LocTextHelper.h | |
| Save the word count report for the current state of the manifest and archives to disk. | LocTextHelper.h | ||
void SetCopyrightNotice
(
const FString& InCopyrightNotice |
Set the optional copyright notice to insert into files that support it. | LocTextHelper.h | |
bool ShouldSplitPlatformData() |
Are we splitting localization data per-platform? | LocTextHelper.h | |
void SortManifest() |
Sort the currently loaded manifest into a deterministic order (as if it had been serialized and then deserialized from JSON). | LocTextHelper.h | |
void TrimArchive
(
const FString& InCulture |
Trim the given archive by remove any entries that no longer exist in the manifest. | LocTextHelper.h | |
void TrimManifest() |
Trim the currently loaded manifest by remove all dependency entries from it. | LocTextHelper.h | |
void UpdateSourceText
(
const TSharedRef< FManifestEntry >& InOldEntry, |
Update an existing source text entry in the manifest. | LocTextHelper.h | |
void UpdateTranslation
(
const FString& InCulture, |
Update an existing translation in the given archive. | LocTextHelper.h | |
bool UpdateTranslation
(
const FString& InCulture, |
Update an existing translation in the given archive. | LocTextHelper.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool FindKeysForLegacyTranslation
(
const TSharedRef< const FInternationalizationManifest >& InManifest, |
Given a manifest and (optional) native archive, try and find all the keys that the source string should use by checking the manifest. | LocTextHelper.h | |
static FString SanitizeLogOutput
(
FStringView InString |
Sanitize any output from the given string that may cause the build machine to generate erroneous errors. | LocTextHelper.h | |
static FString SanitizeLogOutput
(
FString&& InString |
LocTextHelper.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLocTextHelper & operator=
(
const FLocTextHelper& |
LocTextHelper.h |