Make hotkey documentation fully translatable

This commit is contained in:
Pieter Vander Vennet 2023-01-11 01:37:44 +01:00
parent 8c5654f9f7
commit 648a9e63c9
3 changed files with 11 additions and 5 deletions

View file

@ -7,6 +7,7 @@ import { UIEventSource } from "../../Logic/UIEventSource"
import { VariableUiElement } from "./VariableUIElement" import { VariableUiElement } from "./VariableUIElement"
import { Translation } from "../i18n/Translation" import { Translation } from "../i18n/Translation"
import { FixedUiElement } from "./FixedUiElement" import { FixedUiElement } from "./FixedUiElement"
import Translations from "../i18n/Translations"
export default class Hotkeys { export default class Hotkeys {
private static readonly _docs: UIEventSource< private static readonly _docs: UIEventSource<
@ -106,11 +107,12 @@ export default class Hotkeys {
return <[string, string | Translation]>[modifiers.join("+"), documentation] return <[string, string | Translation]>[modifiers.join("+"), documentation]
}) })
.sort() .sort()
const t = Translations.t.hotkeyDocumentation
return new Combine([ return new Combine([
new Title("Hotkeys", 1), new Title(t.title, 1),
"MapComplete supports the following keys:", t.intro,
new Table( new Table(
["Key combination", "Action"], [t.key, t.action],
byKey.map(([key, doc]) => { byKey.map(([key, doc]) => {
return [new FixedUiElement(key).SetClass("code"), doc] return [new FixedUiElement(key).SetClass("code"), doc]
}) })

View file

@ -263,4 +263,4 @@
"fr": "Une couche affichant les lieux où l'on peut nettoyer son vélo", "fr": "Une couche affichant les lieux où l'on peut nettoyer son vélo",
"cs": "Vrstva zobrazující zařízení, kde si můžete umýt kolo" "cs": "Vrstva zobrazující zařízení, kde si můžete umýt kolo"
} }
} }

View file

@ -356,12 +356,16 @@
} }
}, },
"hotkeyDocumentation": { "hotkeyDocumentation": {
"action": "Action",
"closeSidebar": "Close the sidebar", "closeSidebar": "Close the sidebar",
"geolocate": "Pan the map to the current location or zoom the map to the current location. Requests geopermission", "geolocate": "Pan the map to the current location or zoom the map to the current location. Requests geopermission",
"intro": "MapComplete supports the following keys:",
"key": "Key combination",
"openLayersPanel": "Opens the Background, layers and filters panel", "openLayersPanel": "Opens the Background, layers and filters panel",
"selectBackground": "Select a background layer of category {category}", "selectBackground": "Select a background layer of category {category}",
"selectMapnik": "Sets the background layer to OpenStreetMap-carto", "selectMapnik": "Sets the background layer to OpenStreetMap-carto",
"selectSearch": "Select the search bar to search locations" "selectSearch": "Select the search bar to search locations",
"title": "Hotkeys"
}, },
"image": { "image": {
"addPicture": "Add picture", "addPicture": "Add picture",