Skip to content

Commit ab66b37

Browse files
committed
preparation for localisation
1 parent ad8835c commit ab66b37

File tree

9 files changed

+493
-54
lines changed

9 files changed

+493
-54
lines changed

OnlyV/Pages/EditTextPage.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
Margin="10,0,0,0"
6868
IsEnabled="{Binding IsFocused}"
6969
Focusable="False"
70-
ToolTip="Insert opening quotation mark"
70+
ToolTip="{x:Static resx:Resources.INSERT_OPENING_QUOTE}"
7171
HorizontalAlignment="Left" Click="OpeningQuoteButtonClick">
7272
<materialDesign:PackIcon
7373
Kind="FormatQuoteOpen"
@@ -77,7 +77,7 @@
7777
<Button Style="{StaticResource QuoteButtonStyle}"
7878
IsEnabled="{Binding IsFocused}"
7979
Focusable="False"
80-
ToolTip="Insert closing quotation mark"
80+
ToolTip="{x:Static resx:Resources.INSERT_CLOSING_QUOTE}"
8181
HorizontalAlignment="Right" Click="ClosingQuoteButtonClick">
8282
<materialDesign:PackIcon
8383
Kind="FormatQuoteClose"
@@ -92,8 +92,8 @@
9292
IsEnabled="{Binding IsModified}"
9393
Command="{Binding ResetCommand}"
9494
Style="{StaticResource MaterialDesignRaisedLightButton}"
95-
ToolTip="Reset the verse text"
96-
Content="RESET" />
95+
ToolTip="{x:Static resx:Resources.RESET_VERSE_TEXT}"
96+
Content="{x:Static resx:Resources.RESET}" />
9797
</Grid>
9898
</Grid>
9999
</GroupBox>

OnlyV/Pages/PreviewPage.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DataContext="{Binding Source={StaticResource Locator}, Path=Preview}"
1010

1111
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
12+
xmlns:resx="clr-namespace:OnlyV.Properties"
1213
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
1314
TextElement.FontWeight="Medium"
1415
TextElement.FontSize="14"
@@ -70,7 +71,7 @@
7071
<DockPanel Grid.Row="0" Margin="10,5">
7172
<Button Style="{StaticResource PreviewButtonStyle}"
7273
Command="{Binding SaveCommand}"
73-
ToolTip="Save to images folder">
74+
ToolTip="{x:Static resx:Resources.SAVE_TO_IMAGES}">
7475
<materialDesign:PackIcon
7576
Kind="ContentSave"
7677
Height="32"
@@ -79,7 +80,7 @@
7980

8081
<Button Style="{StaticResource PreviewButtonStyle}"
8182
Command="{Binding CopyToClipboardCommand}"
82-
ToolTip="Copy image to clipboard">
83+
ToolTip="{x:Static resx:Resources.COPY_TO_CLIPBOARD}">
8384
<materialDesign:PackIcon
8485
Kind="ContentCopy"
8586
Height="32"
@@ -88,7 +89,7 @@
8889

8990
<Button Style="{StaticResource PreviewNavButtonStyle}"
9091
Command="{Binding NextImageCommand}"
91-
ToolTip="Next image">
92+
ToolTip="{x:Static resx:Resources.NEXT_IMAGE}">
9293
<materialDesign:PackIcon
9394
Kind="ChevronRight"
9495
Height="32"
@@ -97,14 +98,13 @@
9798

9899
<Button Style="{StaticResource PreviewNavButtonStyle}"
99100
Command="{Binding PreviousImageCommand}"
100-
ToolTip="Previous image">
101+
ToolTip="{x:Static resx:Resources.PREV_IMAGE}">
101102
<materialDesign:PackIcon
102103
Kind="ChevronLeft"
103104
Height="32"
104105
Width="32"/>
105106
</Button>
106107

107-
108108
<ToggleButton HorizontalAlignment="Right"
109109
DockPanel.Dock="Right"
110110
Style="{StaticResource PreviewToggleButtonStyle}"

OnlyV/Pages/ScripturesPage.xaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DataContext="{Binding Source={StaticResource Locator}, Path=Scriptures}"
1010

1111
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
12+
xmlns:resx="clr-namespace:OnlyV.Properties"
1213
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
1314
TextElement.FontWeight="Medium"
1415
TextElement.FontSize="14"
@@ -17,7 +18,7 @@
1718
Background="{DynamicResource MaterialDesignPaper}"
1819
FontFamily="{DynamicResource MaterialDesignFont}"
1920

20-
d:DesignHeight="650" d:DesignWidth="900" Loaded="UserControl_Loaded">
21+
d:DesignHeight="650" d:DesignWidth="900" Loaded="UserControlLoaded">
2122
<UserControl.Resources>
2223
<Style x:Key="PanelCardStyle" TargetType="{x:Type materialDesign:Card}">
2324
<Setter Property="VerticalAlignment" Value="Stretch"/>
@@ -132,7 +133,7 @@
132133

133134
<TextBlock Grid.Row="0"
134135
Style="{StaticResource BibleSectionLabelStyle}"
135-
Text="BOOK"/>
136+
Text="{x:Static resx:Resources.BOOK}"/>
136137

137138
<ScrollViewer Grid.Row="1"
138139
Margin="4"
@@ -165,7 +166,7 @@
165166
</Grid.RowDefinitions>
166167

167168
<TextBlock Grid.Row="0"
168-
Text="CHAPTER"
169+
Text="{x:Static resx:Resources.CHAPTER}"
169170
Style="{StaticResource BibleSectionLabelStyle}"/>
170171

171172
<ScrollViewer Grid.Row="1" Margin="4" VerticalScrollBarVisibility="Auto" PanningMode="VerticalOnly">
@@ -189,7 +190,7 @@
189190
</Grid.RowDefinitions>
190191

191192
<TextBlock Grid.Row="0"
192-
Text="VERSES"
193+
Text="{x:Static resx:Resources.VERSES}"
193194
Style="{StaticResource BibleSectionLabelStyle}"/>
194195

195196
<ScrollViewer Grid.Row="1"

OnlyV/Pages/ScripturesPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public ScripturesPage()
1414
InitializeComponent();
1515
}
1616

17-
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
17+
private void UserControlLoaded(object sender, System.Windows.RoutedEventArgs e)
1818
{
1919
if (!BringButtonIntoView(HebrewBooksControl))
2020
{

OnlyV/Pages/SettingsPage.xaml

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DataContext="{Binding Source={StaticResource Locator}, Path=Settings}"
1010

1111
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
12+
xmlns:resx="clr-namespace:OnlyV.Properties"
1213
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
1314
TextElement.FontWeight="Medium"
1415
TextElement.FontSize="14"
@@ -60,7 +61,8 @@
6061
HorizontalScrollBarVisibility="Hidden"
6162
PanningMode="VerticalOnly">
6263
<StackPanel Orientation="Vertical" Margin="5">
63-
<GroupBox Header="Bibles" Style="{StaticResource SettingsGroupBoxStyle}">
64+
<GroupBox Header="{x:Static resx:Resources.HEADER_BIBLES}"
65+
Style="{StaticResource SettingsGroupBoxStyle}">
6466
<StackPanel Orientation="Vertical">
6567

6668
<Grid
@@ -83,15 +85,15 @@
8385
HorizontalAlignment="Center"
8486
VerticalAlignment="Center"
8587
TextWrapping="Wrap"
86-
Text="Download Bible epub files from jw.org and drag and drop here."
88+
Text="{x:Static resx:Resources.DROP_BIBLE_INSTRUCTIONS}"
8789
Foreground="{StaticResource PrimaryHueDarkBrush}"/>
8890

8991
</Grid>
9092

9193
<ComboBox ItemsSource="{Binding BibleEpubFiles}"
9294
Style="{StaticResource SettingsComboBoxStyle}"
9395
materialDesign:HintAssist.IsFloating="True"
94-
materialDesign:HintAssist.Hint="Bible epub file"
96+
materialDesign:HintAssist.Hint="{x:Static resx:Resources.BIBLE_EPUB_FILE}"
9597
SelectedValuePath="Path"
9698
DisplayMemberPath="Name"
9799
materialDesign:ComboBoxAssist.ClassicMode="true"
@@ -101,28 +103,34 @@
101103
</StackPanel>
102104
</GroupBox>
103105

104-
<GroupBox Header="Display" Style="{StaticResource SettingsGroupBoxStyle}">
105-
<StackPanel Orientation="Vertical">
106-
107-
<ComboBox ItemsSource="{Binding Monitors}"
108-
Style="{StaticResource SettingsComboBoxStyle}"
109-
materialDesign:HintAssist.IsFloating="True"
110-
materialDesign:HintAssist.Hint="Media Monitor"
111-
SelectedValuePath="MonitorId"
112-
DisplayMemberPath="FriendlyName"
113-
materialDesign:ComboBoxAssist.ClassicMode="true"
114-
SelectedValue="{Binding MonitorId, Mode=TwoWay}">
115-
</ComboBox>
116-
117-
<CheckBox IsChecked="{Binding JwLibraryCompatibilityMode, Mode=TwoWay}"
118-
Content="JW Library compatibility mode"
119-
Style="{StaticResource SettingsCheckBoxStyle}"/>
120-
121-
</StackPanel>
122-
</GroupBox>
123-
124-
125-
<GroupBox Header="Image Style" Style="{StaticResource SettingsGroupBoxStyle}">
106+
<GroupBox Header="{x:Static resx:Resources.HEADER_DISPLAY}"
107+
Style="{StaticResource SettingsGroupBoxStyle}">
108+
<StackPanel Orientation="Vertical">
109+
110+
<ComboBox ItemsSource="{Binding Monitors}"
111+
Style="{StaticResource SettingsComboBoxStyle}"
112+
materialDesign:HintAssist.IsFloating="True"
113+
materialDesign:HintAssist.Hint="{x:Static resx:Resources.MEDIA_MONITOR}"
114+
SelectedValuePath="MonitorId"
115+
DisplayMemberPath="FriendlyName"
116+
materialDesign:ComboBoxAssist.ClassicMode="true"
117+
SelectedValue="{Binding MonitorId, Mode=TwoWay}"/>
118+
119+
<CheckBox IsChecked="{Binding JwLibraryCompatibilityMode, Mode=TwoWay}"
120+
Content="{x:Static resx:Resources.JW_COMPAT_MODE}"
121+
Style="{StaticResource SettingsCheckBoxStyle}"/>
122+
123+
<TextBlock FontSize="12"
124+
Width="420"
125+
Margin="0,10,0,0"
126+
HorizontalAlignment="Left"
127+
TextWrapping="Wrap"
128+
Text="{x:Static resx:Resources.JWL_TRADEMARK}" />
129+
</StackPanel>
130+
</GroupBox>
131+
132+
133+
<GroupBox Header="{x:Static resx:Resources.HEADER_IMAGE_STYLE}" Style="{StaticResource SettingsGroupBoxStyle}">
126134
<StackPanel Orientation="Vertical">
127135

128136
<ComboBox ItemsSource="{Binding ThemeFiles}"
@@ -135,7 +143,7 @@
135143
SelectedValue="{Binding CurrentThemePath, Mode=TwoWay}">
136144
</ComboBox>
137145

138-
<Label Margin="-5,0,0,0">Text scaling:</Label>
146+
<Label Margin="-5,0,0,0" Content="{x:Static resx:Resources.TEXT_SCALING}"/>
139147
<Slider Width="420"
140148
Margin="0,0,0,10"
141149
Minimum="50"
@@ -146,37 +154,38 @@
146154
HorizontalAlignment="Left" />
147155

148156
<CheckBox IsChecked="{Binding UseBackgroundImage, Mode=TwoWay}"
149-
Content="Use background image"
157+
Content="{x:Static resx:Resources.USE_BACKGROUND_IMAGE}"
150158
Style="{StaticResource SettingsCheckBoxStyle}"/>
151159

152160
<CheckBox IsChecked="{Binding AutoFit, Mode=TwoWay}"
153-
Content="Auto fit"
161+
Content="{x:Static resx:Resources.AUTO_FIT}"
154162
Style="{StaticResource SettingsCheckBoxStyle}"/>
155163

156164
<CheckBox IsChecked="{Binding ShowVerseBreaks, Mode=TwoWay}"
157-
Content="Use ellipses to indicate non-contiguous verses"
165+
Content="{x:Static resx:Resources.USE_ELLIPSES}"
158166
Style="{StaticResource SettingsCheckBoxStyle}"/>
159167

160168
<CheckBox IsChecked="{Binding UseTildeMarker, Mode=TwoWay}"
161-
Content="Show a tilde between paragraphs in a single verse"
169+
Content="{x:Static resx:Resources.USE_TILDE}"
162170
Style="{StaticResource SettingsCheckBoxStyle}"/>
163171

164172
<CheckBox IsChecked="{Binding TrimPunctuation, Mode=TwoWay}"
165-
Content="Trim punctuation"
173+
Content="{x:Static resx:Resources.TRIM_PUNCTUATION}"
166174
Style="{StaticResource SettingsCheckBoxStyle}"/>
167175

168176
<CheckBox IsChecked="{Binding TrimQuotes, Mode=TwoWay}"
169-
Content="Trim quotation marks"
177+
Content="{x:Static resx:Resources.TRIM_QUOTES}"
170178
Style="{StaticResource SettingsCheckBoxStyle}"/>
171179

172180
<CheckBox IsChecked="{Binding ShowVerseNos, Mode=TwoWay}"
173-
Content="Show verse numbers"
181+
Content="{x:Static resx:Resources.SHOW_VERSE_NOS}"
174182
Style="{StaticResource SettingsCheckBoxStyle}"/>
175183
</StackPanel>
176184
</GroupBox>
177185

178186

179-
<GroupBox Header="Miscellaneous" Style="{StaticResource SettingsGroupBoxStyle}">
187+
<GroupBox Header="{x:Static resx:Resources.HEADER_MISC}"
188+
Style="{StaticResource SettingsGroupBoxStyle}">
180189
<StackPanel Orientation="Vertical">
181190

182191
<TextBlock Text="{Binding AppVersionStr}"
@@ -185,11 +194,11 @@
185194
Foreground="{StaticResource MaterialDesignBodyLight}" />
186195

187196
<CheckBox IsChecked="{Binding AlwaysOnTop, Mode=TwoWay}"
188-
Content="Main window always on top"
197+
Content="{x:Static resx:Resources.ALWAYS_ON_TOP}"
189198
Style="{StaticResource SettingsCheckBoxStyle}"/>
190199

191200
<CheckBox IsChecked="{Binding AllowVerseEditing, Mode=TwoWay}"
192-
Content="Allow verse editing"
201+
Content="{x:Static resx:Resources.ALLOW_VERSE_EDITING}"
193202
Style="{StaticResource SettingsCheckBoxStyle}"/>
194203

195204
<DockPanel LastChildFill="True" Width="420" HorizontalAlignment="Left">
@@ -202,15 +211,14 @@
202211
Style="{StaticResource SelectFolderStyle}"
203212
DockPanel.Dock="Left"
204213
Margin="0,10,0,10"
205-
materialDesign:HintAssist.Hint="Images folder"
214+
materialDesign:HintAssist.Hint="{x:Static resx:Resources.IMAGES_FOLDER}"
206215
Text="{Binding DestinationFolder, Mode=TwoWay}" />
207216
</DockPanel>
208217

209-
210218
<ComboBox ItemsSource="{Binding LoggingLevels}"
211219
Style="{StaticResource SettingsComboBoxStyle}"
212220
materialDesign:HintAssist.IsFloating="True"
213-
materialDesign:HintAssist.Hint="Logging Level"
221+
materialDesign:HintAssist.Hint="{x:Static resx:Resources.LOGGING_LEVEL}"
214222
SelectedValuePath="Level"
215223
DisplayMemberPath="Name"
216224
materialDesign:ComboBoxAssist.ClassicMode="true"

OnlyV/Pages/StartupPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DataContext="{Binding Source={StaticResource Locator}, Path=Startup}"
1010

1111
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
12+
xmlns:resx="clr-namespace:OnlyV.Properties"
1213
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
1314
TextElement.FontWeight="Medium"
1415
TextElement.FontSize="14"
@@ -36,7 +37,7 @@
3637
HorizontalAlignment="Center"
3738
VerticalAlignment="Center"
3839
TextWrapping="Wrap"
39-
Text="To get started, download a Bible epub file from jw.org and then drag and drop it here."
40+
Text="{x:Static resx:Resources.GET_STARTED_INSTRUCTIONS}"
4041
Foreground="{StaticResource PrimaryHueDarkBrush}"/>
4142

4243
</Grid>

0 commit comments

Comments
 (0)