Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Multilingual Support #650

Closed
AI-Avalon opened this issue Aug 27, 2021 · 4 comments · Fixed by #794
Closed

About Multilingual Support #650

AI-Avalon opened this issue Aug 27, 2021 · 4 comments · Fixed by #794
Labels

Comments

@AI-Avalon
Copy link
Contributor

Currently, JukeBox outputs in English, but I would like to see support for multiple languages.
I'm Japanese and I'm willing to translate it into Japanese, so I'd appreciate it if you would consider it.

@Hazmi35 Hazmi35 added enhancement New feature or request v5 wont-land-on-4.x labels Aug 30, 2021
@Hazmi35
Copy link
Owner

Hazmi35 commented Aug 30, 2021

Yes, this is planned in v5. Please see #628

@Hazmi35
Copy link
Owner

Hazmi35 commented Oct 19, 2021

This would be resolved with #794

@Hazmi35 Hazmi35 linked a pull request Oct 19, 2021 that will close this issue
@Hazmi35
Copy link
Owner

Hazmi35 commented Nov 8, 2021

Internationalization support is added in #794

How to use it:
Extend the lang to the default lang, en-US:

/* eslint-disable sort-keys */
import stripIndent from "strip-indent";
import pluralize from "plur";
import { lang as enUS } from "./en-US";

export const lang = {
    ...enUS, // Extend to the default lang
    
    // Language Metadata
    META_ID: () => "id-ID",

    // Commands

    // Help Command
    COMMAND_HELP_META_DESCRIPTION: () => "Munculkan menu bantuan",
    COMMAND_HELP_META_ARGS: (index: number) => ["Nama perintah"][index],
    COMMAND_HELP_EMBED_TITLE: () => "Menu bantuan",
    COMMAND_HELP_EMBED_FOOTER: (prefix: string) => `Pakai ${prefix}help <perintah> untuk mengetahuinya perintah lebih lanjut!`,
    COMMAND_HELP_EXTENDED_EMBED_TITLE: (name: string) => `Informasi untuk perintah ${name}`,
    COMMAND_HELP_EXTENDED_EMBED_CMD_NAME: () => "Nama",
    COMMAND_HELP_EXTENDED_EMBED_CMD_DESC: () => "Deskripsi",
    COMMAND_HELP_EXTENDED_EMBED_CMD_ALIASES: () => "Alias",
    COMMAND_HELP_EXTENDED_EMBED_CMD_USAGE: () => "Penggunaan",
};

Note that you don't need to define all the variables there, but it will use the one from enUS as a fallback instead.

@Hazmi35
Copy link
Owner

Hazmi35 commented Nov 8, 2021

Please see #831 as an example, you can ask here or on your Pull Request if there's any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants