diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 2ce5d62be52..91296ed0f99 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -3164,6 +3164,69 @@ public static string GenericTaskDialogTitle { } } + /// + /// Looks up a localized string similar to Centimeters. + /// + public static string GESUnitCentimeters { + get { + return ResourceManager.GetString("GESUnitCentimeters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Feet. + /// + public static string GESUnitFeet { + get { + return ResourceManager.GetString("GESUnitFeet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inches. + /// + public static string GESUnitInches { + get { + return ResourceManager.GetString("GESUnitInches", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kilometers. + /// + public static string GESUnitKilometers { + get { + return ResourceManager.GetString("GESUnitKilometers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Meters. + /// + public static string GESUnitMeters { + get { + return ResourceManager.GetString("GESUnitMeters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Miles. + /// + public static string GESUnitMiles { + get { + return ResourceManager.GetString("GESUnitMiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Millimeters. + /// + public static string GESUnitMillimeters { + get { + return ResourceManager.GetString("GESUnitMillimeters", resourceCulture); + } + } + /// /// Looks up a localized string similar to _User Interface Tour. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 9936d518cb8..48de8bdc057 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3861,4 +3861,25 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in To access the Recommended Nodes feature, please read and accept Dynamo > Agreement and Terms of Use. - + + Centimeters + + + Feet + + + Inches + + + Kilometers + + + Meters + + + Miles + + + Millimeters + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 19a284d4064..9ed38b6d675 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3602,7 +3602,7 @@ You can manage this in Preferences -> Security. This package is outdated and cannot be installed. - + Publish Version @@ -3848,4 +3848,25 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in To access the Recommended Nodes feature, please read and accept Dynamo > Agreement and Terms of Use. - + + Centimeters + + + Feet + + + Inches + + + Kilometers + + + Meters + + + Miles + + + Millimeters + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index ebba4be9200..df4a7b8c0f8 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -1308,6 +1308,35 @@ public bool importSettingsContent(string content) return setSettings(newPreferences); } + /// + /// Returns localized resource strings for Units + /// + private string GetLocalizedUnits(Enum value) + { + if (value != null) + { + switch (value) + { + case Configurations.Units.Millimeters: + return Res.GESUnitMillimeters; + case Configurations.Units.Centimeters: + return Res.GESUnitCentimeters; + case Configurations.Units.Kilometers: + return Res.GESUnitKilometers; + case Configurations.Units.Meters: + return Res.GESUnitMeters; + case Configurations.Units.Inches: + return Res.GESUnitInches; + case Configurations.Units.Feet: + return Res.GESUnitFeet; + case Configurations.Units.Miles: + return Res.GESUnitMiles; + } + } + return null; + } + + private bool setSettings(PreferenceSettings newPreferences) { // Explicit copy @@ -1381,7 +1410,7 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel) SelectedLanguage = Configurations.SupportedLocaleDic.FirstOrDefault(x => x.Value == preferenceSettings.Locale).Key; // Chose the scaling unit, if option is allowed by user - UnitList = Configurations.SupportedUnits.Keys.Select(x => x.ToString()).ToObservableCollection(); + UnitList = Configurations.SupportedUnits.Keys.Select(x => GetLocalizedUnits(x)).ToObservableCollection(); SelectedUnits = Configurations.SupportedUnits.FirstOrDefault(x => x.Key.ToString() == preferenceSettings.GraphicScaleUnit).Key.ToString(); GroupStyleFontSizeList = preferenceSettings.PredefinedGroupStyleFontSizes;