mirror of
https://github.com/Quackster/Havana.git
synced 2025-07-05 06:07:46 +00:00
Add configurable page encoding for different languages
This commit is contained in:
parent
324b1e2a83
commit
3cf2a1c313
4 changed files with 9 additions and 1 deletions
|
@ -158,7 +158,7 @@ public class ServerConfiguration {
|
||||||
* @return value
|
* @return value
|
||||||
*/
|
*/
|
||||||
public static String getString(String key) {
|
public static String getString(String key) {
|
||||||
return config.getOrDefault(key, key);
|
return config.getOrDefault(key, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Binary file not shown.
|
@ -52,6 +52,10 @@ public class HavanaWeb {
|
||||||
settings.setTemplateBase(TwigTemplate.class);
|
settings.setTemplateBase(TwigTemplate.class);
|
||||||
settings.setSaveSessions(true);
|
settings.setSaveSessions(true);
|
||||||
|
|
||||||
|
if (ServerConfiguration.getString("page.encoding").length() > 0) {
|
||||||
|
settings.setPageEncoding(ServerConfiguration.getString("page.encoding"));
|
||||||
|
}
|
||||||
|
|
||||||
// Spammers
|
// Spammers
|
||||||
/*Settings.getInstance().getBlockIpv4().add("192.190");
|
/*Settings.getInstance().getBlockIpv4().add("192.190");
|
||||||
Settings.getInstance().getBlockIpv4().add("79.108");
|
Settings.getInstance().getBlockIpv4().add("79.108");
|
||||||
|
|
|
@ -27,6 +27,8 @@ public class WebServerConfigWriter implements ConfigWriter {
|
||||||
|
|
||||||
config.put("template.directory", "tools/www-tpl");
|
config.put("template.directory", "tools/www-tpl");
|
||||||
config.put("template.name", "default-en");
|
config.put("template.name", "default-en");
|
||||||
|
|
||||||
|
config.put("page.encoding", "utf-8");
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +55,8 @@ public class WebServerConfigWriter implements ConfigWriter {
|
||||||
writer.println("[Template]");
|
writer.println("[Template]");
|
||||||
writer.println("template.directory=" + config.get("template.directory"));
|
writer.println("template.directory=" + config.get("template.directory"));
|
||||||
writer.println("template.name=" + config.get("template.name"));
|
writer.println("template.name=" + config.get("template.name"));
|
||||||
|
writer.println("");
|
||||||
|
writer.println("page.encoding=" + config.get("page.encoding"));
|
||||||
writer.flush();
|
writer.flush();
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue