Fix localization and add tests for EventGroupView

This commit is contained in:
2023-02-27 07:01:23 +13:00
parent 64b1a57918
commit 77bcd1b715
10 changed files with 638 additions and 38 deletions

View File

@@ -7,8 +7,12 @@
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
}