add fixture-backed admin and ios scaffold
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
|
||||
final class LocalizationStore {
|
||||
private let bundle: Bundle
|
||||
|
||||
init(bundle: Bundle = .main) {
|
||||
self.bundle = bundle
|
||||
}
|
||||
|
||||
func string(for key: String, locale: String) -> String {
|
||||
guard let path = bundle.path(forResource: locale, ofType: "lproj"),
|
||||
let localizedBundle = Bundle(path: path) else {
|
||||
return bundle.localizedString(forKey: key, value: nil, table: nil)
|
||||
}
|
||||
|
||||
return localizedBundle.localizedString(forKey: key, value: nil, table: nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user