Skip to content

Instantly share code, notes, and snippets.

@dimovdaniel
Created April 20, 2019 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimovdaniel/775b1d4d66e77f84080515ad3c03c92c to your computer and use it in GitHub Desktop.
Save dimovdaniel/775b1d4d66e77f84080515ad3c03c92c to your computer and use it in GitHub Desktop.
function startSettingBackednLanguage(){
//1. Get user language
var curLangRef = firebase.app.database().ref('users/'+firebase.app.auth().currentUser.uid);
curLangRef.on('value', function(snapshot) {
var currentLangData=snapshot.val()&&snapshot.val().language?snapshot.val().language.toUpperCase():"GB";
language=currentLangData;
Translation.fetchAndSetLanguageAndSetUser(currentLangData,false,function(allAvailableLanguages){
loggedIn=true;
availableLaguages=allAvailableLanguages;
displayApp();
});
},function(e){
alert(e.message)
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment