diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 5ee110c2..aa410a28 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -163,6 +163,7 @@ var controllerLanguageAbbr = String() // Dictionary for accessing language abbreviations. let languagesAbbrDict = [ + "English": "en", "French": "fr", "German": "de", "Italian": "it", @@ -183,6 +184,7 @@ func getControllerLanguageAbbr() -> String { // Dictionary for accessing keyboard abbreviations and layouts. let keyboardLayoutDict: [String: () -> Void] = [ // Layouts for French checked within setFRKeyboardLayout. + "English": setENKeyboardLayout, "French": setFRKeyboardLayout, "German": setDEKeyboardLayout, "Italian": setITKeyboardLayout, diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 5576bbb5..947cad45 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -282,7 +282,12 @@ class KeyboardKey: UIButton { widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarReturnKeyWidth).isActive = true } else if ["123", ".?123", "return", "hideKeyboard"].contains(key) { if key == "return" - && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" + || controllerLanguage == "Italian" + || commandState == .translate + ) && row == 1 && DeviceType.isPad { layer.setValue(true, forKey: "isSpecial") @@ -303,7 +308,12 @@ class KeyboardKey: UIButton { widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true } else if ["123", ".?123", "return", "hideKeyboard"].contains(key) { if key == "return" - && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" + || controllerLanguage == "Italian" + || commandState == .translate + ) && row == 1 && DeviceType.isPad { layer.setValue(true, forKey: "isSpecial") diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index 0f3445c7..d96005f5 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -572,7 +572,7 @@ class KeyboardViewController: UIInputViewController { if prefix.isNumeric { completionWords = numericAutosuggestions - } else if ["French", "German", "Spanish"].contains(controllerLanguage) && pronounAutosuggestionTenses.keys.contains(prefix.lowercased()) { + } else if ["English", "French", "German", "Spanish"].contains(controllerLanguage) && pronounAutosuggestionTenses.keys.contains(prefix.lowercased()) { getPronounAutosuggestions() } else { // We have to consider these different cases as the key always has to match. @@ -1653,7 +1653,9 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPhone && key == "a" - && (controllerLanguage == "Portuguese" + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate || ( @@ -1671,7 +1673,8 @@ class KeyboardViewController: UIInputViewController { && key == "a" && !usingExpandedKeyboard && ( - controllerLanguage == "Portuguese" + controllerLanguage == "English" + || controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate ) { @@ -1681,7 +1684,9 @@ class KeyboardViewController: UIInputViewController { if DeviceType.isPad && key == "@" && !usingExpandedKeyboard - && (controllerLanguage == "Portuguese" + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) { leftPadding = keyWidth / 3 @@ -1690,7 +1695,9 @@ class KeyboardViewController: UIInputViewController { if DeviceType.isPad && key == "€" && !usingExpandedKeyboard - && (controllerLanguage == "Portuguese" + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" || commandState == .translate) { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "€") @@ -1786,7 +1793,9 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPhone && key == "l" - && (controllerLanguage == "Portuguese" + && ( + controllerLanguage == "English" + || controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate || ( diff --git a/Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift b/Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift index 50891cf1..45f2f8bc 100644 --- a/Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift +++ b/Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift @@ -21,6 +21,7 @@ import UIKit // Dictionary for accessing keyboard conjugation state. let keyboardConjTitleDict: [String: Any] = [ + "English": enGetConjugationTitle, "French": frGetConjugationTitle, "German": deGetConjugationTitle, "Italian": itGetConjugationTitle, @@ -32,6 +33,7 @@ let keyboardConjTitleDict: [String: Any] = [ // Dictionary for accessing keyboard conjugation state. let keyboardConjStateDict: [String: Any] = [ + "English": enGetConjugationState, "French": frGetConjugationState, "German": deGetConjugationState, "Italian": itGetConjugationState, @@ -43,6 +45,7 @@ let keyboardConjStateDict: [String: Any] = [ // Dictionary for accessing keyboard conjugation state. let keyboardConjLabelDict: [String: Any] = [ + "English": enSetConjugationLabels, "French": frSetConjugationLabels, "German": deSetConjugationLabels, "Italian": itSetConjugationLabels, @@ -278,7 +281,9 @@ func returnConjugation(keyPressed: UIButton, requestedForm: String) { /// Returns the conjugation state to its initial conjugation based on the keyboard language. func resetVerbConjugationState() { conjViewShiftButtonsState = .leftInactive - if controllerLanguage.prefix("French".count) == "French" { + if controllerLanguage == "English" { + enConjugationState = .present + } else if controllerLanguage.prefix("French".count) == "French" { frConjugationState = .indicativePresent } else if controllerLanguage == "German" { deConjugationState = .indicativePresent @@ -331,7 +336,9 @@ func resetCaseDeclensionState() { /// Runs an action associated with the left view switch button of the conjugation state based on the keyboard language. func conjugationStateLeft() { - if controllerLanguage.prefix("French".count) == "French" { + if controllerLanguage == "English" { + enConjugationStateLeft() + } else if controllerLanguage.prefix("French".count) == "French" { frConjugationStateLeft() } else if controllerLanguage == "German" { deConjugationStateLeft() @@ -350,7 +357,9 @@ func conjugationStateLeft() { /// Runs an action associated with the right view switch button of the conjugation state based on the keyboard language. func conjugationStateRight() { - if controllerLanguage.prefix("French".count) == "French" { + if controllerLanguage == "English" { + enConjugationStateRight() + } else if controllerLanguage.prefix("French".count) == "French" { frConjugationStateRight() } else if controllerLanguage == "German" { deConjugationStateRight() diff --git a/Keyboards/KeyboardsBase/Utilities.swift b/Keyboards/KeyboardsBase/Utilities.swift index 006e9f40..492e3dbc 100644 --- a/Keyboards/KeyboardsBase/Utilities.swift +++ b/Keyboards/KeyboardsBase/Utilities.swift @@ -24,6 +24,8 @@ func get_iso_code(keyboardLanguage: String) -> String { var iso = "" switch keyboardLanguage { + case "English": + iso = "en" case "French": iso = "fr" case "German": diff --git a/Scribe.xcodeproj/project.pbxproj b/Scribe.xcodeproj/project.pbxproj index 8c9b1cca..47597e5e 100644 --- a/Scribe.xcodeproj/project.pbxproj +++ b/Scribe.xcodeproj/project.pbxproj @@ -101,6 +101,10 @@ 38BD215322D592CA00C6795D /* German.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 38BD214C22D592CA00C6795D /* German.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 38DD94F122D6A40000FF8845 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DD94F022D6A40000FF8845 /* Extensions.swift */; }; 5A0A4C2E2C207C34003ADE27 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 5A0A4C2B2C207C34003ADE27 /* Localizable.xcstrings */; }; + 5A0A4C352C2AF52D003ADE27 /* RadioTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5A0A4C342C2AF52D003ADE27 /* RadioTableViewCell.xib */; }; + 5A0A4C372C2B0B28003ADE27 /* SelectionViewTemplateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A0A4C362C2B0B28003ADE27 /* SelectionViewTemplateViewController.swift */; }; + 5A0A4C392C2C6AC0003ADE27 /* RadioTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A0A4C382C2C6AC0003ADE27 /* RadioTableViewCell.swift */; }; + 5A8FFB6B2C5A9D9C00F4B571 /* English.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = D1AFDF3D29CA66D00033BF27 /* English.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 69B81EBC2BFB8C77008CAB85 /* TipCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B81EBB2BFB8C77008CAB85 /* TipCardView.swift */; }; 84AF4D882C3575EA009AE0D2 /* UIDeviceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AF4D872C3575EA009AE0D2 /* UIDeviceExtensions.swift */; }; CE1378C428F5D7AC00E1CBC2 /* ScribeColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1378C228F5D7AC00E1CBC2 /* ScribeColor.swift */; }; @@ -753,6 +757,13 @@ remoteGlobalIDString = 38BD214B22D592CA00C6795D; remoteInfo = typEmoji; }; + 5A8FFB6C2C5A9D9C00F4B571 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 38BD212822D5907E00C6795D /* Project object */; + proxyType = 1; + remoteGlobalIDString = D1AFDF0029CA66D00033BF27; + remoteInfo = English; + }; D109A210275B6888005E2271 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 38BD212822D5907E00C6795D /* Project object */; @@ -835,6 +846,7 @@ D1B81D2627BBB5320085FE5E /* Italian.appex in Embed Foundation Extensions */, D18EA8A02760D4A6001E1358 /* Swedish.appex in Embed Foundation Extensions */, 38BD215322D592CA00C6795D /* German.appex in Embed Foundation Extensions */, + 5A8FFB6B2C5A9D9C00F4B571 /* English.appex in Embed Foundation Extensions */, D109A221275B68B3005E2271 /* Portuguese.appex in Embed Foundation Extensions */, D160866C270B6D3C00134D48 /* Spanish.appex in Embed Foundation Extensions */, D109A212275B6888005E2271 /* French.appex in Embed Foundation Extensions */, @@ -1550,6 +1562,7 @@ D1AFDFC029CA68610033BF27 /* PBXTargetDependency */, D1AFDFC329CA68660033BF27 /* PBXTargetDependency */, D1AFE01529CA6F980033BF27 /* PBXTargetDependency */, + 5A8FFB6D2C5A9D9C00F4B571 /* PBXTargetDependency */, ); name = Scribe; packageProductDependencies = ( @@ -2772,6 +2785,11 @@ target = 38BD214B22D592CA00C6795D /* German */; targetProxy = 38BD215122D592CA00C6795D /* PBXContainerItemProxy */; }; + 5A8FFB6D2C5A9D9C00F4B571 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D1AFDF0029CA66D00033BF27 /* English */; + targetProxy = 5A8FFB6C2C5A9D9C00F4B571 /* PBXContainerItemProxy */; + }; D109A211275B6888005E2271 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D109A20A275B6888005E2271 /* French */; diff --git a/Scribe/Assets.xcassets/linkCornerBackground.imageset/Contents.json b/Scribe/Assets.xcassets/linkCornerBackground.imageset/Contents.json index 946453cb..5921f4c6 100644 --- a/Scribe/Assets.xcassets/linkCornerBackground.imageset/Contents.json +++ b/Scribe/Assets.xcassets/linkCornerBackground.imageset/Contents.json @@ -1,52 +1,52 @@ { - "images": [ + "images" : [ { - "filename": "cornerBackgroundLight.png", - "idiom": "universal", - "scale": "1x" + "filename" : "cornerBackgroundLight.png", + "idiom" : "universal", + "scale" : "1x" }, { - "appearances": [ + "appearances" : [ { - "appearance": "luminosity", - "value": "dark" + "appearance" : "luminosity", + "value" : "dark" } ], - "filename": "cornerBackgroundDark.png", - "idiom": "universal", - "scale": "1x" + "filename" : "CornerBackgroundDark.png", + "idiom" : "universal", + "scale" : "1x" }, { - "idiom": "universal", - "scale": "2x" + "idiom" : "universal", + "scale" : "2x" }, { - "appearances": [ + "appearances" : [ { - "appearance": "luminosity", - "value": "dark" + "appearance" : "luminosity", + "value" : "dark" } ], - "idiom": "universal", - "scale": "2x" + "idiom" : "universal", + "scale" : "2x" }, { - "idiom": "universal", - "scale": "3x" + "idiom" : "universal", + "scale" : "3x" }, { - "appearances": [ + "appearances" : [ { - "appearance": "luminosity", - "value": "dark" + "appearance" : "luminosity", + "value" : "dark" } ], - "idiom": "universal", - "scale": "3x" + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 } }