You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#ttp 331251 - L10N: Editor: Tooltips and Property Names need to be localized [CL 2040155 by Saul Abreu in Main branch]
72 lines
3.2 KiB
C++
72 lines
3.2 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
Settings.cpp: Implements the constructors for the various settings classes.
|
|
=============================================================================*/
|
|
|
|
#include "InternationalizationSettingsModulePrivatePCH.h"
|
|
|
|
/* UInternationalizationSettingsModel interface
|
|
*****************************************************************************/
|
|
|
|
UInternationalizationSettingsModel::UInternationalizationSettingsModel( const class FPostConstructInitializeProperties& PCIP )
|
|
: Super(PCIP)
|
|
{
|
|
}
|
|
|
|
void UInternationalizationSettingsModel::SaveDefaults()
|
|
{
|
|
FString SavedCultureName;
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEditorGameAgnosticIni );
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEngineIni );
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorGameAgnosticIni );
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
|
}
|
|
|
|
void UInternationalizationSettingsModel::ResetToDefault()
|
|
{
|
|
FString SavedCultureName;
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEngineIni );
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEditorGameAgnosticIni );
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorGameAgnosticIni );
|
|
|
|
SettingChangedEvent.Broadcast();
|
|
}
|
|
|
|
FString UInternationalizationSettingsModel::GetCultureName() const
|
|
{
|
|
FString SavedCultureName;
|
|
if( !GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEditorGameAgnosticIni ) )
|
|
{
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEngineIni );
|
|
}
|
|
return SavedCultureName;
|
|
}
|
|
|
|
void UInternationalizationSettingsModel::SetCultureName(const FString& CultureName)
|
|
{
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *CultureName, GEditorGameAgnosticIni );
|
|
SettingChangedEvent.Broadcast();
|
|
}
|
|
|
|
|
|
bool UInternationalizationSettingsModel::ShouldLoadLocalizedPropertyNames() const
|
|
{
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
if( !GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorGameAgnosticIni ) )
|
|
{
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
|
}
|
|
return bShouldLoadLocalizedPropertyNames;
|
|
}
|
|
|
|
void UInternationalizationSettingsModel::ShouldLoadLocalizedPropertyNames(const bool Value)
|
|
{
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), Value, GEditorGameAgnosticIni );
|
|
SettingChangedEvent.Broadcast();
|
|
} |