Fix localization bugs

This commit is contained in:
JappaWakka 2023-08-11 12:06:07 +02:00
parent 6b4e8941d2
commit 13493287ba
2 changed files with 14 additions and 1 deletions

View File

@ -88,6 +88,11 @@
If LocalizationTokens.ContainsKey(TokenName) = False Then
LocalizationTokens.Add(TokenName, New Token(TokenContent, "en", IsGameModeFile))
Else
If LocalizationTokens(TokenName).IsGameModeToken = False And IsGameModeFile = True Then
LocalizationTokens.Remove(TokenName)
LocalizationTokens.Add(TokenName, New Token(TokenContent, LanguageSuffix, IsGameModeFile))
End If
End If
End If
Next

View File

@ -111,7 +111,15 @@ Public Class Badge
For Each b As BadgeDeclaration In Badges
If b.ID = ID Then
If Localization.TokenExists("badge_" & b.ID.ToString) = True Then
Return Localization.GetString("badge_" & b.ID.ToString, b.Name)
If GameModeManager.ActiveGameMode.IsDefaultGamemode = False Then
If Localization.LocalizationTokens("badge_" & b.ID.ToString).IsGameModeToken = False Then
Return b.Name
Else
Return Localization.GetString("badge_" & b.ID.ToString)
End If
Else
Return Localization.GetString("badge_" & b.ID.ToString)
End If
Else
Return b.Name
End If