Skip to content

Commit 48240ee

Browse files
committed
Move language name definitions into the keyboard layout files
1 parent 4d840b6 commit 48240ee

File tree

12 files changed

+59
-37
lines changed

12 files changed

+59
-37
lines changed

ui/src/keyboardLayouts.ts

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
import { chars as chars_cs_CZ } from "@/keyboardLayouts/cs_CZ"
2-
import { chars as chars_en_UK } from "@/keyboardLayouts/en_UK"
3-
import { chars as chars_en_US } from "@/keyboardLayouts/en_US"
4-
import { chars as chars_fr_FR } from "@/keyboardLayouts/fr_FR"
5-
import { chars as chars_de_DE } from "@/keyboardLayouts/de_DE"
6-
import { chars as chars_it_IT } from "@/keyboardLayouts/it_IT"
7-
import { chars as chars_nb_NO } from "@/keyboardLayouts/nb_NO"
8-
import { chars as chars_es_ES } from "@/keyboardLayouts/es_ES"
9-
import { chars as chars_sv_SE } from "@/keyboardLayouts/sv_SE"
10-
import { chars as chars_fr_CH } from "@/keyboardLayouts/fr_CH"
11-
import { chars as chars_de_CH } from "@/keyboardLayouts/de_CH"
1+
import { chars as chars_cs_CZ, name as name_cs_CZ } from "@/keyboardLayouts/cs_CZ"
2+
import { chars as chars_en_UK, name as name_en_UK } from "@/keyboardLayouts/en_UK"
3+
import { chars as chars_en_US, name as name_en_US } from "@/keyboardLayouts/en_US"
4+
import { chars as chars_fr_FR, name as name_fr_FR } from "@/keyboardLayouts/fr_FR"
5+
import { chars as chars_de_DE, name as name_de_DE } from "@/keyboardLayouts/de_DE"
6+
import { chars as chars_it_IT, name as name_it_IT } from "@/keyboardLayouts/it_IT"
7+
import { chars as chars_nb_NO, name as name_nb_NO } from "@/keyboardLayouts/nb_NO"
8+
import { chars as chars_es_ES, name as name_es_ES } from "@/keyboardLayouts/es_ES"
9+
import { chars as chars_sv_SE, name as name_sv_SE } from "@/keyboardLayouts/sv_SE"
10+
import { chars as chars_fr_CH, name as name_fr_CH } from "@/keyboardLayouts/fr_CH"
11+
import { chars as chars_de_CH, name as name_de_CH } from "@/keyboardLayouts/de_CH"
1212

1313
type KeyInfo = { key: string | number; shift?: boolean, altRight?: boolean }
1414
export type KeyCombo = KeyInfo & { deadKey?: boolean, accentKey?: KeyInfo }
1515

16-
export const layouts = {
17-
"cs_CZ": "Czech",
18-
"en_UK": "English (UK)",
19-
"en_US": "English (US)",
20-
"fr_FR": "French",
21-
"de_DE": "German",
22-
"it_IT": "Italian",
23-
"nb_NO": "Norwegian",
24-
"es_ES": "Spanish",
25-
"sv_SE": "Swedish",
26-
"fr_CH": "Swiss French",
27-
"de_CH": "Swiss German"
28-
} as Record<string, string>;
16+
export const layouts: Record<string, string> = {
17+
cs_CZ: name_cs_CZ,
18+
en_UK: name_en_UK,
19+
en_US: name_en_US,
20+
fr_FR: name_fr_FR,
21+
de_DE: name_de_DE,
22+
it_IT: name_it_IT,
23+
nb_NO: name_nb_NO,
24+
es_ES: name_es_ES,
25+
sv_SE: name_sv_SE,
26+
fr_CH: name_fr_CH,
27+
de_CH: name_de_CH,
28+
}
2929

30-
export const chars = {
31-
"cs_CZ": chars_cs_CZ,
32-
"en_UK": chars_en_UK,
33-
"en_US": chars_en_US,
34-
"fr_FR": chars_fr_FR,
35-
"de_DE": chars_de_DE,
36-
"it_IT": chars_it_IT,
37-
"nb_NO": chars_nb_NO,
38-
"es_ES": chars_es_ES,
39-
"sv_SE": chars_sv_SE,
40-
"fr_CH": chars_fr_CH,
41-
"de_CH": chars_de_CH,
42-
} as Record<string, Record <string, KeyCombo>>
30+
export const chars: Record<string, Record<string, KeyCombo>> = {
31+
cs_CZ: chars_cs_CZ,
32+
en_UK: chars_en_UK,
33+
en_US: chars_en_US,
34+
fr_FR: chars_fr_FR,
35+
de_DE: chars_de_DE,
36+
it_IT: chars_it_IT,
37+
nb_NO: chars_nb_NO,
38+
es_ES: chars_es_ES,
39+
sv_SE: chars_sv_SE,
40+
fr_CH: chars_fr_CH,
41+
de_CH: chars_de_CH,
42+
};

ui/src/keyboardLayouts/cs_CZ.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "Czech";
4+
35
const keyTrema = { key: "Backslash" } // tréma (umlaut), two dots placed above a vowel
46
const keyAcute = { key: "Equal" } // accent aigu (acute accent), mark ´ placed above the letter
57
const keyHat = { key: "Digit3", shift: true, altRight: true } // accent circonflexe (accent hat), mark ^ placed above the letter

ui/src/keyboardLayouts/de_CH.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "Swiss German";
4+
35
const keyTrema = { key: "BracketRight" } // tréma (umlaut), two dots placed above a vowel
46
const keyAcute = { key: "Minus", altRight: true } // accent aigu (acute accent), mark ´ placed above the letter
57
const keyHat = { key: "Equal" } // accent circonflexe (accent hat), mark ^ placed above the letter

ui/src/keyboardLayouts/de_DE.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "German";
4+
35
const keyAcute = { key: "Equal" } // accent aigu (acute accent), mark ´ placed above the letter
46
const keyHat = { key: "Backquote" } // accent circonflexe (accent hat), mark ^ placed above the letter
57
const keyGrave = { key: "Equal", shift: true } // accent grave, mark ` placed above the letter

ui/src/keyboardLayouts/en_UK.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "English (UK)";
4+
35
export const chars = {
46
A: { key: "KeyA", shift: true },
57
B: { key: "KeyB", shift: true },

ui/src/keyboardLayouts/en_US.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "English (US)";
4+
35
export const chars = {
46
A: { key: "KeyA", shift: true },
57
B: { key: "KeyB", shift: true },

ui/src/keyboardLayouts/es_ES.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "Spanish";
4+
35
const keyTrema = { key: "Quote", shift: true } // tréma (umlaut), two dots placed above a vowel
46
const keyAcute = { key: "Quote" } // accent aigu (acute accent), mark ´ placed above the letter
57
const keyHat = { key: "BracketRight", shift: true } // accent circonflexe (accent hat), mark ^ placed above the letter

ui/src/keyboardLayouts/fr_CH.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { KeyCombo } from "../keyboardLayouts"
22
import { chars as chars_de_CH } from "./de_CH"
33

4+
export const name = "Swiss French";
5+
46
export const chars = {
57
...chars_de_CH,
68
"è": { key: "BracketLeft" },

ui/src/keyboardLayouts/fr_FR.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "French";
4+
35
const keyTrema = { key: "BracketLeft", shift: true } // tréma (umlaut), two dots placed above a vowel
46
const keyHat = { key: "BracketLeft" } // accent circonflexe (accent hat), mark ^ placed above the letter
57

ui/src/keyboardLayouts/it_IT.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { KeyCombo } from "../keyboardLayouts"
22

3+
export const name = "Italian";
4+
35
export const chars = {
46
A: { key: "KeyA", shift: true },
57
B: { key: "KeyB", shift: true },

0 commit comments

Comments
 (0)