Created
April 20, 2019 03:54
-
-
Save dimovdaniel/775b1d4d66e77f84080515ad3c03c92c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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