Imported all zh_CN dialogs and added locale changing support Issue #42

This commit is contained in:
Peter Cottle 2013-02-23 14:31:40 -08:00
parent 2617357460
commit cc5466b038
22 changed files with 1693 additions and 222 deletions

View file

@ -7,9 +7,7 @@ var TIME = {
// useful for locks, etc
var GLOBAL = {
isAnimating: false,
// default locale, this changes
locale: 'en'
isAnimating: false
};
var VIEWPORT = {

View file

@ -1,6 +1,15 @@
var _ = require('underscore');
var constants = require('../util/constants');
exports.parseQueryString = function(uri) {
var params = {};
uri.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { params[$1] = $3; }
);
return params;
};
exports.isBrowser = function() {
var inBrowser = String(typeof window) !== 'undefined';
return inBrowser;
@ -10,8 +19,11 @@ exports.getLocale = function() {
if (constants.GLOBAL.locale) {
return constants.GLOBAL.locale;
}
console.warn('No locale found...');
return 'en';
return exports.getDefaultLocale();
};
exports.getDefaultLocale = function() {
return 'en_US';
};
exports.splitTextCommand = function(value, func, context) {