diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index 6ea648a5b26..50a365b7492 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -695,13 +695,7 @@ protected DynamoModel(IStartConfiguration config) PreferenceSettings = (PreferenceSettings)CreateOrLoadPreferences(config.Preferences); if (PreferenceSettings != null) { - // Setting the locale for Dynamo from loaded Preferences only when - // In a non-in-process integration case (when HostAnalyticsInfo.HostName is unspecified) - // Language is specified, otherwise Default setting means following host locale - if (string.IsNullOrEmpty(HostAnalyticsInfo.HostName) || !PreferenceSettings.Locale.Equals(Configuration.Configurations.SupportedLocaleList.First())) - { - SetUICulture(PreferenceSettings.Locale); - } + SetUICulture(PreferenceSettings.Locale); PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged; PreferenceSettings.MessageLogged += LogMessage; } @@ -2723,8 +2717,23 @@ internal bool CanDumpLibraryToXml(object obj) /// public static void SetUICulture(string locale) { - Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale == "Default" ? "en-US" : locale); - Thread.CurrentThread.CurrentCulture = new CultureInfo(locale == "Default" ? "en-US" : locale); + if (string.IsNullOrWhiteSpace(locale)) return; + + // Setting the locale for Dynamo from loaded Preferences, with Default handled differently + // between a non-in-process integration case (when HostAnalyticsInfo.HostName is unspecified) + // and in-process integration case. In later case, Default setting means following host locale. + if (string.IsNullOrEmpty(HostAnalyticsInfo.HostName)) + { + // Sandbox default to en-US + Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale == "Default" ? "en-US" : locale); + Thread.CurrentThread.CurrentCulture = new CultureInfo(locale == "Default" ? "en-US" : locale); + } + else + { + // Integration default to + Thread.CurrentThread.CurrentUICulture = locale == "Default" ? System.Globalization.CultureInfo.DefaultThreadCurrentCulture : new CultureInfo(locale); + Thread.CurrentThread.CurrentCulture = locale == "Default" ? System.Globalization.CultureInfo.DefaultThreadCurrentCulture : new CultureInfo(locale); + } } ///