diff --git a/patches/add-translations-for-server-errors/matrix-react-sdk+3.68.0.patch b/patches/add-translations-for-server-errors/matrix-react-sdk+3.68.0.patch new file mode 100644 index 0000000000..f36e1feecb --- /dev/null +++ b/patches/add-translations-for-server-errors/matrix-react-sdk+3.68.0.patch @@ -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") { diff --git a/patches/patches.json b/patches/patches.json index f167f77cc1..c306898dfa 100644 --- a/patches/patches.json +++ b/patches/patches.json @@ -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" + ] } } \ No newline at end of file diff --git a/src/i18n/strings/tchap_translations.json b/src/i18n/strings/tchap_translations.json index a6f7c59cc7..3d73b405e2 100644 --- a/src/i18n/strings/tchap_translations.json +++ b/src/i18n/strings/tchap_translations.json @@ -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." } }