mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add translation helper methods to API
This commit is contained in:
parent
cb7bece107
commit
ee154fdb33
@ -173,5 +173,36 @@ namespace NewHorizons
|
||||
/// <param name="curiousityColours">A dictionary of each curiousity ID to its colour and highlight colour in the ship log. Optional.</param>
|
||||
void AddShipLogXML(IModBehaviour mod, XElement xml, string planetName, string imageFolder = null, Dictionary<string, Vector2> entryPositions = null, Dictionary<string, (Color colour, Color highlight)> curiousityColours = null);
|
||||
#endregion
|
||||
|
||||
#region Translations
|
||||
/// <summary>
|
||||
/// Look up shiplog-related translated text for the given text key.
|
||||
/// Defaults to English if no translation in the current language is available, and just the key if no English translation is available.
|
||||
/// </summary>
|
||||
/// <param name="text">The text key to look up.</param>
|
||||
/// <returns></returns>
|
||||
string GetTranslationForShipLog(string text);
|
||||
/// <summary>
|
||||
/// Look up dialogue-related translated text for the given text key.
|
||||
/// Defaults to English if no translation in the current language is available, and just the key if no English translation is available.
|
||||
/// </summary>
|
||||
/// <param name="text">The text key to look up.</param>
|
||||
/// <returns></returns>
|
||||
string GetTranslationForDialogue(string text);
|
||||
/// <summary>
|
||||
/// Look up UI-related translated text for the given text key.
|
||||
/// Defaults to English if no translation in the current language is available, and just the key if no English translation is available.
|
||||
/// </summary>
|
||||
/// <param name="text">The text key to look up.</param>
|
||||
/// <returns></returns>
|
||||
string GetTranslationForUI(string text);
|
||||
/// <summary>
|
||||
/// Look up miscellaneous translated text for the given text key.
|
||||
/// Defaults to English if no translation in the current language is available, and just the key if no English translation is available.
|
||||
/// </summary>
|
||||
/// <param name="text">The text key to look up.</param>
|
||||
/// <returns></returns>
|
||||
string GetTranslationForOtherText(string text);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,5 +322,13 @@ namespace NewHorizons
|
||||
/// </summary>
|
||||
/// <param name="builder"></param>
|
||||
public void RegisterCustomBuilder(Action<GameObject, string> builder) => PlanetCreationHandler.CustomBuilders.Add(builder);
|
||||
|
||||
public string GetTranslationForShipLog(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.SHIPLOG);
|
||||
|
||||
public string GetTranslationForDialogue(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.DIALOGUE);
|
||||
|
||||
public string GetTranslationForUI(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.UI);
|
||||
|
||||
public string GetTranslationForOtherText(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.OTHER);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user