Skip to content

Commit

Permalink
Multi Language
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle-insect committed Aug 7, 2018
1 parent 8d28b38 commit 9e2a911
Show file tree
Hide file tree
Showing 9 changed files with 630 additions and 99 deletions.
11 changes: 6 additions & 5 deletions OctopathTraveler/ItemChoiceWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:OctopathTraveler"
xmlns:properties="clr-namespace:OctopathTraveler.Properties"
mc:Ignorable="d"
Title="アイテム選択" Height="300" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
Title="{x:Static properties:Resources.ItemChoiceTitle}" Height="300" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded">
<Grid>
<DockPanel>
<DockPanel DockPanel.Dock="Top">
<Label Content="フィルタ"/>
<TextBox x:Name="TextBoxFilter" TextChanged="TextBoxFilter_TextChanged"/>
<Label Content="{x:Static properties:Resources.ItemChoiceFilter}"/>
<TextBox x:Name="TextBoxFilter" TextChanged="TextBoxFilter_TextChanged" TabIndex="0"/>
</DockPanel>
<Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button x:Name="ButtonDecision" Content="決定" IsEnabled="False" Click="ButtonDecision_Click"/>
<Button Content="キャンセル" Grid.Column="1" IsCancel="True"/>
<Button x:Name="ButtonDecision" Content="{x:Static properties:Resources.ItemChoiceOK}" IsEnabled="False" Click="ButtonDecision_Click"/>
<Button Content="{x:Static properties:Resources.ItemChoiceCancel}" Grid.Column="1" IsCancel="True"/>
</Grid>
<ListBox x:Name="ListBoxItem" SelectionChanged="ListBoxItem_SelectionChanged" DisplayMemberPath="Name"/>
</DockPanel>
Expand Down
37 changes: 19 additions & 18 deletions OctopathTraveler/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:OctopathTraveler"
xmlns:properties="clr-namespace:OctopathTraveler.Properties"
mc:Ignorable="d"
Title="OCTOPATH TRAVELER セーブデータ改造(Nintendo Switch)" Height="650" Width="800"
Title="{x:Static properties:Resources.MainWindowTitle}" Height="650" Width="800"
WindowStartupLocation="CenterScreen"
AllowDrop="True" Drop="Window_Drop" PreviewDragOver="Window_PreviewDragOver">
<Grid>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="ファイル(_F)">
<MenuItem Header="開く(_O)" Click="MenuItemFileOpen_Click"/>
<MenuItem Header="上書き保存(_S)" Click="MenuItemFileSave_Click"/>
<MenuItem Header="名前を付けて保存(_S)" Click="MenuItemFileSaveAs_Click"/>
<MenuItem Header="{x:Static properties:Resources.MenuFile}">
<MenuItem Header="{x:Static properties:Resources.MenuFileOpen}" Click="MenuItemFileOpen_Click"/>
<MenuItem Header="{x:Static properties:Resources.MenuFileSave}" Click="MenuItemFileSave_Click"/>
<MenuItem Header="{x:Static properties:Resources.MenuFileSaveAs}" Click="MenuItemFileSaveAs_Click"/>
<Separator/>
<MenuItem Header="終了(_X)" Click="MenuItemExit_Click"/>
<MenuItem Header="{x:Static properties:Resources.MenuExit}" Click="MenuItemExit_Click"/>
</MenuItem>
<MenuItem Header="情報(_A)" Click="MenuItemAbout_Click"/>
<MenuItem Header="{x:Static properties:Resources.MenuAbout}" Click="MenuItemAbout_Click"/>
</Menu>
<ToolBar DockPanel.Dock="Top">
<Button Width="32" Height="32" Click="ToolBarFileOpen_Click" ToolTip="開く">
<Button Width="32" Height="32" Click="ToolBarFileOpen_Click" ToolTip="{x:Static properties:Resources.ToolTipOpen}">
<Image Source="{StaticResource Open}"/>
</Button>
<Button Width="32" Height="32" Click="ToolBarFileSave_Click" ToolTip="保存">
<Button Width="32" Height="32" Click="ToolBarFileSave_Click" ToolTip="{x:Static properties:Resources.ToolTipSave}">
<Image Source="{StaticResource Save}"/>
</Button>
</ToolBar>
<TabControl>
<TabItem Header="基本情報">
<TabItem Header="{x:Static properties:Resources.TabItemBasic}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand All @@ -43,11 +44,11 @@
<RowDefinition/>
<RowDefinition Height="12*"/>
</Grid.RowDefinitions>
<Label Content="お金"/>
<Label Content="{x:Static properties:Resources.BacisMoney}"/>
<TextBox Grid.Column="1" Text="{Binding Money, UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</TabItem>
<TabItem Header="人物">
<TabItem Header="{x:Static properties:Resources.TabItemCharacter}">
<Grid>
<Grid.Resources>
<local:CharactorNameConverter x:Key="CharactorNameConverter"/>
Expand Down Expand Up @@ -188,7 +189,7 @@
</Grid>
</Grid>
</TabItem>
<TabItem Header="アイテム">
<TabItem Header="{x:Static properties:Resources.TabItemItems}">
<TabItem.Resources>
<local:ItemNameConverter x:Key="ItemNameConverter"/>
</TabItem.Resources>
Expand All @@ -205,7 +206,7 @@
</ListBox.ItemTemplate>
</ListBox>
</TabItem>
<TabItem Header="場所">
<TabItem Header="{x:Static properties:Resources.TabItemPlaces}">
<ListBox ItemsSource="{Binding Places}">
<ListBox.ItemTemplate>
<DataTemplate>
Expand All @@ -214,7 +215,7 @@
</ListBox.ItemTemplate>
</ListBox>
</TabItem>
<TabItem Header="手なずけたモンスター">
<TabItem Header="{x:Static properties:Resources.TabItemTameMonster}">
<TabItem.Resources>
<local:TameMonsterConverter x:Key="TameMonsterConverter"/>
</TabItem.Resources>
Expand All @@ -234,7 +235,7 @@
</ListBox.ItemTemplate>
</ListBox>
</TabItem>
<TabItem Header="パーティー">
<TabItem Header="{x:Static properties:Resources.TabItemParty}">
<Grid>
<Grid.Resources>
<local:PartyMemberConverter x:Key="PartyMemberConverter"/>
Expand All @@ -254,7 +255,7 @@
</ListBox>
</Grid>
</TabItem>
<TabItem Header="サブストーリー">
<TabItem Header="{x:Static properties:Resources.TabItemQuests}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand All @@ -272,7 +273,7 @@
</ListBox>
</DockPanel>
<DockPanel Grid.Column="1">
<Label DockPanel.Dock="Top" Content=""/>
<Label DockPanel.Dock="Top" Content="{x:Static properties:Resources.QuestsCountry}"/>
<ListBox Name="CountryList" ItemsSource="{Binding Countris}" DisplayMemberPath="Country"/>
</DockPanel>
<ListBox Grid.Column="2" ItemsSource="{Binding ElementName=CountryList, Path=SelectedItem.Missions}">
Expand Down
12 changes: 6 additions & 6 deletions OctopathTraveler/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void Window_Drop(object sender, DragEventArgs e)

SaveData.Instance().Open(files[0]);
Init();
MessageBox.Show("読込成功");
MessageBox.Show(Properties.Resources.MessageLoadSuccess);
}

private void MenuItemFileOpen_Click(object sender, RoutedEventArgs e)
Expand All @@ -57,8 +57,8 @@ private void MenuItemFileSaveAs_Click(object sender, RoutedEventArgs e)
SaveFileDialog dlg = new SaveFileDialog();
if (dlg.ShowDialog() == false) return;

if (SaveData.Instance().SaveAs(dlg.FileName) == true) MessageBox.Show("書込成功");
else MessageBox.Show("書込失敗");
if (SaveData.Instance().SaveAs(dlg.FileName) == true) MessageBox.Show(Properties.Resources.MessageSaveSuccess);
else MessageBox.Show(Properties.Resources.MeaageSaveFail);
}

private void MenuItemExit_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -93,13 +93,13 @@ private void Load(bool force)

SaveData.Instance().Open(dlg.FileName);
Init();
MessageBox.Show("読込成功");
MessageBox.Show(Properties.Resources.MessageLoadSuccess);
}

private void Save()
{
if (SaveData.Instance().Save() == true) MessageBox.Show("書込成功");
else MessageBox.Show("書込失敗");
if (SaveData.Instance().Save() == true) MessageBox.Show(Properties.Resources.MessageSaveSuccess);
else MessageBox.Show(Properties.Resources.MeaageSaveFail);
}

private void ButtonSword_Click(object sender, RoutedEventArgs e)
Expand Down
3 changes: 2 additions & 1 deletion OctopathTraveler/OctopathTraveler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.ja-JP.resx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
Expand Down
Loading

0 comments on commit 9e2a911

Please sign in to comment.