2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2014-05-29 17:11:10 -04:00
|
|
|
#include "Commandlets/Commandlet.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "GenerateTextLocalizationReportCommandlet.generated.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class UGenerateTextLocalizationReportCommandlet : public UGatherTextCommandletBase
|
|
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_UCLASS_BODY()
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Begin UCommandlet Interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual int32 Main(const FString& Params) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End UCommandlet Interface
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Calculates the number of words found in a given string.
|
|
|
|
|
* @param Text - The string to examine.
|
|
|
|
|
* @return Number of words found.
|
|
|
|
|
*/
|
|
|
|
|
int32 CountWords( const FString& Text ) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Collects word count info and writes out a report.
|
|
|
|
|
* @param SourcePath - Source path to localization files.
|
|
|
|
|
* @param DestinationPath - The destination folder the report will be write to.
|
|
|
|
|
* @return True if successful; false oterwise.
|
|
|
|
|
*/
|
|
|
|
|
bool ProcessWordCountReport(const FString& SourcePath, const FString& DestinationPath);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Writes out a report representing localization conflicts. These are conflicts where the namespace
|
|
|
|
|
* and key match but the source text differs.
|
|
|
|
|
* @param DestinationPath - The destination folder the report will be write to.
|
|
|
|
|
* @return True if successful; false oterwise.
|
|
|
|
|
*/
|
|
|
|
|
bool ProcessConflictReport(const FString& DestinationPath);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
FString GatherTextConfigPath;
|
|
|
|
|
FString SectionName;
|
|
|
|
|
FString CmdlineTimeStamp;
|
|
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
};
|