Skip to content

Commit

Permalink
Merge branch 'main' into gsoc23-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhJamadagni committed Jun 19, 2023
2 parents c2acf44 + 8eee94c commit 6305ff8
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 503 deletions.
11 changes: 2 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<!---
Thank you for your pull request! 🚀
If you're not already a member of our public Matrix community, please consider joining via the following link:
https://matrix.to/#/#scribe_community:matrix.org
It'd be great to have you!
Also if you're new to open source, check that the email you use for GitHub (https://github.com/settings/emails) is the same the one you have for git so you get credit for your contribution. You can see your git email by typing `git config user.email` and set it globally with `git config --global user.email "your_email@email.com"`.
-->

### Contributor checklist

<!-- Please replace the empty checkboxes [ ] below with checked ones [x] accordingly. -->
<!-- Please replace the empty checkboxes [] below with checked ones [x] accordingly. -->

- [ ] This pull request is on a [separate branch](https://docs.github.com/en/get-started/quickstart/github-flow) and not the main branch
- [] This pull request is on a [separate branch](https://docs.github.com/en/get-started/quickstart/github-flow) and not the main branch

---

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pr_maintainer_checklist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ jobs:
message: |
## Thank you for the pull request!
The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes well. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
### Maintainer Checklist
If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining! It'd be great to have you!
- [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution (name and icon should be the same in remote commits)
### Maintainer checklist
- [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the [email they use for GitHub](https://github.com/settings/emails) matches what they have for `git config user.email` in their local activist repo
- [ ] The [CHANGELOG](https://github.com/scribe-org/Scribe-iOS/blob/main/CHANGELOG.md) has been updated with a description of the changes for the upcoming release (if necessary)
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).
- German indefinite pronouns are now selectable from the case-declension display.
- German imperfect verb conjugations now insert both the auxiliary verb and the past participle with the cursor between them.
- Adds a new menu to the Scribe app allowing users to set their preferences for their respective language keyboards!
- Users have easy access to the Scribe GitHub, the Matrix community, rating the app, sending bug reports and emailing the team.

# Scribe-iOS 2.3.0

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

// Dictionary for accessing language abbreviations.
let languagesAbbrDict = [
"French_AZERTY": "fr",
"French_QWERTY": "fr",
"French": "fr",
"German": "de",
"Italian": "it",
"Portuguese": "pt",
Expand All @@ -136,8 +135,7 @@ func getControllerLanguageAbbr() -> String {
// Dictionary for accessing keyboard abbreviations and layouts.
let keyboardLayoutDict: [String: () -> Void] = [
// Layouts for French checked within setFRKeyboardLayout.
"French_AZERTY": setFRKeyboardLayout,
"French_QWERTY": setFRKeyboardLayout,
"French": setFRKeyboardLayout,
"German": setDEKeyboardLayout,
"Italian": setITKeyboardLayout,
"Portuguese": setPTKeyboardLayout,
Expand Down
2 changes: 1 addition & 1 deletion Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class KeyboardViewController: UIInputViewController {

if prefix.isNumeric {
completionWords = numericAutosuggestions
} else if ["French_AZERTY", "French_QWERTY", "German", "Spanish"].contains(controllerLanguage) && pronounAutosuggestionTenses.keys.contains(prefix.lowercased()) {
} else if ["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.
Expand Down
9 changes: 3 additions & 6 deletions Keyboards/KeyboardsBase/ScribeFunctionality/Conjugate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import UIKit

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

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

// Dictionary for accessing keyboard conjugation state.
let keyboardConjLabelDict: [String: Any] = [
"French_AZERTY": frSetConjugationLabels,
"French_QWERTY": frSetConjugationLabels,
"French": frSetConjugationLabels,
"German": deSetConjugationLabels,
"Italian": itSetConjugationLabels,
"Portuguese": ptSetConjugationLabels,
Expand Down
4 changes: 1 addition & 3 deletions Keyboards/KeyboardsBase/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
func get_iso_code(keyboardLanguage: String) -> String {
var iso = ""
switch keyboardLanguage {
case "French_AZERTY":
iso = "fr"
case "French_QWERTY":
case "French":
iso = "fr"
case "German":
iso = "de"
Expand Down
112 changes: 104 additions & 8 deletions Keyboards/LanguageKeyboards/French/FRInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,112 @@

import UIKit

/// Provides a French keyboard layout after checking for AZERTY or QWERTY.
func setFRKeyboardLayout() {
if controllerLanguage == "French_AZERTY" {
getFRAZERTYKeys()
currencySymbol = ""
} else if controllerLanguage == "French_QWERTY" {
getFRQWERTYKeys()
currencySymbol = "$"
public enum FrenchKeyboardConstants {
// Keyboard key layouts.
static let letterKeysPhone = [
["a", "z", "e", "r", "t", "y", "u", "i", "o", "p"],
["q", "s", "d", "f", "g", "h", "j", "k", "l", "m"],
["shift", "w", "x", "c", "v", "b", "n", "´", "delete"],
["123", "selectKeyboard", "space", "return"], // "undoArrow"
]

static let numberKeysPhone = [
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
["-", "/", ":", ";", "(", ")", "", "&", "@", "\""],
["#+=", ".", ",", "?", "!", "'", "delete"],
["ABC", "selectKeyboard", "space", "return"], // "undoArrow"
]

static let symbolKeysPhone = [
["[", "]", "{", "}", "#", "%", "^", "*", "+", "="],
["_", "\\", "|", "~", "<", ">", "$", "£", "¥", "·"],
["123", ".", ",", "?", "!", "'", "delete"],
["ABC", "selectKeyboard", "space", "return"], // "undoArrow"
]

static let letterKeysPad = [
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"],
["a", "z", "e", "r", "t", "y", "u", "i", "o", "p"],
["q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "return"],
["shift", "w", "x", "c", "v", "b", "n", "´", ",", ".", "shift"],
["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "undoArrow"
]

static let numberKeysPad = [
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "delete"],
["@", "#", "&", "\"", "", "(", "!", ")", "-", "*", "return"],
["#+=", "%", "_", "+", "=", "/", ";", ":", ",", ".", "#+="],
["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "undoArrow"
]

static let symbolKeysPad = [
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "delete"],
["~", "", "[", "]", "{", "}", "^", "$", "£", "¥", "return"],
["123", "§", "<", ">", "|", "\\", "...", "·", "?", "'", "123"],
["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "undoArrow"
]

// Alternate key vars.
static let keysWithAlternates = ["a", "e", "i", "o", "u", "y", "c", "n"]
static let keysWithAlternatesLeft = ["a", "e", "y", "c"]
static let keysWithAlternatesRight = ["i", "o", "u", "n"]

static let aAlternateKeys = ["à", "â", "æ", "á", "ä", "ã", "å", "ā", ""]
static let eAlternateKeys = ["é", "è", "ê", "ë", "ę", "ė", "ē"]
static let iAlternateKeys = ["ī", "į", "í", "ì", "ï", "î"]
static let oAlternateKeys = ["", "ō", "ø", "õ", "ó", "ò", "ö", "œ", "ô"]
static let uAlternateKeys = ["ū", "ú", "ü", "ù", "û"]
static let yAlternateKeys = ["ÿ"]
static let cAlternateKeys = ["ç", "ć", "č"]
static let nAlternateKeys = ["ń", "ñ"]
}

/// Gets the keys for the French keyboard.
func getFRKeys() {
if DeviceType.isPhone {
letterKeys = FrenchKeyboardConstants.letterKeysPhone
numberKeys = FrenchKeyboardConstants.numberKeysPhone
symbolKeys = FrenchKeyboardConstants.symbolKeysPhone
allKeys = Array(letterKeys.joined()) + Array(numberKeys.joined()) + Array(symbolKeys.joined())

leftKeyChars = ["a", "q", "1", "-", "[", "_"]
rightKeyChars = ["p", "m", "0", "\"", "=", "·"]
centralKeyChars = allKeys.filter { !leftKeyChars.contains($0) && !rightKeyChars.contains($0) }
} else {
letterKeys = FrenchKeyboardConstants.letterKeysPad
numberKeys = FrenchKeyboardConstants.numberKeysPad
symbolKeys = FrenchKeyboardConstants.symbolKeysPad

// If the iPad is too small to have a numbers row.
letterKeys.removeFirst(1)
letterKeys[0].append("delete")

allKeys = Array(letterKeys.joined()) + Array(numberKeys.joined()) + Array(symbolKeys.joined())

leftKeyChars = ["q", "a", "1", "@", "~"]
// TODO: add "p" to rightKeyChar if the keyboard has 4 rows.
rightKeyChars = []
centralKeyChars = allKeys.filter { !leftKeyChars.contains($0) && !rightKeyChars.contains($0) }
}

keysWithAlternates = FrenchKeyboardConstants.keysWithAlternates
keysWithAlternatesLeft = FrenchKeyboardConstants.keysWithAlternatesLeft
keysWithAlternatesRight = FrenchKeyboardConstants.keysWithAlternatesRight
aAlternateKeys = FrenchKeyboardConstants.aAlternateKeys
eAlternateKeys = FrenchKeyboardConstants.eAlternateKeys
iAlternateKeys = FrenchKeyboardConstants.iAlternateKeys
oAlternateKeys = FrenchKeyboardConstants.oAlternateKeys
uAlternateKeys = FrenchKeyboardConstants.uAlternateKeys
yAlternateKeys = FrenchKeyboardConstants.yAlternateKeys
cAlternateKeys = FrenchKeyboardConstants.cAlternateKeys
nAlternateKeys = FrenchKeyboardConstants.nAlternateKeys
}

/// Provides a French keyboard layout.
func setFRKeyboardLayout() {
getFRKeys()

currencySymbol = ""
currencySymbolAlternates = euroAlternateKeys
spaceBar = "espace"
language = "Français"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// FRKeyboardViewController.swift
//

class FRKeyboardViewController: KeyboardViewController {}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6305ff8

Please sign in to comment.