-
Improvement
-
Resolution: Fixed
-
Neutral
-
None
-
None
-
None
-
-
Empty show more show less
-
Basel 79, Basel 80, Basel 83
-
5
While QAing MAGNOLIA-6724 & MGNLGROOVY-143 we found that info.magnolia.i18nsystem.DefaultMessageBundlesLoader#logDuplicates and its verbose output in the log was printed twice – once upon component initialisation and once when calling info.magnolia.i18nsystem.TranslationServiceImpl#reloadMessageBundles.
The reason is that info.magnolia.i18nsystem.TranslationServiceImpl#setupMessageBundles creates a new instance of DefaultMessageBundlesLoader for each call, therefore omitting the component definition in META-INF/magnolia/i18n.xml of the i18n module.
It would be desirable to use
protected DefaultMessageBundlesLoader setupMessageBundles() { return componentProvider.getComponent(DefaultMessageBundlesLoader.class); }
instead of
protected DefaultMessageBundlesLoader setupMessageBundles() { return componentProvider.newInstance(DefaultMessageBundlesLoader.class, resourceOrigin); }
in order to only maintain one component and therefore preventing potential memory leaks.
However this will prevent for any changes in message properties files to be reflected in the translation service during runtime. Possible workaround could be to add the possibility to reload message property files in DefaultMessageBundlesLoader or make it aware of changes in origins (info.magnolia.resourceloader.ResourceOriginChange). Ideally we move registration of the event handler for ModulesStartedEvent to the component DefaultMessageBundlesLoader.
We should investigate and also find out why the new instance call was added in the first place and what impact above change could have.
- is cloned by
-
MAGNOLIA-7003 CLONE - DefaultMessageBundlesLoader is always re-instantiated in order to reflect changes in message bundle
- Open
- relates to
-
MAGNOLIA-6724 TranslationService should not throw ProvisionException when i18nModule is not ready
- Closed
-
MAGNOLIA-6927 TempFileSystemResourceOrigin might behave differently depending on the operating system causing test failures
- Open