Skip to content

Commit 5d51f3a

Browse files
committed
localization support only needs set locale or passing default to the server as its handled server side. Reverted local checks
1 parent 17f71e3 commit 5d51f3a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/BuilderIO/BuilderIOManager.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@ public final class BuilderIOManager {
1515

1616
private let apiKey: String
1717
public let customNavigationScheme: String
18+
public let locale: String?
1819

1920
private static var registered = false
2021

21-
public static func configure(apiKey: String, customNavigationScheme: String = "builderio") {
22+
public static func configure(apiKey: String, customNavigationScheme: String = "builderio", locale: String = "Default") {
2223
guard _shared == nil else {
2324
print(
2425
"Warning: BuilderIOManager has already been configured. Ignoring subsequent configuration.")
2526
return
2627
}
2728
Font.registerFonts()
28-
_shared = BuilderIOManager(apiKey: apiKey, customNavigationScheme: customNavigationScheme)
29+
_shared = BuilderIOManager(apiKey: apiKey, customNavigationScheme: customNavigationScheme, locale: locale)
2930
}
3031

3132
// MARK: - Private Initialization
3233

33-
private init(apiKey: String, customNavigationScheme: String) {
34+
private init(apiKey: String, customNavigationScheme: String, locale: String) {
3435
self.apiKey = apiKey
3536
self.customNavigationScheme = customNavigationScheme
37+
self.locale = locale
3638

3739
if !Self.registered {
3840
BuilderComponentRegistry.shared.initialize()
@@ -60,7 +62,7 @@ public final class BuilderIOManager {
6062
model: model,
6163
apiKey: apiKey,
6264
url: resolvedUrl,
63-
locale: "",
65+
locale: locale,
6466
preview: ""
6567
) {
6668
return .success(content)

0 commit comments

Comments
 (0)