feat: add plugin-i18next#29
Merged
favna merged 21 commits intosapphiredev:mainfrom Jan 1, 2021
Quantumlyy:feat/added/in17n
Merged
feat: add plugin-i18next#29favna merged 21 commits intosapphiredev:mainfrom Quantumlyy:feat/added/in17n
favna merged 21 commits intosapphiredev:mainfrom
Quantumlyy:feat/added/in17n
Conversation
Stitch07
suggested changes
Dec 24, 2020
kyranet
previously requested changes
Dec 28, 2020
favna
requested changes
Dec 28, 2020
favna
requested changes
Dec 28, 2020
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This implements many changes. In17n was renamed to I18next entirely. On this basis: In17nHandler -> I18nextHandler; In17nOptions -> I18nOptions. In17nMessage is no longer exported, and instead the discord.js exclusive augmentation is removed by default in order to be framework agnostic. It can still be accessed via `@sapphire/plugin-i18next/register-discordjs`, though, which adds: Client.i18n; Client#fetchLanguage; Message#sendTranslated; Message#fetchT; Message#fetchLanguageKey; Message#fetchLanguage. The standard `@sapphire/plugin-i18next/register` implements only the Sapphire augmentations (SapphireClient.i18n, SapphireClient#fetchLanguage), and leaves the rest down to the user, for framework agnosticism. Documentation is added and (incomplete) unit testing also with this commit. BREAKING CHANGE: All aforementioned changes are breaking. RE #29
favna
requested changes
Jan 1, 2021
favna
requested changes
Jan 1, 2021
Member
favna
left a comment
There was a problem hiding this comment.
I also don't know if the file actually has no whitelines in the shell script part or if that's just GitHub, if it doesn't then please match the other files.
Also rename the file itself to cd-i18next.yml
favna
requested changes
Jan 1, 2021
favna
requested changes
Jan 1, 2021
favna
approved these changes
Jan 1, 2021
Nytelife26
added a commit
that referenced
this pull request
Jan 1, 2021
Prior to this, Message#sendTranslated would always send a new message. Now, it has been relocated to Message#translated, and an edit (boolean) parameter has been added which denotes whether to edit the message or send a new one. BREAKING CHANGE: Message#sendTranslated -> Message#translated RE #29
Nytelife26
added a commit
that referenced
this pull request
Jan 3, 2021
* fix(i18next): correct misnomer * feat(i18next): add message editing for user convenience * chore(i18next): lint * refactor(i18next): implement context scope Message#translated was deleted following discussion with maintainers. This commit adds Message#replyTranslated, Message#editTranslated, Channel#sendTranslated, and implements full localisation context suites for all of them. It also adds an I18nContext object, which stores guilds, authors and channels to enable a per-server, per-user and per-channel localisation capacity. BREAKING CHANGE: All aforementioned changes are breaking. RE #29 * feat(i18next): augment all channel types * feat(i18next): augment context and use client This adds I18nGuildContext, I18nChannelContext, and I18nAuthorContext as augmentable interfaces. It also changes `#fetchLanguage` to pass the client instead of binding for performance reasons. RE #29 * style(i18next): lint * docs(i18next): document context interfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.