Skip to content

Commit 15d839d

Browse files
Jacob Stimessamtstern
Jacob Stimes
authored andcommitted
Utilizing FirebaseAuth#setLanguageCode to localize verification emails & SMS messages. (#946)
1 parent 8f305dd commit 15d839d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import android.app.Activity;
1818
import android.content.Intent;
19+
import android.os.Build;
1920
import android.os.Bundle;
2021
import android.os.Parcel;
2122
import android.os.Parcelable;
@@ -57,6 +58,7 @@
5758
import java.util.HashSet;
5859
import java.util.IdentityHashMap;
5960
import java.util.List;
61+
import java.util.Locale;
6062
import java.util.Set;
6163

6264
/**
@@ -146,6 +148,11 @@ public class AuthUI {
146148
private AuthUI(FirebaseApp app) {
147149
mApp = app;
148150
mAuth = FirebaseAuth.getInstance(mApp);
151+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
152+
mAuth.setLanguageCode(Locale.getDefault().getLanguage());
153+
} else {
154+
mAuth.setLanguageCode(Locale.getDefault().toLanguageTag());
155+
}
149156
}
150157

151158
/**

0 commit comments

Comments
 (0)