From 7bd68b9e3946acae903b76e0906986625c7f882b Mon Sep 17 00:00:00 2001 From: Henrik Storch Date: Sat, 7 Oct 2023 21:17:40 +0200 Subject: [PATCH 1/2] Add support for scandinvaian languages - finish - danish - norwegian - swedish (cherry picked from commit 5b909d4dfbdceddbe9c9e47c5d6e818075e4a05c) --- Sources/SimpleKeyboard/Models/Language.swift | 33 +++++++++++++++++++ .../l10n/da.lproj/Localizable.strings | 12 +++++++ .../l10n/sv.lproj/Localizable.strings | 11 +++++++ 3 files changed, 56 insertions(+) create mode 100644 Sources/SimpleKeyboard/l10n/da.lproj/Localizable.strings create mode 100644 Sources/SimpleKeyboard/l10n/sv.lproj/Localizable.strings diff --git a/Sources/SimpleKeyboard/Models/Language.swift b/Sources/SimpleKeyboard/Models/Language.swift index e271530..1e1ff19 100644 --- a/Sources/SimpleKeyboard/Models/Language.swift +++ b/Sources/SimpleKeyboard/Models/Language.swift @@ -22,6 +22,7 @@ public enum Language: CaseIterable { } case english, german, spanish, french, russian, hindi + case swedish, danish, norwegian, finnish var alternateKeys: [String: String] { switch self { @@ -29,6 +30,11 @@ public enum Language: CaseIterable { // spanish also has ü case .spanish: return ["e": "é", "a": "á", "i": "í", "o": "ó", "u": "ú", "n": "ñ"] case .french: return ["e": "é", "a": "à", "u": "ù", "i": "î", "o": "ô", "c": "ç"] + // Nynorsk uses several letters with diacritic signs: é, è, ê, ó, ò, â, and ô. The diacritic signs are not compulsory + case .danish, .norwegian: return ["e": "é"] + // Though not in the official alphabet, á is a Swedish (old-fashioned) letter. In native Swedish personal names, ü and è and others are also used. + case .swedish: return ["a":"á", "u":"ü", "e": "è"] + case .finnish: return ["s": "š", "z": "ž"] default: return [:] } } @@ -72,6 +78,33 @@ public enum Language: CaseIterable { ["ो", "े", "्", "ि", "ु", "प", "र", "क", "त", "च"], ["ं", "म", "न", "व", "ल", "स", "य"] ] + case .swedish: + result = [ + ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å"], + ["a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä"], + ["z", "x", "c", "v", "b", "n", "m"] + ] + case .danish: + result = [ + ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å"], + ["a", "s", "d", "f", "g", "h", "j", "k", "l", "æ", "ø"], + ["z", "x", "c", "v", "b", "n", "m"] + ] + + case .norwegian: + result = [ + ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å"], + ["a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä"], + ["z", "x", "c", "v", "b", "n", "m"] + ] + + case .finnish: + result = [ + ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å"], + ["a", "s", "d", "f", "g", "h", "j", "k", "l", "ø", "æ"], + ["z", "x", "c", "v", "b", "n", "m"] + ] + } if areUppercased { diff --git a/Sources/SimpleKeyboard/l10n/da.lproj/Localizable.strings b/Sources/SimpleKeyboard/l10n/da.lproj/Localizable.strings new file mode 100644 index 0000000..07d16db --- /dev/null +++ b/Sources/SimpleKeyboard/l10n/da.lproj/Localizable.strings @@ -0,0 +1,12 @@ +"space" = "mellemrum"; + +"Up" = "St"; + +"lw" = "sm"; + +"Done!" = "Udført!"; + +"Search" = "Søg"; + +"Go!" = "Gå!"; + diff --git a/Sources/SimpleKeyboard/l10n/sv.lproj/Localizable.strings b/Sources/SimpleKeyboard/l10n/sv.lproj/Localizable.strings new file mode 100644 index 0000000..c7cac71 --- /dev/null +++ b/Sources/SimpleKeyboard/l10n/sv.lproj/Localizable.strings @@ -0,0 +1,11 @@ +"space" = "Mellanslag"; + +"Up" = "Upp"; + +"lw" = "lk"; + +"Done!" = "Klart!"; + +"Search" = "Sök"; + +"Go!" = "Gå!"; From 7880aa6e9ba568a23f90b2da5d9d6c65563dcc99 Mon Sep 17 00:00:00 2001 From: Henrik Storch Date: Sat, 7 Oct 2023 21:31:27 +0200 Subject: [PATCH 2/2] Add missing translations - finnish - norwegian --- .../SimpleKeyboard/l10n/fi.lproj/Localizable.strings | 11 +++++++++++ .../SimpleKeyboard/l10n/no.lproj/Localizable.strings | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Sources/SimpleKeyboard/l10n/fi.lproj/Localizable.strings create mode 100644 Sources/SimpleKeyboard/l10n/no.lproj/Localizable.strings diff --git a/Sources/SimpleKeyboard/l10n/fi.lproj/Localizable.strings b/Sources/SimpleKeyboard/l10n/fi.lproj/Localizable.strings new file mode 100644 index 0000000..9040dbe --- /dev/null +++ b/Sources/SimpleKeyboard/l10n/fi.lproj/Localizable.strings @@ -0,0 +1,11 @@ +"space" = "Väli"; + +"Up" = "Ylös"; + +"lw" = "lk"; + +"Done!" = "Valmis!"; + +"Search" = "Etsi"; + +"Go!" = "Mene!"; diff --git a/Sources/SimpleKeyboard/l10n/no.lproj/Localizable.strings b/Sources/SimpleKeyboard/l10n/no.lproj/Localizable.strings new file mode 100644 index 0000000..83b9e2a --- /dev/null +++ b/Sources/SimpleKeyboard/l10n/no.lproj/Localizable.strings @@ -0,0 +1,11 @@ +"space" = "Mellomrom"; + +"Up" = "Opp"; + +"lw" = "lw"; + +"Done!" = "Ferdig!"; + +"Search" = "Søk"; + +"Go!" = "Gå!";