You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Migrate more strings to translation keys (#11665)
This commit is contained in:
committed by
GitHub
parent
de250df520
commit
54c88c57ed
@@ -83,13 +83,13 @@ export class Command {
|
||||
public run(matrixClient: MatrixClient, roomId: string, threadId: string | null, args?: string): RunResult {
|
||||
// if it has no runFn then its an ignored/nop command (autocomplete only) e.g `/me`
|
||||
if (!this.runFn) {
|
||||
return reject(new UserFriendlyError("Command error: Unable to handle slash command."));
|
||||
return reject(new UserFriendlyError("slash_command|error_invalid_runfn"));
|
||||
}
|
||||
|
||||
const renderingType = threadId ? TimelineRenderingType.Thread : TimelineRenderingType.Room;
|
||||
if (this.renderingTypes && !this.renderingTypes?.includes(renderingType)) {
|
||||
return reject(
|
||||
new UserFriendlyError("Command error: Unable to find rendering type (%(renderingType)s)", {
|
||||
new UserFriendlyError("slash_command|error_invalid_rendering_type", {
|
||||
renderingType,
|
||||
cause: undefined,
|
||||
}),
|
||||
|
@@ -45,7 +45,7 @@ const updatePowerLevelHelper = (
|
||||
const room = client.getRoom(roomId);
|
||||
if (!room) {
|
||||
return reject(
|
||||
new UserFriendlyError("Command failed: Unable to find room (%(roomId)s", {
|
||||
new UserFriendlyError("slash_command|error_invalid_room", {
|
||||
roomId,
|
||||
cause: undefined,
|
||||
}),
|
||||
@@ -53,7 +53,7 @@ const updatePowerLevelHelper = (
|
||||
}
|
||||
const member = room.getMember(userId);
|
||||
if (!member?.membership || getEffectiveMembership(member.membership) === EffectiveMembership.Leave) {
|
||||
return reject(new UserFriendlyError("Could not find user in room"));
|
||||
return reject(new UserFriendlyError("slash_command|error_invalid_user_in_room"));
|
||||
}
|
||||
|
||||
return success(updatePowerLevel(room, member, powerLevel));
|
||||
|
Reference in New Issue
Block a user