-
Bug
-
Resolution: Duplicate
-
Major
-
5.1
-
None
To reproduce:
1. Create a new message property file in a project that has the same name as the property file in a different project.
ie we discovered this when trying to create a new shellapp-app-launcher-messages_en.properties in the stk project (one already exists in admincentral at:
/magnolia-ui-admincentral/src/main/resources/mgnl-i18n/shellapp-app-launcher-messages_en.properties)
2. Add some keys to it.
3. Run magnolia and see how only the keys from one of the files are used.
Analysis:
files are loaded at: info.magnolia.i18nsystem.DefaultMessageBundlesLoader#loadMessages()
This uses ClasspathResourcesUtil.findResources(new ClasspathResourcesUtil.Filter()
findResources uses a HashSet to store found resources. So probably each time a new file with the same name (path) is discovered - it replaces the one that was already in the HashSet.
I wonder if this was intentional in findResources? My first assumption is that findResources is the problem and the implementation should be changed. Maybe it is assuming that all files come from one parent directory?
Note the hashmap is working with the full path under the mgnl-i18n directory - so if two files have same name, but one is in a subdirectory - then both files will be loaded as the path is different.
- duplicates
-
MAGNOLIA-5635 i18n message bundle resolver cannot handle identical named files
- Closed