Revise stat abbreviations

Closes #4495

fix german's order (speed last)
This commit is contained in:
Kurt 2025-05-18 18:13:51 -05:00
parent bf31d9119f
commit 533c870ca5
5 changed files with 37 additions and 6 deletions

View File

@ -1,11 +1,11 @@
{
"StatNames": {
"Names": ["KP", "Ang", "Vert", "Init", "SpA", "SpV"],
"Names": ["KP", "Ang", "Vert", "SpA", "SpV", "Init"],
"ValueGap": " ",
"Separator": " / "
},
"StatNamesFull": {
"Names": ["KP", "Angriff", "Verteidigung", "Initiative", "Sp. Angriff", "Sp. Verteidigung"],
"Names": ["KP", "Angriff", "Verteidigung", "Spez. Ang.", "Spez. Vert.", "Initiative"],
"ValueGap": " ",
"Separator": " / "
},

View File

@ -1,6 +1,6 @@
{
"StatNames": {
"Names": ["PS", "Atq", "Def", "AtS", "DeS", "Vel"],
"Names": ["PS", "Atq", "Def", "Asp", "Dsp", "Vel"],
"ValueGap": " ",
"Separator": " / "
},

View File

@ -1,6 +1,6 @@
{
"StatNames": {
"Names": ["PV", "Atq", "Déf", "AttS", "DéfS", "Vit"],
"Names": ["PV", "Atq", "Dfs", "Asp", "Dsp", "Vit"],
"ValueGap": " ",
"Separator": " / "
},

View File

@ -1,11 +1,11 @@
{
"StatNames": {
"Names": ["PS", "Att", "Dif", "AtS", "DiS", "Vel"],
"Names": ["PS", "Att", "Dif", "Asp", "Dsp", "Vel"],
"ValueGap": " ",
"Separator": " / "
},
"StatNamesFull": {
"Names": ["PS", "Attacco", "Difesa", "Attacco Sp.", "Difesa Sp.", "Velocità"],
"Names": ["PS", "Attacco", "Difesa", "Att. Spec.", "Dif. Spec.", "Velocità"],
"ValueGap": " ",
"Separator": " / "
},

View File

@ -197,6 +197,37 @@ public void SimulatorTranslate(string message, string languageOriginal = "en")
}
}
[Fact]
public void StatNamesNoSubstring()
{
var all = BattleTemplateLocalization.GetAll();
foreach (var l in all)
{
var languageTarget = l.Key;
var x = l.Value.Config;
CheckSubstring(x.StatNames.Names, languageTarget);
CheckSubstring(x.StatNamesFull.Names, languageTarget);
}
void CheckSubstring(string[] statNames, string languageTarget)
{
// ensure no stat name is a substring of another
for (int i = 0; i < statNames.Length; i++)
{
var name = statNames[i];
for (int j = 0; j < statNames.Length; j++)
{
if (i == j)
continue;
var other = statNames[j];
if (other.Contains(name) || name.Contains(other))
throw new Exception($"Stat name {name} is a substring of {other} in {languageTarget}");
}
}
}
}
[Theory]
[InlineData(SetAllTokenExample)]
public void SimulatorTranslateHABCDS(string message, string languageOriginal = "en")