From 25426c6548f9c0ffc55f6494ef6a308af6ed9862 Mon Sep 17 00:00:00 2001 From: lotus Date: Sat, 13 Nov 2010 14:27:30 +0000 Subject: [PATCH] change language immediately there is a bad behaviour: if language is changed, servlets are translated but the returning servlet is yet the old one. therefore the page is loaded again after language changed. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7321 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigBasic.html | 10 +++++++--- htroot/ConfigBasic.java | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html index 05b07bdf8..2f69141b7 100644 --- a/htroot/ConfigBasic.html +++ b/htroot/ConfigBasic.html @@ -13,6 +13,8 @@ #(reconnect)#::#(/reconnect)# + + #(changedLanguage)#::#(/changedLanguage)# #%env/templates/header.template%# @@ -30,11 +32,13 @@
  • ok Select a language for the interface:
    -   -   - +   +   +
  • + + #(setUseCase)#::
  • diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index c2b118c43..87e85bd42 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -84,7 +84,8 @@ public class ConfigBasic { // language settings if ((post != null) && (!(post.get("language", "default").equals(lang)))) { - translator.changeLang(env, langPath, post.get("language", "default") + ".lng"); + if (translator.changeLang(env, langPath, post.get("language", "default") + ".lng")) + prop.put("changedLanguage", "1"); } // peer name settings @@ -92,7 +93,7 @@ public class ConfigBasic { // port settings long port = env.getConfigLong("port", 8080); //this allows a low port, but it will only get one, if the user edits the config himself. - if (post != null && Integer.parseInt(post.get("port")) > 1023) { + if (post != null && post.containsKey("port") && Integer.parseInt(post.get("port")) > 1023) { port = post.getLong("port", 8080); }