mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-13 16:14:27 +02:00
Imported all zh_CN dialogs and added locale changing support Issue #42
This commit is contained in:
parent
2617357460
commit
cc5466b038
22 changed files with 1693 additions and 222 deletions
|
@ -7,9 +7,7 @@ var TIME = {
|
|||
|
||||
// useful for locks, etc
|
||||
var GLOBAL = {
|
||||
isAnimating: false,
|
||||
// default locale, this changes
|
||||
locale: 'en'
|
||||
isAnimating: false
|
||||
};
|
||||
|
||||
var VIEWPORT = {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue