Migrate more strings to translation keys (#11665)

This commit is contained in:
Michael Telatynski 2023-09-25 18:12:41 +01:00 committed by GitHub
parent de250df520
commit 54c88c57ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
127 changed files with 6797 additions and 5825 deletions

View file

@ -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,
}),

View file

@ -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));