New documents and folders with a name other than the JCR node name get a locale-specific 'pretty name'. As a result, logging in with another language shows the JCR node name instead of the entered pretty name.
Steps to reproduce in the archetype:
1. Login with language English
2. Navigate to the 'Browse' perspective
3. Add a new folder with the name 'My Folder'
5. Login with language Dutch
6. Navigate to the Browse perspective and locate the folder
Expected: the folder is called 'My Folder'
Actual: the folder is called 'my-folder'
The same happens for documents, images and assets.
More info: when the 'pretty' name of the folder is different from the JCR node name (due to the spaces and capitals), the 'my-folder' node will get a child node 'hippo:translation' with a property 'hippo:message' set to 'My Folder' and a property 'hippo:language'. The property 'hippo:language' should be set to an empty string, which was the behavior <= 7.8.3 and <= 7.7.9. As a result, any folder created in the CMS could have only one pretty name. Currently, the property 'hippo:language' is set the the locale of the CMS (e.g. the language selected in the login screen). This is the behavior in >= 7.8.4 and >= 7.7.10. As a result, all folders and documents created via the CMS get a completely different name depending on the CMS language.
The following XPATH query reveals all hippo:translation nodes with a non-empty hippo:language property:
Many parts of the CMS could not cope with such specific locales for folders. One example is fixed in
CMS7-7092, but the fix in there was all wrong. In fact, the 'bug' described in CMS7-7092 is in fact the correct behavior! The folder in the related customer issue most likely had a specific locale 'nl', and a user logged in with language 'Dutch' tried to rename it. In that case a second hippo:translation node would be added with an empty locale and the new name. Yet the CMS would still show the value of the first hippo:translation node because it had a specific 'nl' locale for the current CMS language. Consequently, the user thought his rename failed. So the root problem is that the folder had a specific locale in the first place.
Due to changes in CMS7-7096 and
CMS7-7441, all new folders and documents created in the CMS whose pretty names differ from the JCR node name, will now have a pretty name specific for the CMS locale of the user who created it. All projects that run CMS >= 7.8.4 or CMS >= 7.7.10 may contain such 'polluted' folders and documents in their repositories.
1. We revert the old behavior when creating new documents and folders. They will again get a hippo:translation node with the 'hippo:message' property set to the display name, and an EMPTY hippo:language property. New documents and folders will thus have ONLY ONE display name.
2. If a document or folder with multiple translations is renamed, the new name replaces all existing translations. The rename dialog will initially show a warning to make this explicit. Hence, multiple translations are also converted to case 1 after a rename.
3. If a document or folder has only one translation with an explicit locale, the new name will replace the existing one without a warning, and the hippo:language property will be made empty again. This 'fixes' the erroneous situation introduced by earlier changes.