Skip to content

Commit

Permalink
Added localizationmanager force language option in TranslateMultiple.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Nov 17, 2023
1 parent a569371 commit dd7e52c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,17 @@ public static string TranslateForLanguage(string stringID, int language)
}
}

public static string[] TranslateMultiple(string stringID)
public static string[] TranslateMultiple(string stringID, int? forcedLanguage = null)
{
if (stringID == null)
{
return new string[] { "NULL STRING" };
}
else if (mStringDatabase.ContainsKey(stringID))
{
var language = forcedLanguage ?? CurrentLanguage;
var entry = mStringDatabase[stringID];
var toReturn = entry.Rows.Select(item => item[CurrentLanguage]);
var toReturn = entry.Rows.Select(item => item[language]);

return toReturn.ToArray();
}
Expand Down

0 comments on commit dd7e52c

Please sign in to comment.