This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Make slash command errors translatable but also work in rageshakes #7377
Merged
MadLittleMods
merged 22 commits into
develop
from
madlittlemods/translatable-slash-command-errors
Jan 11, 2022
Merged
Make slash command errors translatable but also work in rageshakes #7377
MadLittleMods
merged 22 commits into
develop
from
madlittlemods/translatable-slash-command-errors
Jan 11, 2022
Conversation
This file contains 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
Fix element-hq/element-web#7677 Utilizing MSC3030: matrix-org/matrix-spec-proposals#3030 Experimental Synapse implementation added in matrix-org/synapse#9445
This reverts commit a4c3601.
See #7372 (comment) We want the error to be translated for the user but not in our rageshake logs
…errors Conflicts: src/SlashCommands.tsx
MadLittleMods
commented
Dec 15, 2021
MadLittleMods
added
the
T-Task
Refactoring, enabling or disabling functionality, other engineering tasks
label
Dec 15, 2021
MadLittleMods
commented
Dec 15, 2021
MadLittleMods
commented
Dec 15, 2021
MadLittleMods
commented
Dec 15, 2021
MadLittleMods
changed the title
Draft: Make slash command errors translatable but also work in rageshakes
Make slash command errors translatable but also work in rageshakes
Dec 15, 2021
t3chguy
suggested changes
Dec 15, 2021
MadLittleMods
added a commit
to MadLittleMods/matrix-web-i18n
that referenced
this pull request
Dec 16, 2021
…json See matrix-org/matrix-react-sdk#7377 (comment) `package.json`: ```json { // ... "matrix_i18n_extra_translation_funcs": [ "newTranslatableError" ] // ... } ```
t3chguy
reviewed
Dec 16, 2021
MadLittleMods
added a commit
to matrix-org/matrix-web-i18n
that referenced
this pull request
Jan 11, 2022
…json (#3) See matrix-org/matrix-react-sdk#7377 (comment) `package.json`: ```json { // ... "matrix_i18n_extra_translation_funcs": [ "newTranslatableError" ] // ... } ```
…errors Conflicts: yarn.lock
t3chguy
approved these changes
Jan 11, 2022
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.
LGTM otherwise
@@ -53,9 +53,9 @@ interface ITranslatableError extends Error { | |||
* @param {string} message Message to translate. | |||
* @returns {Error} The constructed error. | |||
*/ | |||
export function newTranslatableError(message: string) { | |||
export function newTranslatableError(message: string, variables?: IVariables): ITranslatableError { |
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.
wondering if we should shorten this to match other funcs, maybe _tError
or similar
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.
_tError
seems reasonable 👍 but I'll leave that taste making to you for another PR
MadLittleMods
deleted the
madlittlemods/translatable-slash-command-errors
branch
January 11, 2022 18:25
Thanks for the review @t3chguy 🦓 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Make slash command errors translatable but also work in rageshakes. We want the error to be translated for the user but not in our rageshake logs.
Also updates some error messages to give more info.
Follow-up to #7372 (comment)
Depends on matrix-org/matrix-web-i18n#3
This change is marked as an internal change (Task), so will not be included in the changelog.
Preview: https://61dd2f2fc259a9b4046f3e88--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.