(32ba1d322) When editing an item label or a room name, the text is colored gray/green according to whether the text can be translated (= if a matching text tag is found in the language files). There's also now a "text picker menu" that can be used to pick the text from a list of translatable texts. TODO: use this in ItemComponent.Msg and CustomInterface button/tickbox labels.
This commit is contained in:
@@ -252,6 +252,28 @@ namespace Barotrauma
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<KeyValuePair<string, string>> GetAllTagTextPairs()
|
||||
{
|
||||
if (!textPacks.ContainsKey(Language))
|
||||
{
|
||||
DebugConsole.ThrowError("No text packs available for the selected language (" + Language + ")! Switching to English...");
|
||||
Language = "English";
|
||||
if (!textPacks.ContainsKey(Language))
|
||||
{
|
||||
throw new Exception("No text packs available in English!");
|
||||
}
|
||||
}
|
||||
|
||||
List<KeyValuePair<string, string>> allText = new List<KeyValuePair<string, string>>();
|
||||
|
||||
foreach (TextPack textPack in textPacks[Language])
|
||||
{
|
||||
allText.AddRange(textPack.GetAllTagTextPairs());
|
||||
}
|
||||
|
||||
return allText;
|
||||
}
|
||||
|
||||
public static string ReplaceGenderPronouns(string text, Gender gender)
|
||||
{
|
||||
if (gender == Gender.Male)
|
||||
|
||||
Reference in New Issue
Block a user