fixt pop up box about unsaved porgrass

This commit is contained in:
Björn Blomberg
2025-10-17 15:58:42 +02:00
parent ed4ce28921
commit 099110cdb7
6 changed files with 101 additions and 20 deletions

View File

@@ -225,16 +225,24 @@ namespace TheGame
public string GetText(string key)
{
string text = null;
// Försök hämta från nuvarande språk
if (_currentTranslations != null && _currentTranslations.ContainsKey(key))
{
return _currentTranslations[key];
text = _currentTranslations[key];
}
// Fallback till engelska
else if (_fallbackTranslations != null && _fallbackTranslations.ContainsKey(key))
{
text = _fallbackTranslations[key];
}
// Fallback till engelska
if (_fallbackTranslations != null && _fallbackTranslations.ContainsKey(key))
// Konvertera escape-sekvenser om vi hittade text
if (text != null)
{
return _fallbackTranslations[key];
text = text.Replace("\\n", "\n").Replace("\\t", "\t");
return text;
}
// Om inte ens engelska finns, returnera nyckeln