Skip to content

Commit

Permalink
preparation for localisation
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyCorbett committed Dec 25, 2018
1 parent ad8835c commit ab66b37
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 54 deletions.
8 changes: 4 additions & 4 deletions OnlyV/Pages/EditTextPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
Margin="10,0,0,0"
IsEnabled="{Binding IsFocused}"
Focusable="False"
ToolTip="Insert opening quotation mark"
ToolTip="{x:Static resx:Resources.INSERT_OPENING_QUOTE}"
HorizontalAlignment="Left" Click="OpeningQuoteButtonClick">
<materialDesign:PackIcon
Kind="FormatQuoteOpen"
Expand All @@ -77,7 +77,7 @@
<Button Style="{StaticResource QuoteButtonStyle}"
IsEnabled="{Binding IsFocused}"
Focusable="False"
ToolTip="Insert closing quotation mark"
ToolTip="{x:Static resx:Resources.INSERT_CLOSING_QUOTE}"
HorizontalAlignment="Right" Click="ClosingQuoteButtonClick">
<materialDesign:PackIcon
Kind="FormatQuoteClose"
Expand All @@ -92,8 +92,8 @@
IsEnabled="{Binding IsModified}"
Command="{Binding ResetCommand}"
Style="{StaticResource MaterialDesignRaisedLightButton}"
ToolTip="Reset the verse text"
Content="RESET" />
ToolTip="{x:Static resx:Resources.RESET_VERSE_TEXT}"
Content="{x:Static resx:Resources.RESET}" />
</Grid>
</Grid>
</GroupBox>
Expand Down
10 changes: 5 additions & 5 deletions OnlyV/Pages/PreviewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DataContext="{Binding Source={StaticResource Locator}, Path=Preview}"

xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:resx="clr-namespace:OnlyV.Properties"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
Expand Down Expand Up @@ -70,7 +71,7 @@
<DockPanel Grid.Row="0" Margin="10,5">
<Button Style="{StaticResource PreviewButtonStyle}"
Command="{Binding SaveCommand}"
ToolTip="Save to images folder">
ToolTip="{x:Static resx:Resources.SAVE_TO_IMAGES}">
<materialDesign:PackIcon
Kind="ContentSave"
Height="32"
Expand All @@ -79,7 +80,7 @@

<Button Style="{StaticResource PreviewButtonStyle}"
Command="{Binding CopyToClipboardCommand}"
ToolTip="Copy image to clipboard">
ToolTip="{x:Static resx:Resources.COPY_TO_CLIPBOARD}">
<materialDesign:PackIcon
Kind="ContentCopy"
Height="32"
Expand All @@ -88,7 +89,7 @@

<Button Style="{StaticResource PreviewNavButtonStyle}"
Command="{Binding NextImageCommand}"
ToolTip="Next image">
ToolTip="{x:Static resx:Resources.NEXT_IMAGE}">
<materialDesign:PackIcon
Kind="ChevronRight"
Height="32"
Expand All @@ -97,14 +98,13 @@

<Button Style="{StaticResource PreviewNavButtonStyle}"
Command="{Binding PreviousImageCommand}"
ToolTip="Previous image">
ToolTip="{x:Static resx:Resources.PREV_IMAGE}">
<materialDesign:PackIcon
Kind="ChevronLeft"
Height="32"
Width="32"/>
</Button>


<ToggleButton HorizontalAlignment="Right"
DockPanel.Dock="Right"
Style="{StaticResource PreviewToggleButtonStyle}"
Expand Down
9 changes: 5 additions & 4 deletions OnlyV/Pages/ScripturesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DataContext="{Binding Source={StaticResource Locator}, Path=Scriptures}"

xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:resx="clr-namespace:OnlyV.Properties"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
Expand All @@ -17,7 +18,7 @@
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"

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

<TextBlock Grid.Row="0"
Style="{StaticResource BibleSectionLabelStyle}"
Text="BOOK"/>
Text="{x:Static resx:Resources.BOOK}"/>

<ScrollViewer Grid.Row="1"
Margin="4"
Expand Down Expand Up @@ -165,7 +166,7 @@
</Grid.RowDefinitions>

<TextBlock Grid.Row="0"
Text="CHAPTER"
Text="{x:Static resx:Resources.CHAPTER}"
Style="{StaticResource BibleSectionLabelStyle}"/>

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

<TextBlock Grid.Row="0"
Text="VERSES"
Text="{x:Static resx:Resources.VERSES}"
Style="{StaticResource BibleSectionLabelStyle}"/>

<ScrollViewer Grid.Row="1"
Expand Down
2 changes: 1 addition & 1 deletion OnlyV/Pages/ScripturesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ScripturesPage()
InitializeComponent();
}

private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
private void UserControlLoaded(object sender, System.Windows.RoutedEventArgs e)
{
if (!BringButtonIntoView(HebrewBooksControl))
{
Expand Down
86 changes: 47 additions & 39 deletions OnlyV/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DataContext="{Binding Source={StaticResource Locator}, Path=Settings}"

xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:resx="clr-namespace:OnlyV.Properties"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
Expand Down Expand Up @@ -60,7 +61,8 @@
HorizontalScrollBarVisibility="Hidden"
PanningMode="VerticalOnly">
<StackPanel Orientation="Vertical" Margin="5">
<GroupBox Header="Bibles" Style="{StaticResource SettingsGroupBoxStyle}">
<GroupBox Header="{x:Static resx:Resources.HEADER_BIBLES}"
Style="{StaticResource SettingsGroupBoxStyle}">
<StackPanel Orientation="Vertical">

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

</Grid>

<ComboBox ItemsSource="{Binding BibleEpubFiles}"
Style="{StaticResource SettingsComboBoxStyle}"
materialDesign:HintAssist.IsFloating="True"
materialDesign:HintAssist.Hint="Bible epub file"
materialDesign:HintAssist.Hint="{x:Static resx:Resources.BIBLE_EPUB_FILE}"
SelectedValuePath="Path"
DisplayMemberPath="Name"
materialDesign:ComboBoxAssist.ClassicMode="true"
Expand All @@ -101,28 +103,34 @@
</StackPanel>
</GroupBox>

<GroupBox Header="Display" Style="{StaticResource SettingsGroupBoxStyle}">
<StackPanel Orientation="Vertical">

<ComboBox ItemsSource="{Binding Monitors}"
Style="{StaticResource SettingsComboBoxStyle}"
materialDesign:HintAssist.IsFloating="True"
materialDesign:HintAssist.Hint="Media Monitor"
SelectedValuePath="MonitorId"
DisplayMemberPath="FriendlyName"
materialDesign:ComboBoxAssist.ClassicMode="true"
SelectedValue="{Binding MonitorId, Mode=TwoWay}">
</ComboBox>

<CheckBox IsChecked="{Binding JwLibraryCompatibilityMode, Mode=TwoWay}"
Content="JW Library compatibility mode"
Style="{StaticResource SettingsCheckBoxStyle}"/>

</StackPanel>
</GroupBox>


<GroupBox Header="Image Style" Style="{StaticResource SettingsGroupBoxStyle}">
<GroupBox Header="{x:Static resx:Resources.HEADER_DISPLAY}"
Style="{StaticResource SettingsGroupBoxStyle}">
<StackPanel Orientation="Vertical">

<ComboBox ItemsSource="{Binding Monitors}"
Style="{StaticResource SettingsComboBoxStyle}"
materialDesign:HintAssist.IsFloating="True"
materialDesign:HintAssist.Hint="{x:Static resx:Resources.MEDIA_MONITOR}"
SelectedValuePath="MonitorId"
DisplayMemberPath="FriendlyName"
materialDesign:ComboBoxAssist.ClassicMode="true"
SelectedValue="{Binding MonitorId, Mode=TwoWay}"/>

<CheckBox IsChecked="{Binding JwLibraryCompatibilityMode, Mode=TwoWay}"
Content="{x:Static resx:Resources.JW_COMPAT_MODE}"
Style="{StaticResource SettingsCheckBoxStyle}"/>

<TextBlock FontSize="12"
Width="420"
Margin="0,10,0,0"
HorizontalAlignment="Left"
TextWrapping="Wrap"
Text="{x:Static resx:Resources.JWL_TRADEMARK}" />
</StackPanel>
</GroupBox>


<GroupBox Header="{x:Static resx:Resources.HEADER_IMAGE_STYLE}" Style="{StaticResource SettingsGroupBoxStyle}">
<StackPanel Orientation="Vertical">

<ComboBox ItemsSource="{Binding ThemeFiles}"
Expand All @@ -135,7 +143,7 @@
SelectedValue="{Binding CurrentThemePath, Mode=TwoWay}">
</ComboBox>

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

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

<CheckBox IsChecked="{Binding AutoFit, Mode=TwoWay}"
Content="Auto fit"
Content="{x:Static resx:Resources.AUTO_FIT}"
Style="{StaticResource SettingsCheckBoxStyle}"/>

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

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

<CheckBox IsChecked="{Binding TrimPunctuation, Mode=TwoWay}"
Content="Trim punctuation"
Content="{x:Static resx:Resources.TRIM_PUNCTUATION}"
Style="{StaticResource SettingsCheckBoxStyle}"/>

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

<CheckBox IsChecked="{Binding ShowVerseNos, Mode=TwoWay}"
Content="Show verse numbers"
Content="{x:Static resx:Resources.SHOW_VERSE_NOS}"
Style="{StaticResource SettingsCheckBoxStyle}"/>
</StackPanel>
</GroupBox>


<GroupBox Header="Miscellaneous" Style="{StaticResource SettingsGroupBoxStyle}">
<GroupBox Header="{x:Static resx:Resources.HEADER_MISC}"
Style="{StaticResource SettingsGroupBoxStyle}">
<StackPanel Orientation="Vertical">

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

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

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

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


<ComboBox ItemsSource="{Binding LoggingLevels}"
Style="{StaticResource SettingsComboBoxStyle}"
materialDesign:HintAssist.IsFloating="True"
materialDesign:HintAssist.Hint="Logging Level"
materialDesign:HintAssist.Hint="{x:Static resx:Resources.LOGGING_LEVEL}"
SelectedValuePath="Level"
DisplayMemberPath="Name"
materialDesign:ComboBoxAssist.ClassicMode="true"
Expand Down
3 changes: 2 additions & 1 deletion OnlyV/Pages/StartupPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DataContext="{Binding Source={StaticResource Locator}, Path=Startup}"

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

</Grid>
Expand Down
Loading

0 comments on commit ab66b37

Please sign in to comment.