diff --git a/frontend/ui/data/keyboardlayouts/da_keyboard.lua b/frontend/ui/data/keyboardlayouts/da_keyboard.lua new file mode 100644 index 000000000..ea6a0df3e --- /dev/null +++ b/frontend/ui/data/keyboardlayouts/da_keyboard.lua @@ -0,0 +1,10 @@ +-- Start with the norwegian keyboard layout (deep copy, to not alter it) +local da_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/no_keyboard")) + +local keys = da_keyboard.keys + +-- swap "Ø" and "Æ", and "ø" and "æ" +keys[3][10][1], keys[3][11][1] = keys[3][11][1], keys[3][10][1] +keys[3][10][2], keys[3][11][2] = keys[3][11][2], keys[3][10][2] + +return da_keyboard diff --git a/frontend/ui/data/keyboardlayouts/no_keyboard.lua b/frontend/ui/data/keyboardlayouts/no_keyboard.lua new file mode 100644 index 000000000..0c8930d7e --- /dev/null +++ b/frontend/ui/data/keyboardlayouts/no_keyboard.lua @@ -0,0 +1,81 @@ +-- Start with the english keyboard layout (deep copy, to not alter it) +local no_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/en_keyboard")) + +local keys = no_keyboard.keys + +-- add ' key next to numeric 0 +table.insert( + keys[1], + { + { "*", alt_label = "'", north = "'", }, + { "'", alt_label = "*", north = "*", }, + { "/", alt_label = "÷", north = "÷", }, + { "÷", alt_label = "/", north = "/", }, + } +) + +-- add Å key +table.insert( + keys[2], + { + { "Å", north = "å", }, + { "å", north = "Å", }, + { "*", alt_label = "×", north = "×", }, + { "×", alt_label = "*", north = "*", }, + } +) + +-- add Æ key +table.insert( + keys[3], + { + { "Æ", north = "æ", }, + { "æ", north = "Æ", }, + { "✗", north = "✘", west = "☐", south = "☒", }, + { + "⭤", + north = "⭡", + northeast = "⭧", + northwest = "⭦", + east = "⭢", + west = "⭠", + south = "⭣", + southeast = "⭨", + southwest = "⭩", + }, + } +) + +-- add Ø key +table.insert( + keys[4], + 7, + { + { "Ø", north = "ø", }, + { "ø", north = "Ø", }, + { "✓", north = "✔", west = "☐", south = "☑", }, + { "•", alt_label = "◦", north = "◦", northwest = "⁃", west = "‣", }, + } +) + +-- swap "Ø" and ";" / "ø" and "," +keys[4][7][1], keys[3][10][1] = keys[3][10][1], keys[4][7][1] +keys[4][7][2], keys[3][10][2] = keys[3][10][2], keys[4][7][2] + +-- swap ";" and "✓" / "," and "•" +keys[4][7][3], keys[3][10][3] = keys[3][10][3], keys[4][7][3] +keys[4][7][4], keys[3][10][4] = keys[3][10][4], keys[4][7][4] + +-- change order ", n m" to "n m ," +keys[4][7][1], keys[4][8][1], keys[4][9][1] = keys[4][8][1], keys[4][9][1], keys[4][7][1] +keys[4][7][2], keys[4][8][2], keys[4][9][2] = keys[4][8][2], keys[4][9][2], keys[4][7][2] + +-- Rename "space" and resize buttons +keys[5][4].label = "␣" -- label the Spacebar with Unicode space symbol +keys[4][1].width = 1.5 -- resize Shift +keys[4][10].width = 1.5 -- resize Backspace +keys[5][4].width = 4 -- resize Spacebar +keys[5][1].width = 1.5 -- resize Symbols +keys[5][7].width = 1.5 -- resize Enter + +return no_keyboard diff --git a/frontend/ui/data/keyboardlayouts/sv_keyboard.lua b/frontend/ui/data/keyboardlayouts/sv_keyboard.lua new file mode 100644 index 000000000..079654b16 --- /dev/null +++ b/frontend/ui/data/keyboardlayouts/sv_keyboard.lua @@ -0,0 +1,14 @@ +-- Start with the norwegian keyboard layout (deep copy, to not alter it) +local sv_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/no_keyboard")) + +local keys = sv_keyboard.keys + +-- replace "Ø" and "ø" with "Ö" and "ö" +keys[3][10][1] = { "Ö", north = "ö", } +keys[3][10][2] = { "ö", north = "Ö", } + +-- replace "Æ" and "æ" with "Ä" and "ä" +keys[3][11][1] = { "Ä", north = "ä", } +keys[3][11][2] = { "ä", north = "Ä", } + +return sv_keyboard diff --git a/frontend/ui/language.lua b/frontend/ui/language.lua index 4e7edd709..25f30003d 100644 --- a/frontend/ui/language.lua +++ b/frontend/ui/language.lua @@ -8,6 +8,7 @@ local Language = { en = "English", ca = "Catalá", cs = "Čeština", + da = "Dansk", de = "Deutsch", eo = "Esperanto", es = "Español", @@ -22,7 +23,7 @@ local Language = { lt_LT = "Lietuvių", lv = "Latviešu", nl_NL = "Nederlands", - nb_NO = "Norsk", + nb_NO = "Norsk bokmål", pl = "Polski", pl_PL = "Polski2", pt_PT = "Português", diff --git a/frontend/ui/widget/virtualkeyboard.lua b/frontend/ui/widget/virtualkeyboard.lua index 75b4c60b9..4d9f8befd 100644 --- a/frontend/ui/widget/virtualkeyboard.lua +++ b/frontend/ui/widget/virtualkeyboard.lua @@ -799,6 +799,7 @@ local VirtualKeyboard = FocusManager:extend{ ar = "ar_keyboard", bg_BG = "bg_keyboard", bn = "bn_keyboard", + da = "da_keyboard", de = "de_keyboard", el = "el_keyboard", en = "en_keyboard", @@ -809,11 +810,13 @@ local VirtualKeyboard = FocusManager:extend{ ja = "ja_keyboard", ka = "ka_keyboard", ko_KR = "ko_KR_keyboard", + nb_NO = "no_keyboard", pl = "pl_keyboard", pt_BR = "pt_keyboard", ro = "ro_keyboard", ru = "ru_keyboard", sk = "sk_keyboard", + sv = "sv_keyboard", th = "th_keyboard", tr = "tr_keyboard", uk = "uk_keyboard",