Navigation
API > API/Developer > API/Developer/Localization
References
| Module | Localization |
| Header | /Engine/Source/Developer/Localization/Public/LocTextHelper.h |
| Include | #include "LocTextHelper.h" |
Syntax
class FLocTextHelper
Remarks
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).
Constructors
| Type | Name | Description | |
|---|---|---|---|
FLocTextHelper
(
FString InTargetName, |
Construct an empty helper. | ||
FLocTextHelper
(
FString InTargetPath, |
Construct a helper for the given target information. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddConflict
(
const FLocKey& InNamespace, |
Add a new conflict entry. | |
| bool | AddDependency
(
const FString& InDependencyFilePath, |
Attempt to add a manifest dependency. | |
| bool | AddSourceText
(
const FLocKey& InNamespace, |
Add a new source text entry to the manifest. | |
| bool | AddTranslation
(
const FString& InCulture, |
Add a new translation to the given archive. | |
| bool | AddTranslation
(
const FString& InCulture, |
Add a new translation to the given archive. | |
| void | EnumerateSourceTexts
(
const FEnumerateSourceTextsFuncPtr& InCallback, |
||
| void | EnumerateTranslations
(
const FString& InCulture, |
||
| TSharedPtr< FManifestEntry > | FindDependencyEntry
(
const FLocKey& InNamespace, |
Find an dependency entry using its namespace and key. | |
| TSharedPtr< FManifestEntry > | FindDependencyEntry
(
const FLocKey& InNamespace, |
Find an existing dependency entry using its namespace and context. | |
| 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. | |
| bool | FindKeysForLegacyTranslation
(
const FString& InCulture, |
Given a culture, try and find all the keys that the source string should use by checking the manifest. | |
| TSharedPtr< FManifestEntry > | FindSourceText
(
const FLocKey& InNamespace, |
Find an existing source text entry using its namespace and key. | |
| TSharedPtr< FManifestEntry > | FindSourceText
(
const FLocKey& InNamespace, |
Find an existing source text entry using its namespace and context. | |
| TSharedPtr< FArchiveEntry > | FindTranslation
(
const FString& InCulture, |
Find an existing translation entry from its source text. | |
| TArray< FString > | GetAllCultures
(
const bool bSingleCultureMode |
||
| FString | Get a conflict report that can be easily saved as a report summary. | ||
| const FString & | |||
| void | GetExportText
(
const FString& InCulture, |
Given some source text, work out which text should be exported (eg, when exporting to PO). | |
| const TArray< FString > & | |||
| TSharedPtr< ILocFileNotifies > | |||
| const FString & | |||
| ELocTextPlatformSplitMode | How are we splitting localization data per-platform? | ||
| const TArray< FString > & | Get the platforms names that should be split, based on the active split mode. | ||
| void | GetRuntimeText
(
const FString& InCulture, |
Given some source text, work out which text is our current "best" translation (eg, when compiling to LocRes). | |
| const FString & | |||
| const FString & | |||
| FLocTextWordCounts | GetWordCountReport
(
const FDateTime& InTimestamp, |
Get a word count report for the current state of the manifest and archives. | |
| bool | HasArchive
(
const FString& InCulture |
Check to see whether we've loaded the given archive (native or foreign). | |
| bool | HasForeignArchive
(
const FString& InCulture |
Check to see whether we've loaded the given foreign archive. | |
| bool | HasManifest () |
Check to see whether we've loaded the manifest. | |
| bool | Check to see whether we've loaded the native archive. | ||
| bool | ImportTranslation
(
const FString& InCulture, |
Import a previously exported translation (generated using GetExportText) back into the archive. | |
| bool | LoadAll
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the manifest and all archive files specified during construction. | |
| bool | LoadAllArchives
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) all archive files. | |
| bool | LoadArchive
(
const FString& InCulture, |
Attempt to load (or create) an archive file (native or foreign). | |
| bool | LoadArchive
(
const FString& InCulture, |
Attempt to load (or create) an foreign file (native or foreign) from the given file path. | |
| bool | LoadForeignArchive
(
const FString& InCulture, |
Attempt to load (or create) a foreign archive file from the given file path. | |
| bool | LoadForeignArchive
(
const FString& InCulture, |
Attempt to load (or create) a foreign archive file. | |
| bool | LoadManifest
(
const FString& InManifestFilePath, |
Attempt to load (or create) the manifest file from the given file path. | |
| bool | LoadManifest
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the manifest file. | |
| bool | LoadNativeArchive
(
const ELocTextHelperLoadFlags InLoadFlags, |
Attempt to load (or create) the native archive file. | |
| bool | LoadNativeArchive
(
const FString& InArchiveFilePath, |
Attempt to load (or create) the native archive file from the given file path. | |
| FString | SanitizeLogOutput
(
FStringView InString |
Sanitize any output from the given string that may cause the build machine to generate erroneous errors. | |
| FString | SanitizeLogOutput
(
FString&& InString |
||
| bool | SaveAll
(
FText* OutError |
Attempt to save the manifest and all archive files specified during construction. | |
| bool | SaveAllArchives
(
FText* OutError |
Attempt to save all (native and foreign) archive files. | |
| bool | SaveArchive
(
const FString& InCulture, |
Attempt to save an archive file (native or foreign). | |
| bool | SaveArchive
(
const FString& InCulture, |
Attempt to save an archive file (native or foreign) to the given file path. | |
| bool | SaveConflictReport
(
const FString& InReportFilePath, |
Save the conflict report summary to disk. | |
| bool | SaveForeignArchive
(
const FString& InCulture, |
Attempt to save a foreign archive file to the given file path. | |
| bool | SaveForeignArchive
(
const FString& InCulture, |
Attempt to save a foreign archive file. | |
| bool | SaveManifest
(
const FString& InManifestFilePath, |
Attempt to save the manifest file to the given file path. | |
| bool | SaveManifest
(
FText* OutError |
Attempt to save the manifest file. | |
| bool | SaveNativeArchive
(
FText* OutError |
Attempt to save the native archive file. | |
| bool | SaveNativeArchive
(
const FString& InArchiveFilePath, |
Attempt to save the native archive file to the given file path. | |
| bool | SaveWordCountReport
(
const FDateTime& InTimestamp, |
Save the word count report for the current state of the manifest and archives to disk. | |
| bool | SerializeManifestToJson
(
TSharedRef< FJsonObject > JsonObject |
Attempt to serialize the entire manifest to an input json object | |
| void | SetCopyrightNotice
(
const FString& InCopyrightNotice |
Set the optional copyright notice to insert into files that support it. | |
| bool | Are we splitting localization data per-platform? | ||
| void | TrimArchive
(
const FString& InCulture |
Trim the given archive by remove any entries that no longer exist in the manifest. | |
| void | TrimManifest () |
Trim the currently loaded manifest by remove all dependency entries from it. | |
| void | UpdateSourceText
(
const TSharedRef< FManifestEntry >& InOldEntry, |
Update an existing source text entry in the manifest. | |
| void | UpdateTranslation
(
const FString& InCulture, |
Update an existing translation in the given archive. | |
| bool | UpdateTranslation
(
const FString& InCulture, |
Update an existing translation in the given archive. |
Typedefs
| Name | Description |
|---|---|
| FEnumerateSourceTextsFuncPtr | Enumerate all the source texts in the manifest, optionally skipping those entries from a dependent manifest. |
| FEnumerateTranslationsFuncPtr | Enumerate all the translations for the given culture. |