Merge branch 'tyiu/notifications' into tyiu/translations

This commit is contained in:
2023-02-27 10:58:10 +13:00
6 changed files with 209 additions and 37 deletions

View File

@@ -7,7 +7,11 @@
import Foundation
func bundleForLocale(locale: Locale) -> Bundle {
let path = Bundle.main.path(forResource: locale.identifier, ofType: "lproj")
func bundleForLocale(locale: Locale?) -> Bundle {
if locale == nil {
return Bundle.main
}
let path = Bundle.main.path(forResource: locale!.identifier, ofType: "lproj")
return path != nil ? (Bundle(path: path!) ?? Bundle.main) : Bundle.main
}