Skip to content

Commit

Permalink
Merge pull request #236 from scribe-org/229-96-french-azerty-shrink-j…
Browse files Browse the repository at this point in the history
…sons

#229 #96 adds french azerty and reduces JSON sizes
  • Loading branch information
andrewtavis committed Oct 18, 2022
2 parents d47e8b8 + 6412302 commit 3fbd32a
Show file tree
Hide file tree
Showing 44 changed files with 2,037,379 additions and 2,036,934 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).

# [Unreleased] Scribe-iOS 2.1.0

### ⌨️ New Keyboards

- Adds a QWERTY keyboard option for French.

### ✨ New Features

- The left and right buttons in the conjugation and declination views are disabled now if pressing them will not lead to a change in the view.
Expand All @@ -21,6 +25,12 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).
### 🎨 Design Changes

- The labels for conjugations and declinations have been made darker in dark mode to be more readable.
- French keyboards are now named based on their keyboard style.

### 🐞 Bug Fixes

- The accent character on the French letters keyboard is now the correct character.
- Indentation has been removed from all Scribe JSON files to reduce their filesize, speed up the load times and mitigate crashes.

### ♻️ Code Refactoring

Expand Down
7 changes: 5 additions & 2 deletions Keyboards/KeyboardsBase/InterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ var controllerLanguageAbbr = String()

// Dictionary for accessing language abbreviations.
let languagesAbbrDict: [String: String] = [
"French": "fr",
"French_AZERTY": "fr",
"French_QWERTY": "fr",
"German": "de",
"Italian": "it",
"Portuguese": "pt",
Expand All @@ -127,7 +128,9 @@ func getControllerLanguageAbbr() -> String {

// Dictionary for accessing keyboard abbreviations and layouts.
let keyboardLayoutDict: [String: () -> Void] = [
"French": setFRKeyboardLayout,
// Layouts for French checked within setFRKeyboardLayout.
"French_AZERTY": setFRKeyboardLayout,
"French_QWERTY": setFRKeyboardLayout,
"German": setDEKeyboardLayout,
"Italian": setITKeyboardLayout,
"Portuguese": setPTKeyboardLayout,
Expand Down
10 changes: 7 additions & 3 deletions Keyboards/KeyboardsBase/KeyboardKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class KeyboardKey: UIButton {
self.layer.setValue(true, forKey: "isSpecial")
}
var capsKey = ""
if self.key != "ß" && self.key != spaceBar {
if self.key != "ß"
&& self.key != "´"
&& self.key != spaceBar
&& self.key != "ABC"
&& self.key != "АБВ" {
capsKey = keyboard[self.row][self.idx].capitalized
} else {
capsKey = self.key
Expand Down Expand Up @@ -97,7 +101,7 @@ class KeyboardKey: UIButton {

if keyboardState == .letters
&& isSpecial == false
&& !["123", spaceBar].contains(self.key)
&& !["123", "´", spaceBar].contains(self.key)
&& shiftButtonState == .normal {
self.titleEdgeInsets = UIEdgeInsets(top: -4.0, left: 0.0, bottom: 0.0, right: 0.0)

Expand Down Expand Up @@ -154,7 +158,7 @@ class KeyboardKey: UIButton {

if keyboardState == .letters
&& isSpecial == false
&& ![".?123", spaceBar, "ß", ",", ".", "'", "-"].contains(self.key)
&& ![".?123", spaceBar, "ß", "´", ",", ".", "'", "-"].contains(self.key)
&& shiftButtonState == .normal {
self.titleEdgeInsets = UIEdgeInsets(top: -4.0, left: 0.0, bottom: 0.0, right: 0.0)

Expand Down
15 changes: 9 additions & 6 deletions Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import UIKit

// Dictionary for accessing keyboard conjugation state.
let keyboardConjTitleDict: [String: Any] = [
"French": frGetConjugationTitle,
"French_AZERTY": frGetConjugationTitle,
"French_QWERTY": frGetConjugationTitle,
"German": deGetConjugationTitle,
"Italian": itGetConjugationTitle,
"Portuguese": ptGetConjugationTitle,
Expand All @@ -19,7 +20,8 @@ let keyboardConjTitleDict: [String: Any] = [

// Dictionary for accessing keyboard conjugation state.
let keyboardConjStateDict: [String: Any] = [
"French": frGetConjugationState,
"French_AZERTY": frGetConjugationState,
"French_QWERTY": frGetConjugationState,
"German": deGetConjugationState,
"Italian": itGetConjugationState,
"Portuguese": ptGetConjugationState,
Expand All @@ -30,7 +32,8 @@ let keyboardConjStateDict: [String: Any] = [

// Dictionary for accessing keyboard conjugation state.
let keyboardConjLabelDict: [String: Any] = [
"French": frSetConjugationLabels,
"French_AZERTY": frSetConjugationLabels,
"French_QWERTY": frSetConjugationLabels,
"German": deSetConjugationLabels,
"Italian": itSetConjugationLabels,
"Portuguese": ptSetConjugationLabels,
Expand Down Expand Up @@ -236,7 +239,7 @@ 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 == "French" {
if controllerLanguage.prefix("French".count) == "French" {
frConjugationState = .indicativePresent
} else if controllerLanguage == "German" {
deConjugationState = .indicativePresent
Expand Down Expand Up @@ -289,7 +292,7 @@ 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 == "French" {
if controllerLanguage.prefix("French".count) == "French" {
frConjugationStateLeft()
} else if controllerLanguage == "German" {
deConjugationStateLeft()
Expand All @@ -308,7 +311,7 @@ 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 == "French" {
if controllerLanguage.prefix("French".count) == "French" {
frConjugationStateRight()
} else if controllerLanguage == "German" {
deConjugationStateRight()
Expand Down
Loading

0 comments on commit 3fbd32a

Please sign in to comment.