mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
use default language where there is no translation
This commit is contained in:
@@ -6,6 +6,8 @@ class BundleHelper {
|
||||
private let bundleName = "EeveeSpotify"
|
||||
|
||||
private let bundle: Bundle
|
||||
private let enBundle: Bundle
|
||||
|
||||
static let shared = BundleHelper()
|
||||
|
||||
private init() {
|
||||
@@ -16,6 +18,8 @@ class BundleHelper {
|
||||
)
|
||||
?? jbRootPath("/Library/Application Support/\(bundleName).bundle")
|
||||
)!
|
||||
|
||||
enBundle = Bundle(path: bundle.path(forResource: "en", ofType: "lproj")!)!
|
||||
}
|
||||
|
||||
func uiImage(_ name: String) -> UIImage {
|
||||
@@ -28,7 +32,13 @@ class BundleHelper {
|
||||
}
|
||||
|
||||
func localizedString(_ key: String) -> String {
|
||||
return bundle.localizedString(forKey: key, value: nil, table: nil)
|
||||
let value = bundle.localizedString(forKey: key, value: "No translation", table: nil)
|
||||
|
||||
if value != "No translation" {
|
||||
return value
|
||||
}
|
||||
|
||||
return enBundle.localizedString(forKey: key, value: nil, table: nil)
|
||||
}
|
||||
|
||||
func resolveConfiguration() throws -> ResolveConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user