Files
UnrealEngineUWP/Engine/Source/Developer/Localization/Public/TextLocalizationResourceGenerator.h
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

45 lines
2.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/EnumClassFlags.h"
#include "Internationalization/TextKey.h"
class FLocTextHelper;
class FTextLocalizationMetaDataResource;
class FTextLocalizationResource;
enum class EGenerateLocResFlags : uint8
{
/** No special behavior */
None = 0,
/** Should "stale" translations (translations that were made against different source text) still be used? */
AllowStaleTranslations = 1<<0,
/** Validate that format patterns are valid for the culture being compiled (eg, detect invalid plural rules or broken syntax) */
ValidateFormatPatterns = 1<<1,
/** Validate that text doesn't contain any unsafe whitespace (leading or trailing whitespace) that could get lost during the translation process */
ValidateSafeWhitespace = 1<<2,
};
ENUM_CLASS_FLAGS(EGenerateLocResFlags);
/** Utility functions for generating compiled LocMeta (Localization MetaData Resource) and LocRes (Localization Resource) files from source localization data */
class FTextLocalizationResourceGenerator
{
public:
/**
* Given a loc text helper, generate a compiled LocMeta resource.
*/
LOCALIZATION_API static bool GenerateLocMeta(const FLocTextHelper& InLocTextHelper, const FString& InResourceName, FTextLocalizationMetaDataResource& OutLocMeta);
/**
* Given a loc text helper, generate a compiled LocRes resource for the given culture.
*/
LOCALIZATION_API static bool GenerateLocRes(const FLocTextHelper& InLocTextHelper, const FString& InCultureToGenerate, const EGenerateLocResFlags InGenerateFlags, const FTextKey& InLocResID, FTextLocalizationResource& OutPlatformAgnosticLocRes, TMap<FName, TSharedRef<FTextLocalizationResource>>& OutPerPlatformLocRes, const int32 InPriority = 0);
/**
* Given a config file, generate a compiled LocRes resource for the active culture and use it to update the live-entries in the localization manager.
*/
LOCALIZATION_API static bool GenerateLocResAndUpdateLiveEntriesFromConfig(const FString& InConfigFilePath, const EGenerateLocResFlags InGenerateFlags);
};