mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +02:00
intl dom refresh when locale changes final push for Issue #42
This commit is contained in:
parent
1b0d836a42
commit
bd62fa735e
9 changed files with 55 additions and 8 deletions
|
@ -6602,7 +6602,8 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
'learn-git-branching': {
|
||||
'__desc__': 'The title of the app, with spaces',
|
||||
'en_US': 'Learn Git Branching'
|
||||
'en_US': 'Learn Git Branching',
|
||||
'ko': 'Git 브랜치 배우기'
|
||||
},
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
'select-a-level': {
|
||||
|
@ -6845,10 +6846,21 @@ var init = function() {
|
|||
wait: true
|
||||
});
|
||||
|
||||
events.on('localeChanged', intlRefresh);
|
||||
|
||||
initRootEvents(eventBaton);
|
||||
initDemo(sandbox);
|
||||
};
|
||||
|
||||
var intlRefresh = function() {
|
||||
if (!window.$) { return; }
|
||||
$('span.intl-aware').each(function(i, el) {
|
||||
var intl = require('../intl');
|
||||
var key = $(el).attr('data-intl');
|
||||
$(el).text(intl.str(key).toUpperCase());
|
||||
});
|
||||
};
|
||||
|
||||
var initRootEvents = function(eventBaton) {
|
||||
// we always want to focus the text area to collect input
|
||||
var focusTextArea = function() {
|
||||
|
@ -13747,6 +13759,8 @@ var instantCommands = [
|
|||
}],
|
||||
[/^(locale|locale reset)$/, function(bits) {
|
||||
constants.GLOBAL.locale = intl.getDefaultLocale();
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-reset-command',
|
||||
|
@ -13757,6 +13771,7 @@ var instantCommands = [
|
|||
[/^locale (\w+)$/, function(bits) {
|
||||
constants.GLOBAL.locale = bits[1];
|
||||
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-command',
|
||||
|
@ -20173,10 +20188,21 @@ var init = function() {
|
|||
wait: true
|
||||
});
|
||||
|
||||
events.on('localeChanged', intlRefresh);
|
||||
|
||||
initRootEvents(eventBaton);
|
||||
initDemo(sandbox);
|
||||
};
|
||||
|
||||
var intlRefresh = function() {
|
||||
if (!window.$) { return; }
|
||||
$('span.intl-aware').each(function(i, el) {
|
||||
var intl = require('../intl');
|
||||
var key = $(el).attr('data-intl');
|
||||
$(el).text(intl.str(key).toUpperCase());
|
||||
});
|
||||
};
|
||||
|
||||
var initRootEvents = function(eventBaton) {
|
||||
// we always want to focus the text area to collect input
|
||||
var focusTextArea = function() {
|
||||
|
@ -22887,7 +22913,8 @@ require.define("/src/js/intl/strings.js",function(require,module,exports,__dirna
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
'learn-git-branching': {
|
||||
'__desc__': 'The title of the app, with spaces',
|
||||
'en_US': 'Learn Git Branching'
|
||||
'en_US': 'Learn Git Branching',
|
||||
'ko': 'Git 브랜치 배우기'
|
||||
},
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
'select-a-level': {
|
||||
|
@ -24714,6 +24741,8 @@ var instantCommands = [
|
|||
}],
|
||||
[/^(locale|locale reset)$/, function(bits) {
|
||||
constants.GLOBAL.locale = intl.getDefaultLocale();
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-reset-command',
|
||||
|
@ -24724,6 +24753,7 @@ var instantCommands = [
|
|||
[/^locale (\w+)$/, function(bits) {
|
||||
constants.GLOBAL.locale = bits[1];
|
||||
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-command',
|
||||
|
@ -25192,7 +25222,8 @@ var toGlobalize = {
|
|||
GitDemonstrationView: require('../views/gitDemonstrationView'),
|
||||
Markdown: require('markdown'),
|
||||
LevelDropdownView: require('../views/levelDropdownView'),
|
||||
BuilderViews: require('../views/builderViews')
|
||||
BuilderViews: require('../views/builderViews'),
|
||||
Intl: require('../intl')
|
||||
};
|
||||
|
||||
_.each(toGlobalize, function(module) {
|
||||
|
|
1
build/bundle.min.4924ef88.js
Normal file
1
build/bundle.min.4924ef88.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
build/bundle.min.js
vendored
2
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -412,7 +412,7 @@
|
|||
For a much easier time perusing the source, see the individual files at:
|
||||
https://github.com/pcottle/learnGitBranching
|
||||
-->
|
||||
<script src="build/bundle.min.6e347137.js"></script>
|
||||
<script src="build/bundle.min.4924ef88.js"></script>
|
||||
|
||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||
The downside? No raw logs to parse for analytics, so I have to include
|
||||
|
|
|
@ -40,10 +40,21 @@ var init = function() {
|
|||
wait: true
|
||||
});
|
||||
|
||||
events.on('localeChanged', intlRefresh);
|
||||
|
||||
initRootEvents(eventBaton);
|
||||
initDemo(sandbox);
|
||||
};
|
||||
|
||||
var intlRefresh = function() {
|
||||
if (!window.$) { return; }
|
||||
$('span.intl-aware').each(function(i, el) {
|
||||
var intl = require('../intl');
|
||||
var key = $(el).attr('data-intl');
|
||||
$(el).text(intl.str(key).toUpperCase());
|
||||
});
|
||||
};
|
||||
|
||||
var initRootEvents = function(eventBaton) {
|
||||
// we always want to focus the text area to collect input
|
||||
var focusTextArea = function() {
|
||||
|
|
|
@ -2,7 +2,8 @@ exports.strings = {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
'learn-git-branching': {
|
||||
'__desc__': 'The title of the app, with spaces',
|
||||
'en_US': 'Learn Git Branching'
|
||||
'en_US': 'Learn Git Branching',
|
||||
'ko': 'Git 브랜치 배우기'
|
||||
},
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
'select-a-level': {
|
||||
|
|
|
@ -23,6 +23,8 @@ var instantCommands = [
|
|||
}],
|
||||
[/^(locale|locale reset)$/, function(bits) {
|
||||
constants.GLOBAL.locale = intl.getDefaultLocale();
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-reset-command',
|
||||
|
@ -33,6 +35,7 @@ var instantCommands = [
|
|||
[/^locale (\w+)$/, function(bits) {
|
||||
constants.GLOBAL.locale = bits[1];
|
||||
|
||||
var Main = require('../app').getEvents().trigger('localeChanged');
|
||||
throw new CommandResult({
|
||||
msg: intl.str(
|
||||
'locale-command',
|
||||
|
|
|
@ -23,7 +23,8 @@ var toGlobalize = {
|
|||
GitDemonstrationView: require('../views/gitDemonstrationView'),
|
||||
Markdown: require('markdown'),
|
||||
LevelDropdownView: require('../views/levelDropdownView'),
|
||||
BuilderViews: require('../views/builderViews')
|
||||
BuilderViews: require('../views/builderViews'),
|
||||
Intl: require('../intl')
|
||||
};
|
||||
|
||||
_.each(toGlobalize, function(module) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue