Skip to content

Commit

Permalink
#481 add alert for when localizations won't be available
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jul 31, 2024
1 parent c971950 commit 8731937
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 8731937

Please sign in to comment.