Takaro module library

Takaro Modules

Takaro is a game server management platform for running, automating, and moderating multiplayer communities. These modules install into Takaro to add server automation, Discord workflows, economy systems, and moderation tools.

Translator

by Limon
Translate in-game chat messages in real time to help multilingual game server communities communicate. This module shows how Takaro can support community accessibility through chat hooks and configurable language workflows.
Use this module to:
  • Translate player chat across configured languages.
  • Reduce language friction in international communities.
  • Add communication support without changing the core game server.
communityTakaro v0.0.29
(8 versions available)

Components Overview

1
config
6
commands
3
hooks
0
Cron Jobs
0
functions
2
permissions

New Module: Translator

NEW
August 6, 2025
Updated to version 1.0.0. Added 6 commands: setplayerlanguage, translate, toggletranslation, translateme, gettranslation, setlanguage. Added 1 hook: auto-translate (chat-message). New permission: TRANSLATE_PERMISSION. New configuration options: googleApiKey, maxMessageLength, enabledByDefault, defaultLanguage, supportedLanguages.

Configuration

Configure this module using the schemas below. The JSON schema defines the data structure, while the UI schema customizes how the configuration form is displayed.

Configuration Schema

Configuration Properties (5)

googleApiKey*string
googleApiKey

Your Google Cloud API key with access to the Translation API

Constraints: minLength: 1
maxMessageLengthnumber
maxMessageLength

Maximum length of messages that will be translated (to control API costs)

Default: 500
Constraints: min: 1
enabledByDefaultboolean
enabledByDefault

If true, all new players will automatically receive translated messages in English

Default: false
defaultLanguagestring
defaultLanguage

The default language code to use if enabledByDefault is true

Default: en
supportedLanguagesarray
supportedLanguages

List of supported language codes for translation

Default:Array of 14 items
"en"
"es"
... and 12 more items

UI Schema

No UI schema defined. Configuration form will use default rendering.

About Configuration Schemas

The Configuration Schema defines the structure and validation rules for module settings. The UI Schema customizes how the configuration form is displayed in the Takaro interface, including field ordering, labels, and input types.

Commands (6)

These commands can be executed by players in-game. Each command has a trigger word, optional arguments, and executes JavaScript code on the server.

setlanguage

/setlanguageTrigger Command

Description

No help text available

Arguments (1)

language
stringPosition 0
Help: Set your language
Default: ""

Function Implementation

setlanguage Function

JAVASCRIPT

Usage Example

Player types: /setlanguage <language>

translateme

/translatemeTrigger Command

Description

Translate recent messages from a specific player into your preferred language. Specify a number to translate multiple messages.

Arguments (2)

targetPlayerName
stringPosition 0
Help: player name
Default: ""
count
stringPosition 1
Help: Number of most recent messages to translate (default: 1)
Default: "1"

Function Implementation

translateme Function

JAVASCRIPT

Usage Example

Player types: /translateme <targetPlayerName> <count>

gettranslation

/translatemeTrigger Command

Description

No help text available

Arguments (1)

targetPlayerName
stringPosition 0
Help: player name
Default: ""

Function Implementation

gettranslation Function

JAVASCRIPT

Usage Example

Player types: /translateme <targetPlayerName>

toggletranslation

/toggletranslationTrigger Command

Description

Enable or disable automatic translation of messages. Use 'toggletranslation on' to receive translated messages, 'toggletranslation off' to disable.

Arguments (1)

status
stringPosition 0
Help: on/off to enable/disable translations
Default: "off"

Function Implementation

toggletranslation Function

JAVASCRIPT

Usage Example

Player types: /toggletranslation <status>

translate

/translateTrigger Command

Description

No help text available

Arguments (2)

language
stringPosition 0
Help: what language you want to translate to?
Default: ""
text
stringPosition 1
Help: The text that you want to translate
Default: ""

Function Implementation

translate Function

JAVASCRIPT

Usage Example

Player types: /translate <language> <text>

setplayerlanguage

/setplayerlanguageTrigger Command

Description

No help text available

Arguments (2)

targetPlayer
stringPosition 0
Help: Name of the player to set language for
Default: ""
language
stringPosition 1
Help: Language code to set (e.g., 'en' for English)
Default: ""

Function Implementation

setplayerlanguage Function

JAVASCRIPT

Usage Example

Player types: /setplayerlanguage <targetPlayer> <language>

About Module Commands

Commands allow players to interact with your module through chat. Each command has a trigger word that players type (prefixed with /), optional arguments for parameters, and a JavaScript function that executes when the command is used. Arguments are automatically validated and passed to the function.

Hooks (3)

These hooks respond to various game events automatically. Each hook executes JavaScript code when its specific event type occurs, allowing modules to react to player actions, system changes, and more.

Real-time Events

2 hooks

auto-translate

chat-messageEvent Type
Function Implementation

auto-translate Hook Function

JAVASCRIPT
Event Details
Event Type:chat-message
Trigger:Automatic
Category:Real-time Events

trasnslator active

player-connectedEvent Type
Description
Player cconnected
Pattern Match
takaro-hook-regex-placeholder

This hook only triggers when the event data matches this regular expression pattern.

Function Implementation

trasnslator active Hook Function

JAVASCRIPT
Event Details
Event Type:player-connected
Trigger:Pattern Match Required
Category:Real-time Events

System Events

1 hook

transslator deactivate

logEvent Type
Pattern Match
takaro-hook-regex-placeholder

This hook only triggers when the event data matches this regular expression pattern.

Function Implementation

transslator deactivate Hook Function

JAVASCRIPT
Event Details
Event Type:log
Trigger:Pattern Match Required
Category:System Events

About Module Hooks

Hooks allow your module to respond automatically to game events like player actions, server status changes, and chat messages. Each hook has an event type that determines when it triggers, optional regex patterns for filtering specific events, and a JavaScript function that executes when the conditions are met. Hooks are grouped by category for better organization.

Permissions (2)

These permissions control who can access different features of this module. Administrators can assign these permissions to roles, allowing fine-grained access control.

General Permissions

2 permissions

Admin Set Language

TRANSLATE_ADMINPermission Key
Description

Admins can set language

Permission Details
Full Key:TRANSLATE_ADMIN
Can Have Count:No
Category:General

TRANSLATE_PERMISSION

TRANSLATE_PERMISSIONPermission Key
Description

Give players Translate permission

Permission Details
Full Key:TRANSLATE_PERMISSION
Can Have Count:No
Category:General

About Module Permissions

Permissions control access to module features and functionality. Each permission has a unique key for identification, a friendly name for display, and a description explaining what it allows. Some permissions are countable, meaning they can have numeric values or limits assigned. Administrators assign these permissions to user roles to control who can use different module features.