Skip to content

Commit 8abddcf

Browse files
committed
Added localizations of some strings relating to code formatting UI.
1 parent dc02fe5 commit 8abddcf

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void Initialize()
4949
GlobalOptions = new CSharpFormattingOptionsPersistence(
5050
SD.PropertyService.MainPropertiesContainer, new CSharpFormattingOptionsContainer()
5151
{
52-
DefaultText = "(global)" // TODO Localize!
52+
DefaultText = StringParser.Parse("${CSharpBinding.Formatting.GlobalOptionReference}")
5353
});
5454
GlobalOptions.Load();
5555

@@ -81,7 +81,7 @@ public static CSharpFormattingOptionsPersistence GetProjectOptions(IProject proj
8181
csproject.ExtensionProperties,
8282
new CSharpFormattingOptionsContainer((SolutionOptions ?? GlobalOptions).OptionsContainer)
8383
{
84-
DefaultText = "(project)" // TODO Localize!
84+
DefaultText = StringParser.Parse("${CSharpBinding.Formatting.ProjectOptionReference}")
8585
});
8686
}
8787

@@ -98,7 +98,7 @@ static void SolutionOpened(object sender, SolutionEventArgs e)
9898
e.Solution.GlobalPreferences,
9999
new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer)
100100
{
101-
DefaultText = "(solution)" // TODO Localize!
101+
DefaultText = StringParser.Parse("${CSharpBinding.Formatting.SolutionOptionReference}")
102102
});
103103
}
104104

src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ static void OnOptionPropertyChanged(DependencyObject o, DependencyPropertyChange
6767
if (container != null) {
6868
if (container.Parent != null) {
6969
// Add "default" entry in ComboBox
70-
// TODO Add located resource, maybe context-bound, like "(solution)" or "(global)"!
7170
comboBox.Items.Add(new ComboBoxItem {
7271
Content = (container.Parent ?? container).DefaultText,
7372
Tag = null

src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
<StackPanel DockPanel.Dock="Top" Orientation="Vertical">
301301
<CheckBox
302302
Name="autoFormattingCheckBox"
303-
Content="Automatically format code"
303+
Content="{core:Localize CSharpBinding.Formatting.AutoFormat}"
304304
IsThreeState="True" IsChecked="{Binding AutoFormatting}"
305305
Margin="0,0,0,10"
306306
Visibility="Collapsed"/>
@@ -311,7 +311,7 @@
311311
<ColumnDefinition Width="*" />
312312
</Grid.ColumnDefinitions>
313313

314-
<Button Grid.Column="0" Content="Reset to:" Click="ResetButton_Click" />
314+
<Button Grid.Column="0" Content="{core:Localize CSharpBinding.Formatting.ResetTo}" Click="ResetButton_Click" />
315315
<ComboBox Name="presetComboBox" Grid.Column="1" Margin="3,0,0,0" ItemsSource="{Binding Presets}" />
316316
</Grid>
317317
</StackPanel>

src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,12 @@ void ResetButton_Click(object sender, RoutedEventArgs e)
217217
var presetFunc = presets[(string) selectedPresetItem.Tag];
218218

219219
// Ask user if he's sure to reset all previously defined settings
220-
// TODO Localize messages!
221220
if (presetFunc != null) {
222-
if (SD.MessageService.AskQuestion("Are you sure that you want to reset all previously defined formatting options?")) {
221+
if (SD.MessageService.AskQuestion("${CSharpBinding.Formatting.PresetOverwriteQuestion}")) {
223222
OptionsContainer.Reset(presetFunc());
224223
}
225224
} else {
226-
SD.MessageService.ShowWarning("No formatting preset selected!");
225+
SD.MessageService.ShowWarning("${CSharpBinding.Formatting.NoPresetSelectedMessage}");
227226
}
228227
}
229228
}

src/Main/SharpDevelop/Project/Solution.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
528528
{
529529
var treeNode = AddInTree.GetTreeNode("/SharpDevelop/Dialogs/SolutionFormattingOptionsDialog", false);
530530
bool? result = ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTreeOptions(
531-
"Solution Formatting Options",
531+
StringParser.Parse("${ICSharpCode.SharpDevelop.Project.SolutionFormattingOptions.Title}"),
532532
treeNode);
533533
if ((bool) result) {
534534
// Formatting options have been changed, make solution dirty

0 commit comments

Comments
 (0)