Fix app.name override: use intl.addTranslations at runtime
Root cause: ember-intl merge order gives host app translations priority over
addon translations. The translations/en-us.yaml file was silently ignored.
Solution: Call intl.addTranslations('en-us', { 'app.name': 'Biibaye' })
at runtime from both setupExtension and onEngineLoaded hooks. This injects
the translation into the active intl service after the app boots.
Also removes the non-functional translations/en-us.yaml file.
This commit is contained in:
@ -3,15 +3,28 @@ export default {
|
|||||||
setDocumentTitle();
|
setDocumentTitle();
|
||||||
injectBrandStyles();
|
injectBrandStyles();
|
||||||
replaceFavicon();
|
replaceFavicon();
|
||||||
|
overrideAppName(appInstance);
|
||||||
|
|
||||||
universe.extensionManager.ensureEngineLoaded('@biibaye/branding');
|
universe.extensionManager.ensureEngineLoaded('@biibaye/branding');
|
||||||
},
|
},
|
||||||
|
|
||||||
onEngineLoaded(engineInstance, universe, appInstance) {
|
onEngineLoaded(engineInstance, universe, appInstance) {
|
||||||
setDocumentTitle();
|
setDocumentTitle();
|
||||||
|
overrideAppName(appInstance);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function overrideAppName(appInstance) {
|
||||||
|
try {
|
||||||
|
const intl = appInstance.lookup('service:intl');
|
||||||
|
if (intl && typeof intl.addTranslations === 'function') {
|
||||||
|
intl.addTranslations('en-us', { 'app.name': 'Biibaye' });
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// intl service not available yet — will retry in onEngineLoaded
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setDocumentTitle() {
|
function setDocumentTitle() {
|
||||||
document.title = 'Biibaye - Delivery System';
|
document.title = 'Biibaye - Delivery System';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
app.name: Biibaye
|
|
||||||
Reference in New Issue
Block a user