mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-10 05:01:24 +01:00
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:
parent
701019052c
commit
f75d41054f
@ -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`,
|
||||
* this will return undefined.
|
||||
* @param {string} settingName The setting to look up.
|
||||
|
||||
@ -11,6 +11,7 @@ import MatrixClientBackedController from "./MatrixClientBackedController";
|
||||
import { type WatchManager } from "../WatchManager";
|
||||
import SettingsStore from "../SettingsStore";
|
||||
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
|
||||
@ -33,7 +34,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
|
||||
private readonly watchers: WatchManager,
|
||||
private readonly unstableFeatureGroups: string[][],
|
||||
private readonly stableVersion?: string,
|
||||
private readonly disabledMessage?: string,
|
||||
private readonly disabledMessage?: TranslationKey,
|
||||
private readonly forcedValue: any = false,
|
||||
) {
|
||||
super();
|
||||
@ -96,7 +97,7 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
|
||||
|
||||
public get settingDisabled(): boolean | string {
|
||||
if (this.disabled) {
|
||||
return this.disabledMessage ?? true;
|
||||
return this.disabledMessage ? _t(this.disabledMessage) : true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user