Skip to content

Commit a320ef3

Browse files
committed
Set FIRAuth preferred language code by default.
1 parent ea7039c commit a320ef3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

FirebaseAuthUI/FUIAuth.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ + (nullable FUIAuth *)authUIWithAuth:(FIRAuth *)auth {
9292
if ([auth respondsToSelector:@selector(setAdditionalFrameworkMarker:)]) {
9393
auth.additionalFrameworkMarker = kFirebaseAuthUIFrameworkMarker;
9494
}
95+
// Update auth with the actual language used in the app.
96+
// If localization is not provided by developer, the first localization available,
97+
// ordered by the user's preferred order, is used.
98+
auth.languageCode = [NSBundle mainBundle].preferredLocalizations.firstObject;
9599
}
96100
return authUI;
97101
}

FirebasePhoneAuthUI/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ To start the authentication flow:
6060
// Swift
6161
let phoneProvider = FUIAuth.defaultAuthUI()?.providers.first as! FUIPhoneAuth
6262
phoneProvider.signIn(withPresenting: currentlyVisibleController, phoneNumber: nil)
63-
}
6463
```
6564

6665
```objective-c

0 commit comments

Comments
 (0)