Skip to content

Commit

Permalink
lang: 下载页面几乎支持国际化
Browse files Browse the repository at this point in the history
  • Loading branch information
tangge233 committed Jul 4, 2024
1 parent 4f6de2e commit 7b9bfaf
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
PanIntro.Children.Insert(0, CompItem)

'决定按钮显示
BtnIntroWeb.Text = If(Project.FromCurseForge, "转到 CurseForge", "转到 Modrinth")
BtnIntroWeb.Text = If(Project.FromCurseForge, Application.Current.FindResource("LangDownloadCompToCurseForge"), Application.Current.FindResource("LangDownloadCompToModrinth"))
BtnIntroWiki.Visibility = If(Project.WikiId = 0, Visibility.Collapsed, Visibility.Visible)

AniControlEnabled -= 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
If SelectedOptiFine IsNot Nothing Then
Info += ", OptiFine " & SelectedOptiFine.NameDisplay.Replace(SelectedMinecraftId & " ", "")
End If
If Info = "" Then Info = ", 无附加安装"
If Info = "" Then Info = "," & Application.Current.FindResource("LangDownloadInstallNoAdd")
Return Info.TrimStart(", ".ToCharArray())
End Function
''' <summary>
Expand Down
26 changes: 13 additions & 13 deletions Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,14 @@
AniControlEnabled += 1
If Not Setup.Get("HintHandInstall") Then
Setup.Set("HintHandInstall", True)
If MyMsgBox("手动安装包功能提供了 OptiFine、Forge 等组件的 .jar 安装文件下载,但无法自动安装。" & vbCrLf &
"在自动安装页面先选择 MC 版本,然后就可以选择 OptiFine、Forge 等组件,让 PCL 自动进行安装了。", "自动安装提示", "返回自动安装", "继续下载手动安装包") = 1 Then
If MyMsgBox(Application.Current.FindResource("LangDownloadPageDialogManualInstallContent"), Application.Current.FindResource("LangDownloadPageDialogManualInstallTitle"), Application.Current.FindResource("LangDownloadPageDialogManualInstallBtn1"), Application.Current.FindResource("LangDownloadPageDialogManualInstallBtn2")) = 1 Then
FrmMain.PageChange(New FormMain.PageStackData With {.Page = FormMain.PageType.Download}, FormMain.PageSubType.DownloadInstall)
AniControlEnabled -= 1
Exit Sub
End If
End If
ItemHand.Visibility = Visibility.Collapsed
LabGame.Visibility = Visibility.Collapsed
'LabGame.Visibility = Visibility.Collapsed
LabHand.Visibility = Visibility.Visible
ItemClient.Visibility = Visibility.Visible
ItemOptiFine.Visibility = Visibility.Visible
Expand All @@ -166,7 +165,7 @@
e.Handled = True
AniControlEnabled += 1
ItemHand.Visibility = Visibility.Visible
LabGame.Visibility = Visibility.Visible
'LabGame.Visibility = Visibility.Visible
LabHand.Visibility = Visibility.Collapsed
ItemClient.Visibility = Visibility.Collapsed
ItemOptiFine.Visibility = Visibility.Collapsed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
PanScroll="{Binding ElementName=PanBack}">
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack">
<StackPanel Orientation="Vertical" Margin="5">
<local:MyCard Margin="20,20,20,0" Grid.IsSharedSizeScope="True" Title="LiteLoader 简介" x:Name="CardTip">
<local:MyCard Margin="20,20,20,0" Grid.IsSharedSizeScope="True" Title="{DynamicResource LangDownloadLiteloaderDescTitle}" x:Name="CardTip">
<StackPanel Margin="25,40,15,20">
<TextBlock Name="LabConnect" Margin="0,0,0,11" Text="与 Forge 类似,LiteLoader 可以用于加载老版本 Minecraft 中的 LiteLoader 模组。" TextWrapping="Wrap" />
<TextBlock Name="LabConnect" Margin="0,0,0,11" Text="{DynamicResource LangDownloadLiteloaderDesc}" TextWrapping="Wrap" />
<Grid Height="35">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
</Grid.ColumnDefinitions>
<local:MyButton x:Name="BtnWeb" Grid.Column="0" MinWidth="140" Text="打开官网" Padding="13,0" Margin="0,0,20,0" HorizontalAlignment="Left" ColorType="Highlight" />
<local:MyButton x:Name="BtnWeb" Grid.Column="0" MinWidth="140" Text="{DynamicResource LangDownloadLiteloaderWebsite}" Padding="13,0" Margin="0,0,20,0" HorizontalAlignment="Left" ColorType="Highlight" />
</Grid>
</StackPanel>
</local:MyCard>
<StackPanel Name="PanMain" Margin="20,15,20,5" Grid.IsSharedSizeScope="True" />
<local:MyCard HorizontalAlignment="Center" Margin="40,50" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False">
<local:MyLoading Text="正在获取 LiteLoader 列表" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" />
<local:MyLoading Text="{DynamicResource LangDownloadLiteloaderGettingList}" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" />
</local:MyCard>
</StackPanel>
</local:MyScrollViewer>
Expand Down
76 changes: 38 additions & 38 deletions Plain Craft Launcher 2/Pages/PageDownload/PageDownloadMod.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PanScroll="{Binding ElementName=PanBack}">
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack">
<StackPanel Orientation="Vertical" Margin="25">
<local:MyCard Title="搜索 Mod" Margin="0,0,0,15" x:Name="PanAlways">
<local:MyCard Title="{DynamicResource LangDownloadModSearchTitle}" Margin="0,0,0,15" x:Name="PanAlways">
<StackPanel Margin="25,40,25,15">
<Grid Margin="0,0,0,11" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
Expand All @@ -22,17 +22,17 @@
<RowDefinition Height="9" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="名称" Margin="0,0,18,0" />
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="{DynamicResource LangDownloadModSearchName}" Margin="0,0,18,0" />
<local:MyTextBox x:Name="TextSearchName" Grid.Column="1" Grid.ColumnSpan="2" />
<TextBlock VerticalAlignment="Center" Grid.Column="4" HorizontalAlignment="Left" Text="来源" Margin="0,0,18,0" />
<TextBlock VerticalAlignment="Center" Grid.Column="4" HorizontalAlignment="Left" Text="{DynamicResource LangDownloadModSearchSource}" Margin="0,0,18,0" />
<local:MyComboBox x:Name="ComboSearchSource" Grid.Column="5">
<local:MyComboBoxItem Content="全部" Tag="3" IsSelected="True" />
<local:MyComboBoxItem Content="CurseForge" Tag="1" />
<local:MyComboBoxItem Content="Modrinth" Tag="2" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModSearchSourceAll}" Tag="3" IsSelected="True" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModSearchSourceCF}" Tag="1" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModSearchSourceM}" Tag="2" />
</local:MyComboBox>
<TextBlock VerticalAlignment="Center" Grid.Row="2" HorizontalAlignment="Left" Text="版本" Margin="0,0,18,0" />
<TextBlock VerticalAlignment="Center" Grid.Row="2" HorizontalAlignment="Left" Text="{DynamicResource LangDownloadModSearchVersion}" Margin="0,0,18,0" />
<local:MyComboBox x:Name="TextSearchVersion" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" IsEditable="True" MaxDropDownHeight="320">
<local:MyComboBoxItem Content="全部 (也可自行输入)" IsSelected="True" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModSearchVersionAll}" IsSelected="True" />
<local:MyComboBoxItem Content="1.20.6" />
<local:MyComboBoxItem Content="1.20.4" />
<local:MyComboBoxItem Content="1.20.1" />
Expand All @@ -50,49 +50,49 @@
<local:MyComboBoxItem Content="1.7.10" />
</local:MyComboBox>
<local:MyComboBox x:Name="ComboSearchLoader" Visibility="Collapsed" Grid.Row="2" Grid.Column="2" MaxDropDownHeight="320" Margin="10,0,0,0">
<local:MyComboBoxItem Content="任意 Mod 加载器" IsSelected="True" Tag="0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModSearchLoader}" IsSelected="True" Tag="0" />
<local:MyComboBoxItem Content="Forge" Tag="1" />
<local:MyComboBoxItem Content="Fabric" Tag="4" />
<local:MyComboBoxItem Content="Quilt" Tag="5" />
<local:MyComboBoxItem Content="NeoForge" Tag="6" />
</local:MyComboBox>
<TextBlock VerticalAlignment="Center" Grid.Column="4" Grid.Row="2" HorizontalAlignment="Left" Text="类型" Margin="0,0,18,0" />
<local:MyComboBox x:Name="ComboSearchTag" Grid.Column="5" Grid.Row="2" MaxDropDownHeight="320">
<local:MyComboBoxItem Content="全部" Tag="" IsSelected="True" />
<local:MyComboBoxItem Content="世界元素" Tag="406/worldgen" />
<local:MyComboBoxItem Content="生物群系" Tag="407/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="维度" Tag="410/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="矿物与资源" Tag="408/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="天然结构" Tag="409/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="科技" Tag="412/technology" />
<local:MyComboBoxItem Content="管道与物流" Tag="415/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="自动化" Tag="4843/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="能源" Tag="417/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="红石" Tag="4558/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="食物与烹饪" Tag="436/food" />
<local:MyComboBoxItem Content="农业" Tag="416/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="游戏机制" Tag="/game-mechanics" />
<local:MyComboBoxItem Content="运输" Tag="414/transportation" />
<local:MyComboBoxItem Content="仓储" Tag="420/storage" />
<local:MyComboBoxItem Content="魔法" Tag="419/magic" />
<local:MyComboBoxItem Content="冒险" Tag="422/adventure" />
<local:MyComboBoxItem Content="装饰" Tag="424/decoration" />
<local:MyComboBoxItem Content="生物" Tag="411/mobs" />
<local:MyComboBoxItem Content="装备与工具" Tag="434/equipment" />
<local:MyComboBoxItem Content="性能优化" Tag="/optimization" />
<local:MyComboBoxItem Content="信息显示" Tag="423/" />
<local:MyComboBoxItem Content="服务器" Tag="435/social" />
<local:MyComboBoxItem Content="改良" Tag="5191/utility" />
<local:MyComboBoxItem Content="支持库" Tag="421/library" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeAll}" Tag="" IsSelected="True" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeWorldElement}" Tag="406/worldgen" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeBiome}" Tag="407/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeDimension}" Tag="410/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeMineral}" Tag="408/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeStructure}" Tag="409/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeTech}" Tag="412/technology" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypePipe}" Tag="415/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeAuto}" Tag="4843/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeEnergy}" Tag="417/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeRedstone}" Tag="4558/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeFood}" Tag="436/food" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeAgriculture}" Tag="416/" Margin="15,0,0,0" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeGameMechanics}" Tag="/game-mechanics" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeTransportation}" Tag="414/transportation" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeStorage}" Tag="420/storage" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeMagic}" Tag="419/magic" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeAdventure}" Tag="422/adventure" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeDecoration}" Tag="424/decoration" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeMobs}" Tag="411/mobs" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeEquipment}" Tag="434/equipment" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeOptimization}" Tag="/optimization" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeDisplay}" Tag="423/" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeServer}" Tag="435/social" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeUtility}" Tag="5191/utility" />
<local:MyComboBoxItem Content="{DynamicResource LangDownloadModTypeLib}" Tag="421/library" />
</local:MyComboBox>
</Grid>
<Grid Margin="0,4,0,6" Height="35">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
</Grid.ColumnDefinitions>
<local:MyButton x:Name="BtnSearchRun" Text="搜索" MinWidth="140" Padding="13,0" Margin="0,0,20,0" ColorType="Highlight" />
<local:MyButton x:Name="BtnSearchReset" Text="重置条件" MinWidth="140" Padding="13,0" Margin="0,0,20,0" Grid.Column="1" />
<local:MyButton x:Name="BtnSearchRun" Text="{DynamicResource LangDownloadModSearch}" MinWidth="140" Padding="13,0" Margin="0,0,20,0" ColorType="Highlight" />
<local:MyButton x:Name="BtnSearchReset" Text="{DynamicResource LangDownloadModReset}" MinWidth="140" Padding="13,0" Margin="0,0,20,0" Grid.Column="1" />
</Grid>
</StackPanel>
</local:MyCard>
Expand All @@ -115,7 +115,7 @@
</local:MyCard>
</StackPanel>
<local:MyCard HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False" Margin="40,50">
<local:MyLoading Text="正在获取 Mod 列表" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" />
<local:MyLoading Text="{DynamicResource LangDownloadModGettingList}" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" />
</local:MyCard>
</StackPanel>
</local:MyScrollViewer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
If FrmDownloadMod IsNot Nothing Then
With Request
.SearchText = FrmDownloadMod.TextSearchName.Text
.GameVersion = If(FrmDownloadMod.TextSearchVersion.Text = "全部 (也可自行输入)", Nothing,
.GameVersion = If(FrmDownloadMod.TextSearchVersion.Text = Application.Current.FindResource("LangDownloadModSearchVersionAll"), Nothing,
If(FrmDownloadMod.TextSearchVersion.Text.Contains(".") OrElse FrmDownloadMod.TextSearchVersion.Text.Contains("w"), FrmDownloadMod.TextSearchVersion.Text, Nothing))
.Tag = FrmDownloadMod.ComboSearchTag.SelectedItem.Tag
.ModLoader = Val(FrmDownloadMod.ComboSearchLoader.SelectedItem.Tag)
Expand Down Expand Up @@ -111,7 +111,7 @@
'重置按钮
Private Sub BtnSearchReset_Click(sender As Object, e As EventArgs) Handles BtnSearchReset.Click
TextSearchName.Text = ""
TextSearchVersion.Text = "全部 (也可自行输入)"
TextSearchVersion.Text = Application.Current.FindResource("LangDownloadModSearchVersionAll")
TextSearchVersion.SelectedIndex = 0
ComboSearchSource.SelectedIndex = 0
ComboSearchTag.SelectedIndex = 0
Expand Down
Loading

0 comments on commit 7b9bfaf

Please sign in to comment.