1.0.0 • Published 4 years ago

translatefirebase v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

npm install translatefirebase -- save

import { translatefirebase } from 'translatefirebase';

connection = async (mail, password) => {
		return new Promise(async (resolve, reject) => {
			await firebase
				.auth()
				.signInWithEmailAndPassword(mail, password)
				.then(res => {
					resolve(res);
                })
				.catch(error => {
                    const errorTranslated = translatefirebase(error, 'fr');
                    rej(errorTranslated); //"L'adresse e-mail est mal formatée."
                });
		});

Supported country code for now :

  • 'fr' for french
  • 'en' for english
  • 'pt' for portuguese