Skip to content

Commit f75d410

Browse files
authored
Fix i18n of message when a setting is disabled (#30646)
The function was supposed to return an i18ned string but lacked a _t
1 parent 7010190 commit f75d410

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/settings/SettingsStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export default class SettingsStore {
340340
}
341341

342342
/**
343-
* Retrieves the reason a setting is disabled if one is assigned.
343+
* Retrieves the internationalised reason a setting is disabled if one is assigned.
344344
* If a setting is not disabled, or no reason is given by the `SettingController`,
345345
* this will return undefined.
346346
* @param {string} settingName The setting to look up.

src/settings/controllers/ServerSupportUnstableFeatureController.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import MatrixClientBackedController from "./MatrixClientBackedController";
1111
import { type WatchManager } from "../WatchManager";
1212
import SettingsStore from "../SettingsStore";
1313
import { type SettingKey } from "../Settings.tsx";
14+
import { _t, type TranslationKey } from "../../languageHandler.tsx";
1415

1516
/**
1617
* Disables a given setting if the server unstable feature it requires is not supported
@@ -33,7 +34,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
3334
private readonly watchers: WatchManager,
3435
private readonly unstableFeatureGroups: string[][],
3536
private readonly stableVersion?: string,
36-
private readonly disabledMessage?: string,
37+
private readonly disabledMessage?: TranslationKey,
3738
private readonly forcedValue: any = false,
3839
) {
3940
super();
@@ -96,7 +97,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
9697

9798
public get settingDisabled(): boolean | string {
9899
if (this.disabled) {
99-
return this.disabledMessage ?? true;
100+
return this.disabledMessage ? _t(this.disabledMessage) : true;
100101
}
101102
return false;
102103
}

0 commit comments

Comments
 (0)