Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Mizunashi Mana 2015-05-25 00:53:48 +09:00
commit c031c604bd
24 changed files with 283 additions and 58 deletions

View file

@ -34,7 +34,7 @@ var str = exports.str = function(key, params) {
var locale = LocaleStore.getLocale();
if (!strings[key]) {
console.warn('NO INTL support for key ' + key);
return 'NO INTL support for key ' + key;
return 'NO INTL support for key ' + key + '. this is probably a dev error';
}
if (!strings[key][locale]) {
@ -55,7 +55,7 @@ var str = exports.str = function(key, params) {
);
};
var getIntlKey = exports.getIntlKey = function(obj, key) {
var getIntlKey = exports.getIntlKey = function(obj, key, overrideLocale) {
if (!obj || !obj[key]) {
throw new Error('that key ' + key + 'doesnt exist in this blob' + obj);
}
@ -68,7 +68,8 @@ var getIntlKey = exports.getIntlKey = function(obj, key) {
);
}
return obj[key][LocaleStore.getLocale()];
var locale = overrideLocale || LocaleStore.getLocale();
return obj[key][locale];
};
exports.todo = function(str) {
@ -80,11 +81,17 @@ exports.getDialog = function(obj) {
};
exports.getHint = function(level) {
return getIntlKey(level, 'hint') || str('error-untranslated');
if (!getIntlKey(level, 'hint')) {
return getIntlKey(level, 'hint', getDefaultLocale()) + ' -- ' + str('error-untranslated');
}
return getIntlKey(level, 'hint');
};
exports.getName = function(level) {
return getIntlKey(level, 'name') || str('error-untranslated');
if (!getIntlKey(level, 'name')) {
return getIntlKey(level, 'name', getDefaultLocale()) + ' -- ' + str('error-untranslated');
}
return getIntlKey(level, 'name');
};
exports.getStartDialog = function(level) {

View file

@ -744,7 +744,7 @@ exports.strings = {
'es_AR': 'No se encontró ningún nivel {id}. Abriendo la vista de selección de niveles...',
'pt_BR': 'O nível "{id}" não existe! Abrindo uma caixa de seleção de nível',
'fr_FR': 'Le niveau dont l\'identifiant est {id} n\'a pas été trouvé ! Ouverture de la vue de sélection des niveaux',
'ru_RU': 'Уровень с id "{id}" не найде! Открываю выбор уровней'
'ru_RU': 'Уровень с id "{id}" не найден! Открываю выбор уровней'
},
///////////////////////////////////////////////////////////////////////////
'undo-stack-empty': {
@ -900,7 +900,7 @@ exports.strings = {
'pt_BR': 'Mostrar objetivo',
'es_AR': 'Mostrar objetivo',
'ja' : 'ゴールを表示',
'ru_RU': 'Показать цель уровня'
'ru_RU': 'Цель уровня'
},
///////////////////////////////////////////////////////////////////////////
'hide-goal-button': {

View file

@ -81,6 +81,12 @@ var IntlHelperBarView = React.createClass({
onClick: function() {
this.fireCommand('locale de_DE; levels');
}.bind(this)
}, {
text: 'Русский',
testID: 'russian',
onClick: function() {
this.fireCommand('locale ru_RU; levels');
}.bind(this)
}, {
icon: 'signout',
onClick: function() {

View file

@ -63,6 +63,10 @@ var MainHelperBarView = React.createClass({
shownBar: BARS.INTL
});
}.bind(this)
}, {
newPageLink: true,
icon: 'twitter',
href: 'https://twitter.com/petermcottle'
}, {
newPageLink: true,
icon: 'facebook',