Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
6.2.X EE, 7.0.0 DXP FP22, 7.0.X EE, Master
-
7.0.x, 6.2.x
-
Committed
-
3
-
Localization
Description
Steps - 7.0.x/master
- Log in with Test
- Change display language to German
- Go to Product Menu - Control Panel - Apps - Components
- In that page you should see these entries, among others:
Benutzergruppen Benutzerstatistiken Benutzer und Organisationen
Steps - 6.2.x
- Log in with Test
- Change display language to German
- Go to Control Panel - Apps - Plugins Configuration - "Portlet Plugins" tab
- In that page you should see these entries, among others:
Benutzergruppen Benutzerstatistiken Benutzer und Organisationen
Problem: "Benutzer und Organisationen" should appear before "Benutzergruppen" according to the German rules.
You can verify it on http://alphabetizer.flap.tv/.
Technical Background
- com.liferay.portal.util.comparator.PortletTitleComparator.compare(Portlet,Portlet) is responsible for comparing portlet titles: https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/util/comparator/PortletTitleComparator.java#L51-L80
- We are using Java Collator based on the given Locale
- Collator may handle spaces and other characters in a non-expected order. See
QA/Solution Notes
The following portal property has been added:
portal.properties
# # Specify the collator rules to be used by the CollatorUtil. These rules, if # set, are provided to a RulesBasedCollator for text sorting and are only # configurable by locale. A file can also be used by prefixing "file\:" to # a path on the file system. Using a file means property escaping can be # avoided. # # See https://issues.liferay.com/browse/LPS-73600 for more information. # #collator.rules[en_US]=
Reference: https://docs.oracle.com/javase/8/docs/api/java/text/RuleBasedCollator.html
When using a file to configure rules (
collator.rules[en_US]=file\:/path/to/file.txt
), the content should just be the value of the rule, no property escaping is needed.
Example for using a file for rules (on Linux):
add these lines to portal-ext.properties file:
collator.rules[de]=file\:/home/liferay/bundles/ee-6.2.x/rules.txt collator.rules[en_US]=file\:/home/liferay/bundles/ee-6.2.x/rules.txt collator.rules[de_DE]=file\:/home/liferay/bundles/ee-6.2.x/rules.txt
And the rules.txt file should contain this line:
='_' < ' ' < a,A < b,B < c,C < d,D < e,E < f,F < g,G < h,H < i,I < j,J < k,K < l,L < m,M < n,N < o,O < p,P < q,Q < r,R < s,S < t,T < u,U < v,V < w,W < x,X < y,Y < z,Z
Example configurations for "German" language:
collator.rules[de]=<'\ '<a\,A<b\,B<c\,C<d\,D<e\,E<f\,F<g\,G<h\,H<i\,I<j\,J<k\,K<l\,L<m\,M<n\,N<o\,O<p\,P<q\,Q<r\,R<s\,S<t\,T<u\,U<v\,V<w\,W<x\,X<y\,Y<z\,Z collator.rules[de_DE]=<'\ '<a\,A<b\,B<c\,C<d\,D<e\,E<f\,F<g\,G<h\,H<i\,I<j\,J<k\,K<l\,L<m\,M<n\,N<o\,O<p\,P<q\,Q<r\,R<s\,S<t\,T<u\,U<v\,V<w\,W<x\,X<y\,Y<z\,Z