2014-04-02 18:09:23 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "InternationalizationSettingsModulePrivatePCH.h"
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
/* UInternationalizationSettingsModel interface
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
UInternationalizationSettingsModel::UInternationalizationSettingsModel( const class FPostConstructInitializeProperties& PCIP )
|
|
|
|
|
: Super(PCIP)
|
2014-06-12 23:22:18 -04:00
|
|
|
{ }
|
|
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
|
|
|
|
|
void UInternationalizationSettingsModel::SaveDefaults()
|
|
|
|
|
{
|
|
|
|
|
FString SavedCultureName;
|
|
|
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEditorGameAgnosticIni );
|
|
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEngineIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
|
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorGameAgnosticIni );
|
|
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
2014-04-02 18:09:23 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
void UInternationalizationSettingsModel::ResetToDefault()
|
|
|
|
|
{
|
|
|
|
|
FString SavedCultureName;
|
|
|
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEngineIni );
|
|
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEditorGameAgnosticIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
|
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
|
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorGameAgnosticIni );
|
|
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
SettingChangedEvent.Broadcast();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
void UInternationalizationSettingsModel::SetCultureName(const FString& CultureName)
|
|
|
|
|
{
|
|
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *CultureName, GEditorGameAgnosticIni );
|
|
|
|
|
SettingChangedEvent.Broadcast();
|
2014-04-23 17:36:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-23 17:36:48 -04:00
|
|
|
void UInternationalizationSettingsModel::ShouldLoadLocalizedPropertyNames(const bool Value)
|
|
|
|
|
{
|
|
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), Value, GEditorGameAgnosticIni );
|
|
|
|
|
SettingChangedEvent.Broadcast();
|
2014-06-12 23:22:18 -04:00
|
|
|
}
|