i wanted to ask the community for feedback on an ever recurring issue that we are facing in many of our BloomReach projects. We are making extensive use of Resource Bundles to manage static texts and labels in various areas of our pages.
However, once those resource bundles are deployed on a production environment, they are treated as regular content (as expected). This makes it tricky for us to extend and upgrade existing resource bundles when deploying new releases of the system.
Consider the usecase that we want to add a new label to an element on the page and for consistency and editor friendliness want it to reside in an existing resource bundle. As the resource bundle already exists we cannot reload it via a hcm-actions entry as this would eliminate potential changes made by the editors. At the same time we need the value to be present once the new version is deployed if we don’t want a ???my_tag??? text popping up on our site as the fmt:message tag does not really support defaults.
We already came up with different ideas how to manage this and are really interested if the community or the BloomReach Devs have other interesting ideas or best practices to properly solve this:
Manually add the new resource bundle key before deployment: This is very undesirable as we strive to completely eliminate manual steps in the deployment process to achieve a real CD environment.
Add a custom template macro / tag that provides the option to replace a missing value with a default (by checking if the value from the resource bundle contains the ??? substring): This is also undesirable as it does not offer multi language support and clutters the template with unnecessary default texts
Reading all resource bundle values in components / Java code and replace with defaults where necessary: This again is undesirable as we lose the option of using the provided fmt:message tag and also have to keep the defaults somewhere which produces ugly code and is not multi language safe
Writing custom updater Scripts that add new keys to the resource bundle: Again, we believe this to be undesirable as Updater Scripts are yet another manual step during deployment and can potentially cause significant bugs. Also, the developers have to keep track and update the script (or its parameters) for every deployment which is quite error prone
So if you have any other approach to this, we would greatly appreciate any feedback on this!
All the best,