cubiq / add-to-homescreen

Add to home screen call-out for mobile devices
http://cubiq.org/add-to-home-screen
2.29k stars 747 forks source link

Support CP 47 subtag that are not defined #274

Open googol7 opened 6 years ago

googol7 commented 6 years ago

E.g.: fr-CH is not defined but fr-FR is so take fr-FR instead

var lang = 'en_us';
if (ath.language) {
    if (ath.language in ath.intl) {
        lang = ath.language
    } else if (ath.language.substr(0, 2) in ath.intl) {
        lang = ath.language.substr(0, 2)
    }
}
ath.language = lang