This repository was archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d15e609
Add /jumptodate slash command
MadLittleMods d1a637b
Add jump to date feature flag
MadLittleMods 3c7155c
Fix lints
MadLittleMods 5984c1f
Trigger Build
MadLittleMods 9573eb1
Only show jump to date feature flag when your homserver supports it
MadLittleMods ccf9473
Add date format examples
MadLittleMods 5e3acdb
Fix lints
MadLittleMods e4af78b
Add translatable error
MadLittleMods dddae93
Add fixme to use newTranslatableError in the near future
MadLittleMods de661a6
Fix lints
MadLittleMods a4c3601
Ignore long string
MadLittleMods 05db65a
Revert "Ignore long string"
MadLittleMods 5e5c1af
Ignore long string
MadLittleMods 50ecd8c
Make slash command errors translatable but also work in rageshakes
MadLittleMods cd17889
Merge branch 'develop' into madlittlemods/translatable-slash-command-…
MadLittleMods ac05a8e
Translate the rest of the errors
MadLittleMods 6af8008
Update i18n strings
MadLittleMods 89bb9d4
Better room not found errors
MadLittleMods e35ea1b
Better language
MadLittleMods 23a74bf
Fix wrong error
MadLittleMods a93107a
Add newTranslatableError as a translatable function
MadLittleMods 46e55c7
Merge branch 'develop' into madlittlemods/translatable-slash-command-…
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. wondering if we should shorten this to match other funcs, maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const error = new Error(message) as ITranslatableError; | ||
| error.translatedMessage = _t(message); | ||
| error.translatedMessage = _t(message, variables); | ||
| return error; | ||
| } | ||
|
|
||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.