Setting auth.languageCode is impossible due to PromiseProxy.
This issue comes from the PromiseProxy and the fact that languageCode is both a getter and setter.
Version info
Angular: "@angular/core": "~10.1.4", Firebase: "firebase": "^7.19.1", AngularFire: "@angular/fire": "^6.0.2",
How to reproduce these conditions
// Try to change AngularFIreAuth languageCode
this.fireAuth.languageCode = 'fr';
// This fails because "Type 'string' is not assignable to type 'Promise<string>'."
// This comes from the PromiseProxy and the fact that languageCode is both a getter and setter.
// Setting to a Promise doesn't have any effect.
this.fireAuth.languageCode = new Promise(() => 'fr');
Expected behavior
I should be able to change the languageCode of the auth Object, to send email action templates in the user's language.
Actual behavior
The languageCode property doesn't work with the PromiseProxy. All email action templates are sent with the default Firebase Console language setting.
I'm aiming to support language code in 6.1, hopefully should have the time to take a pass shortly
Fantastic!
As a current workaround, I use firebase directly, with a delay, to make sure the app is initialized by AngularFire first.
import * as firebase from 'firebase/app';
import 'firebase/auth';
firebase.auth().languageCode = langCode;
6.1.0-rc.2 now has USE_DEVICE_LANGUAGE and LANGUAGE_CODE DI tokens which allow configuration of the auth language.
With:
- Angular ^12.2.0
- Firebase ^8.10.0
- AngularFire ^6.1.5
setting LANGUAGE_CODE DI token value does not impact email language.
Value of languageCode stored in AngularFireAuth service equals the one provided with DI token.
import { AngularFireAuth } from '@angular/fire/auth';
constructor(
private authService: AngularFireAuth,
) {
this.authService.languageCode.then((languageCode) =>
console.log(languageCode) // will print a value provided with DI token, e.g. "pl"
);
}
but emails are still sent in the default language.
Must still use firebase.auth() directly to change email language:
import * as firebase from 'firebase/app';
import 'firebase/auth';
firebase.auth().languageCode ='pl'; // emails will be sent in provided language
I am still facing this issue... this.afAuth.languageCode = Promise.resolve(lang); still sends emails with default template language set in firebase console.

import * as firebase from 'firebase/app';
import 'firebase/auth';
firebase.auth().languageCode ='pl'; // emails will be sent in provided language
this workaround does not work because auth() does not exsists in firebase..
any solution anyone?