Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Translation

Module that can be used to localize mods All default strings (e.g. item names, windows titles, etc.) in the mod should be in English. Add translations to theese strings using Translation.addTranslation. For items and blocks translations are applied automatically. For the other strings, use Translation.translate

Index

Functions

addTranslation

  • addTranslation(name: string, localization: object): void
  • Adds translations for specified object in several languages

    Parameters

    • name: string

      default string in English or name key

    • localization: object

      object containing two-letter language codes as keys and localized strings in the specified language as values

    Returns void

getLanguage

  • getLanguage(): string

translate

  • translate(name: string): string
  • Translates string from English to current game language (if available). Add translations via Translation.addTranslation to apply them

    Parameters

    • name: string

      default string in English or name key

    Returns string

    string in the current game language or input string if translation is not available

Generated using TypeDoc