From a51417d86b496e811996c6307907bfc58ce88d4a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6c8d7289-2bf4-0310-a012-ef5d649a1542> Date: Thu, 9 Nov 2006 22:18:16 +0000 Subject: [PATCH] Bugfix: language of ConfigLanguage_p.html was not changed properly when a different language was choosen here git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2948 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigLanguage_p.html | 2 +- htroot/ConfigLanguage_p.java | 6 +++--- source/de/anomic/http/httpdFileHandler.java | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htroot/ConfigLanguage_p.html b/htroot/ConfigLanguage_p.html index 50673356e..27ac1b529 100644 --- a/htroot/ConfigLanguage_p.html +++ b/htroot/ConfigLanguage_p.html @@ -48,7 +48,7 @@
- #{langlist}# #{/langlist}# diff --git a/htroot/ConfigLanguage_p.java b/htroot/ConfigLanguage_p.java index c572f1fa7..ab4c41dba 100644 --- a/htroot/ConfigLanguage_p.java +++ b/htroot/ConfigLanguage_p.java @@ -84,12 +84,12 @@ public class ConfigLanguage_p { if (post != null){ //change language - if(post.containsKey("use_button") && (String)post.get("lang") != null){ - translator.changeLang(env, langPath, (String)post.get("lang")); + if(post.containsKey("use_button") && (String)post.get("language") != null){ + translator.changeLang(env, langPath, (String)post.get("language")); //delete language file }else if(post.containsKey("delete")){ - File langfile= new File(langPath, (String)post.get("lang")); + File langfile= new File(langPath, (String)post.get("language")); langfile.delete(); //load language file from URL diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index cb319608b..a26ae69b9 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -444,8 +444,15 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http // a different language can be desired (by i.e. ConfigBasic.html) than the one stored in the htLocaleSelection String localeSelection = switchboard.getConfig("htLocaleSelection","default"); - if (args != null) + if (args != null && (args.containsKey("language"))) + { + // TODO 9.11.06 Bost: a class with information about available languages is needed. + // the indexOf(".") is just a workaround because there from ConfigLanguage.html commes "de.lng" and + // from ConfigBasic.html comes just "de" in the "language" parameter localeSelection = args.get("language", localeSelection); + if (localeSelection.indexOf(".") != -1) + localeSelection = localeSelection.substring(0, localeSelection.indexOf(".")); + } File targetFile = getLocalizedFile(path, localeSelection); String targetExt = conProp.getProperty("EXT","");