Skip to content

Commit 9b89241

Browse files
authored
Merge pull request #53 from Chiloven945/Language
fix: GetLangByNumIsPlural() can't use param
2 parents 794ddcd + 5d2e85a commit 9b89241

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1393,12 +1393,12 @@ Retry:
13931393
If Title <> FileName.BeforeLast(".") Then Info.Add(FileName.BeforeLast("."))
13941394
Select Case Type
13951395
Case CompType.Mod
1396-
If Dependencies.Any Then Info.Add(GetLocationNum(Dependencies.Count) & " " & GetLangByNumIsPlural(Dependencies.Count, "LangModCompModDependentCount"))
1396+
If Dependencies.Any Then Info.Add(GetLangByNumIsPlural(Dependencies.Count, "LangModCompModDependentCount", GetLocationNum(Dependencies.Count)))
13971397
Case CompType.ModPack
13981398
If GameVersions.All(Function(v) v.Contains("w")) Then Info.Add($"{GetLang("LangModCompModGameVersion")} {Join(GameVersions, GetLang("LangComma"))}")
13991399
End Select
14001400
If DownloadCount > 0 Then 'CurseForge 的下载次数经常错误地返回 0
1401-
Info.Add(GetLocationNum(DownloadCount) & " " & GetLangByNumIsPlural(DownloadCount, "LangModCompModDownload"))
1401+
Info.Add(GetLangByNumIsPlural(DownloadCount, "LangModCompModDownload", GetLocationNum(DownloadCount)))
14021402
End If
14031403
Info.Add(GetLang("LangModCompModUpdateTime", GetTimeSpanString(ReleaseDate - Date.Now, False)))
14041404
If Status <> CompFileStatus.Release Then Info.Add(StatusDescription)

Plain Craft Launcher 2/Modules/Modi18n.vb

+4-3
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ Module Modi18n
162162
''' </summary>
163163
''' <param name="Count">数量</param>
164164
''' <param name="Key">调用的键名</param>
165+
''' <param name="Param">字段中对应要展示的内容</param>
165166
''' <returns>对应单复数形式的译文</returns>
166-
Public Function GetLangByNumIsPlural(Count As Int32, Key As String) As String
167+
Public Function GetLangByNumIsPlural(Count As Int32, Key As String, ParamArray Param As String()) As String
167168
If Count <= 1 Then
168-
Return GetLang(Key)
169+
Return GetLang(Key, Param)
169170
Else
170-
Return GetLang(Key & "P")
171+
Return GetLang(Key & "P", Param)
171172
End If
172173
End Function
173174

0 commit comments

Comments
 (0)