Skip to content

Commit

Permalink
chore: change _ to -
Browse files Browse the repository at this point in the history
  • Loading branch information
tangge233 committed Jan 22, 2025
1 parent da4afd5 commit 51a4d44
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 64 deletions.
4 changes: 2 additions & 2 deletions Plain Craft Launcher 2/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<!-- 本地化 -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh-CN.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resources/Language/zh-CN.xaml" />
</ResourceDictionary.MergedDictionaries>

<!--字体-->
Expand Down
8 changes: 4 additions & 4 deletions Plain Craft Launcher 2/Application.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Public Class Application
'依照选择语言切换字体
Dim LaunchFont As FontFamily
Select Case Lang
Case "zh_TW", "zh_HK", "lzh", "zh_MARS"
Case "zh-TW", "zh-HK", "lzh", "zh-MARS"
LaunchFont = New FontFamily(New Uri("pack://application:,,,/"), "./Resources/#PCL English, Segoe UI, Microsoft JhengHei UI")
Case "ja_JP"
Case "ja-JP"
LaunchFont = New FontFamily(New Uri("pack://application:,,,/"), "./Resources/#PCL English, Segoe UI, Yu Gothic UI, Microsoft YaHei UI")
Case "ko_KR"
Case "ko-KR"
LaunchFont = New FontFamily(New Uri("pack://application:,,,/"), "./Resources/#PCL English, Segoe UI, Malgun Gothic, Microsoft YaHei UI")
Case "en_US", "en_GB", "zh_CN", "zh_MEME"
Case "en-US", "en-GB", "zh-CN", "zh-MEME"
LaunchFont = New FontFamily(New Uri("pack://application:,,,/"), "./Resources/#PCL English, Segoe UI, Microsoft YaHei UI")
Case Else '非英语的其他西欧语言统一使用 Segoe UI
LaunchFont = New FontFamily(New Uri("pack://application:,,,/"), "Segoe UI, ./Resources/#PCL English, Microsoft YaHei UI")
Expand Down
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
''' </summary>
Public ReadOnly Property TranslatedName As String
Get
If Not (Lang.Equals("zh_CN") OrElse Lang.Equals("zh_MEME")) Then Return RawName '其它语言暂时没有翻译数据,使用原文本
If Not (Lang.Equals("zh-CN") OrElse Lang.Equals("zh-MEME")) Then Return RawName '其它语言暂时没有翻译数据,使用原文本
Return If(DatabaseEntry Is Nothing OrElse DatabaseEntry.ChineseName = "", RawName, DatabaseEntry.ChineseName)
End Get
End Property
Expand Down
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ NextVersion:
Dim RequiredLang As String = CurrentLang.ToLower
If CurrentLang = "none" OrElse String.IsNullOrWhiteSpace(CurrentLang) OrElse Not Directory.Exists(McVersionCurrent.PathIndie & "saves") Then '#3844,整合包可能已经自带了 options.txt
If Setup.Get("ToolHelpLanguage") Then
RequiredLang = Lang.ToLower
RequiredLang = Lang.ToLower.Replace("-", "_")
End If
End If
If McVersionCurrent.Version.McCodeMain < 15 And RequiredLang.Equals("lzh") Then '1.15 之前的版本不支持 lzh
Expand Down
36 changes: 18 additions & 18 deletions Plain Craft Launcher 2/Modules/Modi18n.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Module Modi18n
''' <param name="Word">中文文本</param>
''' <returns>对应语言的译文</returns>
Public Function GetLangByWord(Word As String) As String
If Lang = "zh_CN" Then Return Word '语言设置为中文时不需要处理,直接返回以节约处理时间
If Lang = "zh-CN" Then Return Word '语言设置为中文时不需要处理,直接返回以节约处理时间
Select Case Word
Case "正式版"
Return GetLang("LangDownloadRelease")
Expand All @@ -57,9 +57,9 @@ Module Modi18n
''' <returns>当前地区的时间格式字符串</returns>
Public Function GetLocalTimeFormat(Time As DateTime) As String
Select Case Lang
Case "ja_JP", "ko_KR", "lzh", "zh_CN", "zh_HK", "zh_MARS", "zh_MEME", "zh_TW" '2024/08/16 11:47
Case "ja-JP", "ko-KR", "lzh", "zh-CN", "zh-HK", "zh-MARS", "zh-MEME", "zh-TW" '2024/08/16 11:47
Return Time.ToString("yyyy'/'MM'/'dd HH':'mm")
Case "en_US" '11:47 08/16/2024
Case "en-US" '11:47 08/16/2024
Return Time.ToString("MM'/'dd'/'yyyy HH':'mm")
Case Else '11:47 16/08/2024
Return Time.ToString("dd'/'MM'/'yyyy HH':'mm")
Expand Down Expand Up @@ -106,17 +106,17 @@ Module Modi18n
''' <summary>
''' 获取当前系统的默认语言
''' </summary>
''' <returns>返回类似于 zh_CN 这样形式的文本</returns>
''' <returns>返回类似于 zh-CN 这样形式的文本</returns>
Public Function GetDefaultLang() As String
Dim CurrentCulture As String = CultureInfo.CurrentCulture.Name
Dim PrefixMap As New Dictionary(Of String, String) From {
{"el-", "el_GR"},
{"es-", "es_ES"},
{"fr-", "fr_FR"},
{"ja-", "ja_JP"},
{"ko-", "ko_KR"},
{"ru-", "ru_RU"},
{"sk-", "sk_SK"}
{"el-", "el-GR"},
{"es-", "es-ES"},
{"fr-", "fr-FR"},
{"ja-", "ja-JP"},
{"ko-", "ko-KR"},
{"ru-", "ru-RU"},
{"sk-", "sk-SK"}
}

For Each prefixPair In PrefixMap
Expand All @@ -127,16 +127,16 @@ Module Modi18n

Select Case CurrentCulture '部分需要特殊匹配的语言
Case "en-GB", "en-NZ", "en-AU", "en-CA"
Return "en_GB"
Return "en-GB"
Case "zh-CN", "zh-SG", "zh-Hans"
Return "zh_CN"
Return "zh-CN"
Case "zh-HK", "zh-MO"
Return "zh_HK"
Return "zh-HK"
Case "zh-TW", "zh-Hant"
Return "zh_TW"
Return "zh-TW"
End Select

Return "en_US" '无匹配则返回 en_us
Return "en-US" '无匹配则返回 en_us
End Function

''' <summary>
Expand All @@ -146,11 +146,11 @@ Module Modi18n
''' <returns>11 Million、2 万等这样的表示</returns>
Public Function GetLocationNum(Num As Int32) As String
Select Case Lang
Case "ja_JP", "ko_KR", "lzh", "zh_CN", "zh_HK", "zh_MARS", "zh_MEME", "zh_TW"
Case "ja-JP", "ko-KR", "lzh", "zh-CN", "zh-HK", "zh-MARS", "zh-MEME", "zh-TW"
Return If(Num > 1000000000000, Math.Round(Num / 1000000000000, 2) & " " & GetLang("LangModCompModDigit3"), '兆
If(Num > 100000000, Math.Round(Num / 100000000, 2) & " " & GetLang("LangModCompModDigit2"), '亿
If(Num > 100000, Math.Round(Num / 10000, 0) & " " & GetLang("LangModCompModDigit1"), Num.ToString("N0") & " "))) '万
Case Else 'en_US, en_GB, fr_FR etc.
Case Else 'en-US, en-GB, fr-FR etc.
Return If(Num > 1000000000, Math.Round(Num / 1000000000, 2) & GetLang("LangModCompModDigit3"), 'Billion
If(Num > 1000000, Math.Round(Num / 1000000, 2) & GetLang("LangModCompModDigit2"), 'Million
If(Num > 10000, Math.Round(Num / 1000, 0) & GetLang("LangModCompModDigit1"), Num.ToString("N0")))) 'Thousand(K)
Expand Down
14 changes: 7 additions & 7 deletions Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ pause"
'本地化
Dim subLocation As String = ""
Select Case Lang
Case "zh_CN", "zh_HK", "zh_TW"
Case "zh-CN", "zh-HK", "zh-TW"
subLocation = "zh."
If Id = "3d shareware v1.34" Then
WikiName = "3D_Shareware_v1.34"
Expand Down Expand Up @@ -461,7 +461,7 @@ pause"
For Each key In keyWord.Keys
WikiName = WikiName.Replace(key, keyWord(key))
Next
Case "en_US", "en_GB"
Case "en-US", "en-GB"
subLocation = ""
If Id = "3d shareware v1.34" Then
WikiName = "Java_Edition_3D_Shareware_v1.34"
Expand Down Expand Up @@ -521,7 +521,7 @@ pause"
WikiName = WikiName.Replace(key, keyWord(key))
Next
WikiName = FormatWikiNameEndDigit(WikiName)
Case "ko_KR"
Case "ko-KR"
subLocation = "ko."
If Id = "3d shareware v1.34" Then
WikiName = "Java_Edition_3D_Shareware_v1.34"
Expand Down Expand Up @@ -581,7 +581,7 @@ pause"
WikiName = WikiName.Replace(key, keyWord(key))
Next
WikiName = FormatWikiNameEndDigit(WikiName)
Case "ja_JP"
Case "ja-JP"
subLocation = "ja."
If Id = "3d shareware v1.34" Then
WikiName = "Java_Edition_3D_Shareware_v1.34"
Expand Down Expand Up @@ -641,7 +641,7 @@ pause"
WikiName = WikiName.Replace(key, keyWord(key))
Next
WikiName = FormatWikiNameEndDigit(WikiName)
Case "ru_RU"
Case "ru-RU"
subLocation = "ru."
If Id = "3d shareware v1.34" Then
WikiName = "3D_Shareware_v1.34_(Java_Edition)"
Expand Down Expand Up @@ -706,7 +706,7 @@ pause"
Next
WikiName = FormatWikiNameEndDigit(WikiName)
If Not WikiName.EndsWithF("_(Java_Edition)") Then WikiName += "_(Java_Edition)"
Case "fr_FR"
Case "fr-FR"
subLocation = "fr."
If Id = "3d shareware v1.34" Then
WikiName = "Édition_Java_3D_Shareware_v1.34"
Expand Down Expand Up @@ -767,7 +767,7 @@ pause"
WikiName = WikiName.Replace(key, keyWord(key))
Next
WikiName = FormatWikiNameEndDigit(WikiName)
Case "es_ES"
Case "es-ES"
subLocation = "es."
If Id = "3d shareware v1.34" Then
WikiName = "3D_Shareware_v1.34_(Java_Edition)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'滚动条
Private Sub PageOther_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
If Lang = "zh_CN" Then
If Lang = "zh-CN" Then
HintSCOnly.Visibility = Visibility.Collapsed
Else
HintSCOnly.Visibility = Visibility.Visible
Expand Down
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Pages/PageSetup/ModSetup.vb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
FrmSetupUI.PanCustomPreset.Visibility = Visibility.Visible
FrmSetupUI.PanCustomLocal.Visibility = Visibility.Collapsed
FrmSetupUI.PanCustomNet.Visibility = Visibility.Collapsed
If Lang.Equals("zh_CN") Then
If Lang.Equals("zh-CN") Then
FrmSetupUI.HintCustom.Visibility = Visibility.Collapsed
Else
FrmSetupUI.HintCustom.Visibility = Visibility.Visible
Expand Down
28 changes: 14 additions & 14 deletions Plain Craft Launcher 2/Pages/PageSetup/PageSetupSystem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,21 @@
</Grid.RowDefinitions>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="{StaticResource LangPageSetupSystemLangLaunchLang}"/>
<local:MyComboBox x:Name="ComboBackgroundSuit" Tag="UiBackgroundSuit" Grid.Row="0" Grid.Column="1">
<local:MyComboBoxItem Content="Ελληνικά (Ελλάδα)" Tag="el_GR" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="English (United Kingdom)" Tag="en_GB" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="English (US)" Tag="en_US" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Español (España)" Tag="es_ES" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Français (France)" Tag="fr_FR" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="日本語 (日本)" Tag="ja_JP" FontFamily="Resources/#PCL English, Segoe UI, Yu Gothic UI"/>
<local:MyComboBoxItem Content="한국어 (대한민국)" Tag="ko_KR" FontFamily="Resources/#PCL English, Segoe UI, Malgun Gothic"/>
<local:MyComboBoxItem Content="Ελληνικά (Ελλάδα)" Tag="el-GR" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="English (United Kingdom)" Tag="en-GB" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="English (US)" Tag="en-US" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Español (España)" Tag="es-ES" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Français (France)" Tag="fr-FR" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="日本語 (日本)" Tag="ja-JP" FontFamily="Resources/#PCL English, Segoe UI, Yu Gothic UI"/>
<local:MyComboBoxItem Content="한국어 (대한민국)" Tag="ko-KR" FontFamily="Resources/#PCL English, Segoe UI, Malgun Gothic"/>
<local:MyComboBoxItem Content="文言 (華夏)" Tag="lzh" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="Русский (Россия)" Tag="ru_RU" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Slovenčina (Slovensko)" Tag="sk_SK" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="简体中文 (中国大陆)" Tag="zh_CN" IsSelected="True" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="繁體中文 (香港特別行政區)" Tag="zh_HK" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="焱暒妏" Tag="zh_MARS" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="梗体中文 (天朝)" Tag="zh_MEME" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="繁體中文 (台灣)" Tag="zh_TW" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="Русский (Россия)" Tag="ru-RU" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="Slovenčina (Slovensko)" Tag="sk-SK" FontFamily="Segoe UI, Resources/#PCL English, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="简体中文 (中国大陆)" Tag="zh-CN" IsSelected="True" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="繁體中文 (香港特別行政區)" Tag="zh-HK" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="焱暒妏" Tag="zh-MARS" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
<local:MyComboBoxItem Content="梗体中文 (天朝)" Tag="zh-MEME" FontFamily="Resources/#PCL English, Segoe UI, Microsoft YaHei UI"/>
<local:MyComboBoxItem Content="繁體中文 (台灣)" Tag="zh-TW" FontFamily="Resources/#PCL English, Segoe UI, Microsoft JhengHei UI"/>
</local:MyComboBox>
<local:MyHint Text="{StaticResource LangPageSetupSystemLangWarn}" Grid.Row="2" Grid.ColumnSpan="2"/>
<Grid Height="35" Grid.Row="4" Grid.ColumnSpan="5" Margin="0,5,0,0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
End If
Lang = TargetLang
Application.Current.Resources.MergedDictionaries(1) = New ResourceDictionary With {.Source = New Uri("pack://application:,,,/Resources/Language/" & Lang & ".xaml", UriKind.RelativeOrAbsolute)}
If Lang.Equals("zh_MEME") Then MyMsgBox($"此语言仅供娱乐,请勿当真{vbCr}此語言僅供娛樂,請勿當真{vbCr}This language is for entertainment only, please don't take it seriously", IsWarn:=True)
If Lang.Equals("zh-MEME") Then MyMsgBox($"此语言仅供娱乐,请勿当真{vbCr}此語言僅供娛樂,請勿當真{vbCr}This language is for entertainment only, please don't take it seriously", IsWarn:=True)
WriteReg("Lang", Lang)
MyMsgBox(GetLang("LangPageSetupSystemDialogContentLanguageRestart"), ForceWait:=True)
Process.Start(New ProcessStartInfo(PathWithName))
Expand Down
28 changes: 14 additions & 14 deletions Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -558,63 +558,63 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\en_GB.xaml">
<Page Include="Resources\Language\en-GB.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\el_GR.xaml">
<Page Include="Resources\Language\el-GR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\sk_SK.xaml">
<Page Include="Resources\Language\sk-SK.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\en_US.xaml">
<Page Include="Resources\Language\en-US.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\Language\es_ES.xaml">
<Page Include="Resources\Language\es-ES.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\fr_FR.xaml">
<Page Include="Resources\Language\fr-FR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\ja_JP.xaml">
<Page Include="Resources\Language\ja-JP.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\ko_KR.xaml">
<Page Include="Resources\Language\ko-KR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\lzh.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\ru_RU.xaml">
<Page Include="Resources\Language\ru-RU.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\zh_MARS.xaml">
<Page Include="Resources\Language\zh-MARS.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\zh_MEME.xaml">
<Page Include="Resources\Language\zh-MEME.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\zh_CN.xaml">
<Page Include="Resources\Language\zh-CN.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\Language\zh_HK.xaml">
<Page Include="Resources\Language\zh-HK.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Language\zh_TW.xaml">
<Page Include="Resources\Language\zh-TW.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand Down

0 comments on commit 51a4d44

Please sign in to comment.