Skip to content

Commit

Permalink
Merge branch 'main' into add-back-english-keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Jag-Marcel authored Aug 3, 2024
2 parents 78cb944 + 900d068 commit ec6d25e
Show file tree
Hide file tree
Showing 13 changed files with 450 additions and 269 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).

# [Upcoming] Scribe-iOS 3.2.0

# Scribe-iOS 3.1.1

### ✨ New Features

- A warning is added to trying to change the app localization if the user only has one language installed on their device ([#481](https://github.com/scribe-org/Scribe-iOS/issues/481)).

### 🌐 Localization

- Localization strings for English, German, Swedish and Spanish have been added for all remaining app texts ([Scribe-i18n#28](https://github.com/scribe-org/Scribe-i18n/issues/28)).

# Scribe-iOS 3.1.0

### ✨ New Features
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ Scribe does not accept direct edits to the grammar JSON files as they are source

Being an app that focusses on language learning, localization plays a big part in what Scribe will eventually be. Those interested are more than welcome to join the team at [scribe-org/Scribe-i18n](https://github.com/scribe-org/Scribe-i18n) where we work on localizing all Scribe applications via [Weblate](https://weblate.org/).

Please run the following command to load in the most recent version of the [Scribe-i18n](https://github.com/scribe-org/Scribe-i18n) app texts into Scribe-iOS:

```bash
git subtree pull --prefix Scribe/i18n [email protected]:scribe-org/Scribe-i18n.git main --squash
```

### Progress

<a href="https://hosted.weblate.org/projects/scribe/scribe-i18n">
Expand Down
48 changes: 24 additions & 24 deletions Scribe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3031,7 +3031,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3060,7 +3060,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.german;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3090,7 +3090,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.german;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3120,7 +3120,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.french;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3150,7 +3150,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.french;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3180,7 +3180,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.portuguese;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3210,7 +3210,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.portuguese;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3240,7 +3240,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.spanish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3270,7 +3270,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.spanish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3300,7 +3300,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.russian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3330,7 +3330,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.russian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3360,7 +3360,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.swedish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3390,7 +3390,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.swedish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3419,7 +3419,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.norwegian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3448,7 +3448,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.norwegian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3477,7 +3477,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.english;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3502,7 +3502,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.english;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3527,7 +3527,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.danish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3556,7 +3556,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.danish;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3585,7 +3585,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.hebrew;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3614,7 +3614,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.hebrew;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3644,7 +3644,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.italian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3674,7 +3674,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.1.1;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.italian;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
9 changes: 5 additions & 4 deletions Scribe/SettingsTab/SettingsTableData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ enum SettingsTableData {

var sections = [Section]()

for language in installedKeyboards {
guard let abbreviation = languagesAbbrDict[language] else {
fatalError("Abbreviation not found for language: \(language)")
for lang in installedKeyboards {
guard let abbreviation = languagesAbbrDict[lang] else {
fatalError("Abbreviation not found for language: \(lang)")
}
let key = "_global.\(lang.lowercased())"
let newSection = Section(
sectionTitle: NSLocalizedString("_global.\(language.lowercased())", value: language, comment: ""),
sectionTitle: NSLocalizedString(key, value: language, comment: ""),
sectionState: .specificLang(abbreviation)
)

Expand Down
11 changes: 10 additions & 1 deletion Scribe/SettingsTab/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,16 @@ extension SettingsViewController: UITableViewDelegate {

switch section.sectionState {
case .appLang:
openSettingsApp()
let preferredLanguages = NSLocale.preferredLanguages
if preferredLanguages.count == 1 {
let alert = UIAlertController(
title: "No languages installed", message: "You only have one language installed on your device. Please install more languages in Settings and then you can select different localizations of Scribe.", preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
present(alert, animated: true)
} else {
openSettingsApp()
}

case .specificLang:
if let viewController = storyboard?.instantiateViewController(
Expand Down
3 changes: 2 additions & 1 deletion Scribe/TipCard/TipCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct TipCardView: View {
@Binding var tipCardState: Bool
var onDismiss: (() -> Void)?

let ok = "OK"
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: cardCornerRadius)
Expand All @@ -45,7 +46,7 @@ struct TipCardView: View {
tipCardState = false
self.onDismiss?()
} label: {
Text("OK")
Text(ok)
.foregroundColor(.white)
}
.frame(width: leadingPadding, height: leadingPadding)
Expand Down
10 changes: 7 additions & 3 deletions Scribe/i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Check out Scribe's [architecture diagrams](https://github.com/scribe-org/Organiz

# **Contents**

- [Localization Coverage](#localization-coverage)
- [Localization coverage](#localization-coverage)
- [Contributing](#contributing)
- [Community](#community)

<a id="localization-coverage"></a>

# Localization Coverage [``](#contents)
# Localization coverage [``](#contents)

<a href="https://hosted.weblate.org/projects/scribe/scribe-i18n">
<img src="https://hosted.weblate.org/widget/scribe/scribe-i18n/multi-auto.svg" alt="Translation status" />
Expand Down Expand Up @@ -74,10 +74,14 @@ The [issue tracker for Scribe-i18n](https://github.com/scribe-org/Scribe-i18n/is

5. Hit `Save and continue` when you're ready to move to the next string

6. Maintainers will open up pull requests from [Weblate](https://weblate.org/en/) to this repo
6. Maintainers will open up pull requests from [Weblate](https://weblate.org/en/) to the Scribe-i18n repo to bring in the new strings

- Changes are also automatically sent every 24 hours

7. Scribe-i18n directories that are [Git subtrees](https://docs.github.com/en/get-started/using-git/about-git-subtree-merges) in other Scribe application repos are then synched

Thanks so much for your interest in supporting Scribe's localization!

### Adding source strings [``](#contents)

The base language for all Scribe applications is US English. If you'd like to edit the [en-US.json](https://github.com/scribe-org/Scribe-i18n/blob/main/Scribe-i18n/en-US.json) file, please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the repo, clone your fork, and configure the remotes:
Expand Down
Loading

0 comments on commit ec6d25e

Please sign in to comment.