2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-04-02 18:09:23 -04:00
|
|
|
|
|
|
|
|
#include "InternationalizationSettingsModulePrivatePCH.h"
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
/* UInternationalizationSettingsModel interface
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UInternationalizationSettingsModel::UInternationalizationSettingsModel( const FObjectInitializer& ObjectInitializer )
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-06-12 23:22:18 -04:00
|
|
|
{ }
|
|
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
|
|
|
|
|
void UInternationalizationSettingsModel::SaveDefaults()
|
|
|
|
|
{
|
|
|
|
|
FString SavedCultureName;
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEditorSettingsIni );
|
2014-04-02 18:09:23 -04:00
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEngineIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
|
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorSettingsIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
2015-04-10 14:37:56 -04:00
|
|
|
|
|
|
|
|
bool bShowNodesAndPinsUnlocalized = false;
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEditorSettingsIni );
|
2015-04-10 14:37:56 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, 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 );
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEditorSettingsIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
|
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
|
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEngineIni );
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorSettingsIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
|
2015-04-10 14:37:56 -04:00
|
|
|
bool bShowNodesAndPinsUnlocalized = false;
|
|
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEngineIni );
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEditorSettingsIni );
|
2015-04-10 14:37:56 -04:00
|
|
|
|
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;
|
2015-04-20 10:12:55 -04:00
|
|
|
if( !GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEditorSettingsIni ) )
|
2014-04-02 18:09:23 -04:00
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
{
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *CultureName, GEditorSettingsIni );
|
2014-04-02 18:09:23 -04:00
|
|
|
SettingChangedEvent.Broadcast();
|
2014-04-23 17:36:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool UInternationalizationSettingsModel::ShouldLoadLocalizedPropertyNames() const
|
|
|
|
|
{
|
|
|
|
|
bool bShouldLoadLocalizedPropertyNames = true;
|
2015-04-20 10:12:55 -04:00
|
|
|
if( !GConfig->GetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), bShouldLoadLocalizedPropertyNames, GEditorSettingsIni ) )
|
2014-04-23 17:36:48 -04:00
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
{
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldLoadLocalizedPropertyNames"), Value, GEditorSettingsIni );
|
2014-04-23 17:36:48 -04:00
|
|
|
SettingChangedEvent.Broadcast();
|
2014-06-12 23:22:18 -04:00
|
|
|
}
|
2015-04-10 14:37:56 -04:00
|
|
|
|
|
|
|
|
bool UInternationalizationSettingsModel::ShouldShowNodesAndPinsUnlocalized() const
|
|
|
|
|
{
|
|
|
|
|
bool bShowNodesAndPinsUnlocalized = false;
|
2015-04-20 10:12:55 -04:00
|
|
|
if( !GConfig->GetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEditorSettingsIni ) )
|
2015-04-10 14:37:56 -04:00
|
|
|
{
|
|
|
|
|
GConfig->GetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEngineIni );
|
|
|
|
|
}
|
|
|
|
|
return bShowNodesAndPinsUnlocalized;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UInternationalizationSettingsModel::ShouldShowNodesAndPinsUnlocalized(const bool Value)
|
|
|
|
|
{
|
2015-04-20 10:12:55 -04:00
|
|
|
GConfig->SetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), Value, GEditorSettingsIni );
|
2015-04-10 14:37:56 -04:00
|
|
|
}
|