Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TranslationController

Represents a controller for a room to handle translations.

Hierarchy

  • TranslationController

Index

Constructors

constructor

Methods

formatString

  • Format a translation string containing {X} templating. Also substitutes player names if the translation controller is connected to a room in the constructor.

    Parameters

    • str: string | StringNames

      The string to format against.

    • elements: (number | PlayerData<Hostable<any>> | QuickChatPlayerMessageData)[]

      The elements to format the string with.

    • language: Language

      The language of the string.

    Returns string

    The formatted string.

getCosmeticName

  • getCosmeticName(cosmeticId: string, language: Language): string
  • Get the translation string of a cosmetic.

    Parameters

    • cosmeticId: string

      The ID of the cosmetic to get the name of.

    • language: Language

      The language to translate the cosmetic name into.

    Returns string

    The cosmetic name as translated into the given language.

getTranslation

  • getTranslation(stringName: StringNames, language: Language): string
  • Get the single translation of a string.

    Parameters

    • stringName: StringNames

      The string name to get.

    • language: Language

      The language to translate the string name to.

    Returns string

    The translated string, or an empty string if an invalid string name was passed.

serializeQuickChat

Properties

Optional Readonly room

room: Hostable<any>

Generated using TypeDoc