Add Français (FR) to the language drop-down

Problem: The FR translation is added in `i18n.js` but it's not available
in the drop-down language selection menu.

Solution: Add it to the menu and ensure that the menu is sorted
alphabetically by the name of the language.
This commit is contained in:
Christian Bundy 2020-04-13 10:22:14 -07:00
parent 40292a74e1
commit 81c03bebde
1 changed files with 7 additions and 5 deletions

View File

@ -820,7 +820,7 @@ exports.settingsView = ({ status, peers, theme, themeNames, version }) => {
})
);
const languageOption = (shortName, longName) =>
const languageOption = (longName, shortName) =>
shortName === selectedLanguage
? option({ value: shortName, selected: true }, longName)
: option({ value: shortName }, longName);
@ -855,11 +855,13 @@ exports.settingsView = ({ status, peers, theme, themeNames, version }) => {
form(
{ action: "/language", method: "post" },
select({ name: "language" }, [
// Languages are sorted alphabetically by their 'long name'.
/* cspell:disable */
languageOption("en", "English"),
languageOption("es", "Español"),
languageOption("it", "Italiano"),
languageOption("de", "Deutsch"),
languageOption("Deutsch", "de"),
languageOption("English", "en"),
languageOption("Español", "es"),
languageOption("Français", "fr"),
languageOption("Italiano", "it"),
/* cspell:enable */
]),
button({ type: "submit" }, i18n.setLanguage)