-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supports more Source Languages (ko, ja)
* Requires build with SDK provided after official deployment of macOS 13
- Loading branch information
Showing
5 changed files
with
65 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// Language.swift | ||
// Swifty-OCR-Translator | ||
// | ||
// Created by PangMo5 on 2022/06/08. | ||
// | ||
|
||
import Foundation | ||
import Defaults | ||
|
||
enum Language: String, CaseIterable, DefaultsSerializable { | ||
case en | ||
case ko | ||
case ja | ||
case fr | ||
case it | ||
case de | ||
case es | ||
case pt | ||
case zh | ||
|
||
var toLocaleStrings: [String] { | ||
switch self { | ||
case .en: | ||
return ["en-US"] | ||
case .ko: | ||
return ["ko-KR"] | ||
case .ja: | ||
return ["ja-JP"] | ||
case .fr: | ||
return ["fr-FR"] | ||
case .it: | ||
return ["it-IT"] | ||
case .de: | ||
return ["de-DE"] | ||
case .es: | ||
return ["es-ES"] | ||
case .pt: | ||
return ["pt-BR"] | ||
case .zh: | ||
return ["zh-Hans", "zh-Hant"] | ||
} | ||
} | ||
|
||
var toLocalized: String { | ||
Locale.current.localizedString(forLanguageCode: rawValue) ?? "unknown" | ||
} | ||
} |
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