Skip to content

Instantly share code, notes, and snippets.

@mike623

mike623/lib.js

Last active Dec 14, 2015
Embed
What would you like to do?
lib.js for cordova-plugin-globalization@1.0.2
var currConveter = {
"ZH-HK": {
A: "HKD 8"
},
"ZH-TW": {
A: "TWD 30"
}
}
if (Meteor.isClient) {
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.globalization);
// do what u do
navigator.globalization.getPreferredLanguage(
function(language) {
alert('language: ' + language.value + '\n');
Meteor.currency = language.value;
if (!_.has(currConveter, Meteor.currency))
Meteor.currency == "ZH-HK";
},
function() {
alert('Error getting language\n');
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.