1
0
mirror of synced 2025-02-16 10:42:39 +01:00

Localizing TJAs by parsing language-specific Title/Subtitle (#315)

* Localizing TJAs by parsing language-specific Title/Subtitle

Follows a similar style to Taiko Web's localized title/subtitle metadata by adding an abbreviation of the user's selected language to the TITLE and SUBTITLE command name.

* Using a more proper method for localizing title/subtitle

Hang on, that was a really bad method now that I looked at it.

Now has a readonly string instead of constantly concating strings.
This commit is contained in:
DragonRatTiger 2022-10-07 22:20:35 -04:00 committed by GitHub
parent 22ec0f9716
commit 82d6a6f911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1314,6 +1314,9 @@ namespace TJAPlayer3
private string[] dlmtEnter = { "\n" };
private string[] dlmtCOURSE = { "COURSE:" };
private readonly string langTITLE = "TITLE" + CLangManager.fetchLang().ToUpper();
private readonly string langSUBTITLE = "SUBTITLE" + CLangManager.fetchLang().ToUpper();
private int nスクロール方向 = 0;
//2015.09.18 kairera0467
//バタフライスライドみたいなアレをやりたいがために実装。
@ -5005,6 +5008,15 @@ namespace TJAPlayer3
this.TITLE = subTitle.Substring(5);
//tbTitle.Text = strCommandParam;
}
else if (strCommandName.Equals(langTITLE))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.TITLE = subTitle.Substring(7);
}
if (strCommandName.Equals("SUBTITLE"))
{
if (strCommandParam.StartsWith("--"))
@ -5029,6 +5041,15 @@ namespace TJAPlayer3
this.SUBTITLE = subTitle.Substring(10);
}
}
else if (strCommandName.Equals(langSUBTITLE))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.SUBTITLE = subTitle.Substring(10);
}
else if (strCommandName.Equals("LEVEL"))
{
var level = (int)Convert.ToDouble(strCommandParam);