@skeldjs/translations
TypeScript icon, indicating that this package has built-in type declarations

2.15.49 • Public • Published

@skeldjs/translations

Utlities for translation keys in Among Us, such as synthesising quick chat messages into a single string. Meant to be installed separately with npm install --save @skeldjs/translations or yarn add @skeldjs/translations, and is one package of a bigger project, skeldjs.

You can view auto-updating documentation for this package hosted at github pages at https://skeld.js.org/modules/translations.html

Basic Usage

client.on("meeting.votingcomplete", ev => {
    if (ev.ejected) {
        console.log(translation.formatString(StringNames.ExileTextNonConfirm, [ ev.ejected ], Language.English));
    } else {
        if (ev.tie) {
            console.log(translation.getTranslation(StringNames.NoExileTie, Language.English));
        } else {
            console.log(translation.getTranslation(StringNames.NoExileSkip, Language.English));
        }
    }
});

Advanced Usage

import { GameCode } from "@skeldjs/util";
import { TranslationController } from "@skeldjs/translations";

import * as skeldjs from "@skeldjs/client";
import { Language } from "@skeldjs/client";

(async () => {
    const client = new skeldjs.SkeldjsClient("2021.6.30s");
    const translation = new TranslationController(client);

    console.log("Connecting to server..");
    await client.connect("EU", "weakeyes");

    console.log("Creating game..");
    const code = await client.createGame(
        {
            maxPlayers: 10,
            map: skeldjs.GameMap.MiraHQ,
            numImpostors: 2
        }
    );

    client.on("player.quickchat", ev => {
        console.log(translation.serializeQuickChat(ev.chatMessage, Language.English));
    });

    console.log(
        "Created game @ " +
            GameCode.convertV2IntToString(code) +
            " on EU servers"
    );
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @skeldjs/translations

Weekly Downloads

1

Version

2.15.49

License

GPL-3.0-only

Unpacked Size

2.6 MB

Total Files

18

Last publish

Collaborators

  • topsno