-
Notifications
You must be signed in to change notification settings - Fork 239
feat(i18n): implement localisation (#197) #324
Conversation
…hout the need to override i18next options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much, locale was the only thing that kept me from using Commando for all my bots since some are specifically made for my non-english server. I used a patch workaround but I really do think this PR will be very useful.
when you plan to merge it? I'm waiting this feature. |
export class CommandoGuild extends Guild { | ||
private _commandPrefix: string; | ||
private _language: string; | ||
private _commandsEnabled: object; | ||
private _groupsEnabled: object; | ||
private _settings: GuildSettingsHelper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public language: string;
is required
feat: update to v12
After a conversation with @Gawdl3y I started to rewrite the code to implement the Loader/Loadable functionality according to the ideas from #196, but I had no time to complete the work. I've reviewed my changes and pushed what I have so far, but I did not have time yet to test it and there are some changes I want to make. Since the code isn't ready to merge, I'll close this PR and re open it when I'm done. |
This Feature implements:
To translate commando into your language simply do the following:
Create a language file by using the included util
createTranslationFile
found in src/i18n/dev.jsCreate a folder for each language and place the language file just created into it
Define the translation settings in the
CommandoClient#options
like:Learn how to use translations
I've created a guide on repl.it where you have a playground with a working example of commando with translations.