Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 89fe0c5

Browse files
authored
Merge branch 'develop' into toger5/fix-link-modal-not-shown-after-access-upgrade
2 parents 2610aee + c40fea0 commit 89fe0c5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/views/settings/SpellCheckSettings.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ import React from "react";
1818

1919
import SpellCheckLanguagesDropdown from "../../../components/views/elements/SpellCheckLanguagesDropdown";
2020
import AccessibleButton, { ButtonEvent } from "../../../components/views/elements/AccessibleButton";
21-
import { _t } from "../../../languageHandler";
21+
import { _t, getUserLanguage } from "../../../languageHandler";
2222

2323
interface ExistingSpellCheckLanguageIProps {
2424
language: string;
25+
/**
26+
* The label to render on the component. If not provided, the language code will be used.
27+
*/
28+
label?: string;
2529
onRemoved(language: string): void;
2630
}
2731

@@ -45,7 +49,9 @@ export class ExistingSpellCheckLanguage extends React.Component<ExistingSpellChe
4549
public render(): React.ReactNode {
4650
return (
4751
<div className="mx_ExistingSpellCheckLanguage">
48-
<span className="mx_ExistingSpellCheckLanguage_language">{this.props.language}</span>
52+
<span className="mx_ExistingSpellCheckLanguage_language">
53+
{this.props.label ?? this.props.language}
54+
</span>
4955
<AccessibleButton onClick={this.onRemove} kind="danger_sm">
5056
{_t("action|remove")}
5157
</AccessibleButton>
@@ -87,8 +93,9 @@ export default class SpellCheckLanguages extends React.Component<SpellCheckLangu
8793
};
8894

8995
public render(): React.ReactNode {
96+
const intl = new Intl.DisplayNames([getUserLanguage()], { type: "language", style: "short" });
9097
const existingSpellCheckLanguages = this.props.languages.map((e) => {
91-
return <ExistingSpellCheckLanguage language={e} onRemoved={this.onRemoved} key={e} />;
98+
return <ExistingSpellCheckLanguage language={e} label={intl.of(e)} onRemoved={this.onRemoved} key={e} />;
9299
});
93100

94101
const addButton = (

0 commit comments

Comments
 (0)