-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Enables application extension API only * Replace UIApp...leftToRight with Locale extension For use in Extensions that don't support UIApp Co-authored-by: Lukas Schmidt <lukas.la.schmidt@deutschebahn.com>
- Loading branch information
1 parent
2de8d78
commit 800b9d9
Showing
7 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Locale+Hero.swift | ||
// Hero | ||
// | ||
// Created by Joseph Mattiello on 4/25/20. | ||
// Copyright © 2020 Luke Zhao. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
internal extension Locale { | ||
internal static var isDeviceLanguageRightToLeft: Bool { | ||
let currentLocale: Locale = Locale.current | ||
guard let code: String = currentLocale.languageCode else { | ||
return false | ||
} | ||
let direction: Locale.LanguageDirection = Locale.characterDirection(forLanguage: code) | ||
return (direction == .rightToLeft) | ||
} | ||
|
||
internal static var isDeviceLanguageLeftToRight: Bool { | ||
return !isDeviceLanguageRightToLeft | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters