Fix i18n of message when a setting is disabled (#30646)

The function was supposed to return an i18ned string but lacked a _t
This commit is contained in:
David Baker
2025-08-29 10:18:37 +01:00
committed by GitHub
parent 701019052c
commit f75d41054f
2 changed files with 4 additions and 3 deletions

View File

@@ -340,7 +340,7 @@ export default class SettingsStore {
} }
/** /**
* Retrieves the reason a setting is disabled if one is assigned. * Retrieves the internationalised reason a setting is disabled if one is assigned.
* If a setting is not disabled, or no reason is given by the `SettingController`, * If a setting is not disabled, or no reason is given by the `SettingController`,
* this will return undefined. * this will return undefined.
* @param {string} settingName The setting to look up. * @param {string} settingName The setting to look up.

View File

@@ -11,6 +11,7 @@ import MatrixClientBackedController from "./MatrixClientBackedController";
import { type WatchManager } from "../WatchManager"; import { type WatchManager } from "../WatchManager";
import SettingsStore from "../SettingsStore"; import SettingsStore from "../SettingsStore";
import { type SettingKey } from "../Settings.tsx"; import { type SettingKey } from "../Settings.tsx";
import { _t, type TranslationKey } from "../../languageHandler.tsx";
/** /**
* Disables a given setting if the server unstable feature it requires is not supported * Disables a given setting if the server unstable feature it requires is not supported
@@ -33,7 +34,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
private readonly watchers: WatchManager, private readonly watchers: WatchManager,
private readonly unstableFeatureGroups: string[][], private readonly unstableFeatureGroups: string[][],
private readonly stableVersion?: string, private readonly stableVersion?: string,
private readonly disabledMessage?: string, private readonly disabledMessage?: TranslationKey,
private readonly forcedValue: any = false, private readonly forcedValue: any = false,
) { ) {
super(); super();
@@ -96,7 +97,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
public get settingDisabled(): boolean | string { public get settingDisabled(): boolean | string {
if (this.disabled) { if (this.disabled) {
return this.disabledMessage ?? true; return this.disabledMessage ? _t(this.disabledMessage) : true;
} }
return false; return false;
} }