|
@@ -15,13 +15,13 @@
|
|
|
// limitations under the License.
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
const I18n = (identifier, ...replacements) => {
|
|
const I18n = (identifier, ...replacements) => {
|
|
|
- if (window.DJANGO_DEBUG_MODE && !HUE_I18n[identifier]) {
|
|
|
|
|
|
|
+ if (window.DJANGO_DEBUG_MODE && !window.HUE_I18n[identifier]) {
|
|
|
if (!window.missing_I18n) {
|
|
if (!window.missing_I18n) {
|
|
|
window.missing_I18n = [];
|
|
window.missing_I18n = [];
|
|
|
}
|
|
}
|
|
|
window.missing_I18n.push(`'${identifier}': '\${ _('${identifier}') }',`);
|
|
window.missing_I18n.push(`'${identifier}': '\${ _('${identifier}') }',`);
|
|
|
}
|
|
}
|
|
|
- let result = HUE_I18n[identifier] || identifier;
|
|
|
|
|
|
|
+ let result = (window.HUE_I18n && window.HUE_I18n[identifier]) || identifier;
|
|
|
replacements.forEach(replacement => {
|
|
replacements.forEach(replacement => {
|
|
|
result = result.replace('%s', replacement);
|
|
result = result.replace('%s', replacement);
|
|
|
});
|
|
});
|