-
Notifications
You must be signed in to change notification settings - Fork 487
Description
Just got a ticket in my project that one of the OAuth-created buttons does not react properly to languages change in my project.
After a short investigation I realised none the arguments injected with the buttonLabelText of the:
FUIOAuth initWithAuthUI: providerID: buttonLabelText: shortName: buttonColor: iconImage: fromBundleNameOrNil: scopes: customParameters: loginHintKey: are localised rather are just plain Strings.
On the other hand other Auth folders (e.g. GoogleAuth and FacebookAuth) contain their own localisations.
I have managed to override the FUIOAuth and inject my own strings as buttonLabelText but it does not seem to be a good practice for longer terms.
Step 1: Are you in the right place?
I don't know but:
- in the version 8.4.2 the
OAuthfiles also does not seem to have localised Strings at all.
Step 2: Describe your environment
- Swift:5
- iOS version: 13.6.1
- Firebase SDK version: 6.18.0
- FirebaseUI version: 8.4.1
- CocoaPods Version: 1.9.3
Step 3: Describe the problem:
Steps to reproduce:
- Use the implementation of any of the
FUIOAuthauthProvider methods (e.g.: appleAuthProvider, yahooAuthProvider, microsoftAuthProvider, etc.) and inject them as providers to the authUI object. - Change the language to non-English (e.g. Swedish)
- Reach the FUIAuthPickerViewController with the providers mentioned in point 1.
- Notice that the button titles are hardcoded English strings.
Observed Results:
- What happened?
The strings noticed in the buttons were in English only (not localised):
- twitterAuthProvider: @"Sign in with Twitter"
- githubAuthProvider: @"Sign in with GitHub"
- microsoftAuthProvider: @"Sign in with Microsoft"
- yahooAuthProvider: @"Sign in with Yahoo"
- appleAuthProvider: @"Sign in with Apple"
Expected Results:
- Localised strings corresponding to the languages support.
Relevant Code:
Sample of:
buttonLabelText:@"Sign in with Apple"
could be replaced with
buttonLabelText:NSLocalizedString(@"Sign in with Apple", @"FUIAuthPickerViewController")
together with the pile of values for each supporting language corresponding to the translation.