Alexander Wels has posted comments on this change.
Change subject: userportal,webadmin: fix locale detection documentation
......................................................................
Patch Set 2: (1 inline comment)
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/LocaleUtils.java
Line 29: public static Locale getLocaleFromString(String localeString,
boolean returnDefaultLocale) {
Line 30: Locale result = returnDefaultLocale ? null : Locale.US;
Line 31: try {
Line 32: result =
org.apache.commons.lang.LocaleUtils.toLocale(localeString != null ?
Line 33: localeString.replaceAll("\\-", "_") :
localeString);
The problem happens because the returned locale is en_US due to the bug, even
though we passed in a string that was supposed to return lets say the french
locale if the passed in string is fr-FR.
We then take that locale value returned and use that in the
replaceLocaleWithUSLocale method. Because the returned locale was the US locale
it would not match the regular expression in that method, and nothing would get
replaced, so we would never get the proper path to the english documentation
and we would never find the file, and thus it would return a 404 file not found.
With the fix it finds the proper locale, which in turn now matches the regular
expression which in turn now returns the right english document, which we can
now return to the user.
Line 34: if(result == null && returnDefaultLocale) {
Line 35: result = Locale.US;
Line 36: }
Line 37: }
--
To view, visit http://gerrit.ovirt.org/14734
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecb2708a201d94119db14521708bf53e42b6384d
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches