Einav Cohen has posted comments on this change.

Change subject: userportal,webadmin: fix locale detection documentation
......................................................................


Patch Set 2: (2 inline comments)

....................................................
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);
I understand the fix (the org.apache.commons.lang.LocaleUtils.toLocale() method 
expects to accept as a parameter string with "_" rather than "-" [1]).

However, I don't understand why this patch fixes the problem: AFAIK, the only 
call to this method from the DocsServlet is with "returnDefaultLocale = true"; 
so even before this fix, this method always returned something: either the 
"real" locale, or the default "Locale.US" locale; so how come the experienced 
behavior was to eventually receive a 404 response? "Locale.US" is a legitimate 
return value for this method, and the US documentation is always installed.

[1] 
http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/LocaleUtils.html#toLocale(java.lang.String)
Line 34:             if(result == null && returnDefaultLocale) {
Line 35:                 result = Locale.US;
Line 36:             }
Line 37:         }


....................................................
Commit Message
Line 3: AuthorDate: 2013-05-14 14:54:22 -0400
Line 4: Commit:     Alexander Wels <[email protected]>
Line 5: CommitDate: 2013-05-14 15:31:42 -0400
Line 6: 
Line 7: userportal,webadmin: fix locale detection documentation
maybe "fix documentation locale detection" (or "fix locale detection for 
documentation")?
Line 8: 
Line 9: - Fixed issue with locale detection using the URL path.
Line 10: 
Line 11: Change-Id: Iecb2708a201d94119db14521708bf53e42b6384d


--
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

Reply via email to