Merge pull request #4873 from gisikw/repair_broken_test_suite

Repair Broken Test Suite - Full Passing Tests
This commit is contained in:
Alys
2015-03-26 14:49:28 +10:00
14 changed files with 147 additions and 79 deletions

View File

@@ -4889,7 +4889,11 @@ module.exports = {
if ((locale == null) || (!module.exports.strings && !module.exports.translations[locale])) {
locale = 'en';
}
string = !module.exports.strings ? module.exports.translations[locale][stringName] : module.exports.strings[stringName];
if (module.exports.strings) {
string = module.exports.strings[stringName];
} else {
string = module.exports.translations[locale] && module.exports.translations[locale][stringName];
}
clonedVars = _.clone(vars) || {};
clonedVars.locale = locale;
if (string) {
@@ -4900,7 +4904,11 @@ module.exports = {
return 'Error processing string. Please report to http://github.com/HabitRPG/habitrpg.';
}
} else {
stringNotFound = !module.exports.strings ? module.exports.translations[locale].stringNotFound : module.exports.strings.stringNotFound;
if (module.exports.strings) {
stringNotFound = module.exports.strings.stringNotFound;
} else if (module.exports.translations[locale]) {
stringNotFound = module.exports.translations[locale] && module.exports.translations[locale].stringNotFound;
}
try {
return _.template(stringNotFound, {
string: stringName