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

Add translation for server error "You are not invited to this room" #515

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/matrix-react-sdk/src/stores/RoomViewStore.tsx b/node_modules/matrix-react-sdk/src/stores/RoomViewStore.tsx
index 47bc9b9..05902fd 100644
--- a/node_modules/matrix-react-sdk/src/stores/RoomViewStore.tsx
+++ b/node_modules/matrix-react-sdk/src/stores/RoomViewStore.tsx
@@ -581,6 +581,12 @@ export class RoomViewStore extends EventEmitter {
let description: ReactNode = err.message ? err.message : JSON.stringify(err);
logger.log("Failed to join room:", description);

+ /* :TCHAP: add this for a translation */
+ if (typeof description === 'string' && description.includes('You are not invited to this room')) {
+ description = _t("Access possible only by invitation of a member of the room.");
+ }
+ /* end :TCHAP: */
+
if (err.name === "ConnectionError") {
description = _t("There was an error joining.");
} else if (err.errcode === "M_INCOMPATIBLE_ROOM_VERSION") {
7 changes: 7 additions & 0 deletions patches/patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,12 @@
"src/stores/widgets/WidgetLayoutStore.ts",
"src/utils/device/clientInformation.ts"
]
},
"add-translations-for-server-errors": {
"github-issue": "https://github.com/tchapgouv/tchap-web-v4/issues/485",
"package": "matrix-react-sdk",
"files": [
"src/stores/RoomViewStore.tsx"
]
}
}
8 changes: 8 additions & 0 deletions src/i18n/strings/tchap_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -814,5 +814,13 @@
"Generate a new code": {
"fr": "Générer un nouveau code",
"en": "Generate a new code"
},
"Failed to join": {
"fr": "Impossible de rejoindre ce salon",
"en": "Failed to join this room."
},
"Access possible only by invitation of a member of the room.": {
"fr": "Accès possible uniquement sur invitation d'un membre du salon.",
"en": "Access possible only by invitation of a member of the room."
}
}