Greg Sheremeta has uploaded a new change for review.

Change subject: userportal, webadmin: fixed a bug in non-English docs serving
......................................................................

userportal, webadmin: fixed a bug in non-English docs serving

Non-English docs could not be served because of a path error
(- vs. _ in the locale name). Fixed.

The rhevm-doc locale directory names always have a -, whereas the
webapp uses _ when looking for the docs.

Change-Id: Icab12b8db9b1216b4c7d588095af36e0b8a2520a
Signed-off-by: Greg Sheremeta <[email protected]>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/DocsServlet.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/29585/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/DocsServlet.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/DocsServlet.java
index 6ffa032..a4d8ac5 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/DocsServlet.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/DocsServlet.java
@@ -125,7 +125,9 @@
      * @return A {@code File} object pointing to the requested file.
      */
     protected File determineActualFile(final HttpServletRequest request, 
Locale locale) {
-        File file = ServletUtils.makeFileFromSanePath(request.getPathInfo(), 
base);
+        // webapp asks for files in xx_XX locale, but the directory has a - 
not a _ . Convert.
+        File file = 
ServletUtils.makeFileFromSanePath(replaceLocaleWithOtherLocale(request.getPathInfo(),
 locale, locale), base);
+
         // Check if file is found. If not found go ahead and try and look up 
the English US locale version.
         if (file != null && !ServletUtils.canReadFile(file)) {
             file = 
ServletUtils.makeFileFromSanePath(replaceLocaleWithUSLocale(request.getPathInfo(),
 locale), base);


-- 
To view, visit http://gerrit.ovirt.org/29585
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icab12b8db9b1216b4c7d588095af36e0b8a2520a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Sheremeta <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to