* Console:
- Don't hide link to configui.jsp for IE any more - Add lang selection on configui.jsp - Tag strings in configui.jsp - Load console_big.css if lang == zh - Add _x() tag for static iniitializers - HTML transitional input tags
This commit is contained in:
@ -29,6 +29,11 @@ public class CSSHelper extends HelperBase {
|
||||
_context.router().setConfigSetting(Messages.PROP_LANG, lang);
|
||||
}
|
||||
|
||||
/** needed for conditional css loads for zh */
|
||||
public String getLang() {
|
||||
return Messages.getLanguage(_context);
|
||||
}
|
||||
|
||||
/** translate the title and display consistently */
|
||||
public String title(String s) {
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
|
@ -3,7 +3,7 @@ package net.i2p.router.web;
|
||||
public class ConfigUIHelper extends HelperBase {
|
||||
public ConfigUIHelper() {}
|
||||
|
||||
private static final String themes[] = {"classic", "dark", "light"};
|
||||
private static final String themes[] = {_x("classic"), _x("dark"), _x("light")};
|
||||
|
||||
public String getSettings() {
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
@ -12,7 +12,24 @@ public class ConfigUIHelper extends HelperBase {
|
||||
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
|
||||
if (theme.equals(current))
|
||||
buf.append("checked=\"true\" ");
|
||||
buf.append("value=\"").append(theme).append("\"/>").append(theme).append("<br>\n");
|
||||
buf.append("value=\"").append(theme).append("\">").append(_(theme)).append("<br>\n");
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
private static final String langs[] = {"de", "en", "fr", "nl", "se", "zh"};
|
||||
private static final String xlangs[] = {_x("German"), _x("English"), _x("French"),
|
||||
_x("Dutch"), _x("Swedish"), _x("Chinese")};
|
||||
|
||||
public String getLangSettings() {
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
String current = Messages.getLanguage(_context);
|
||||
for (int i = 0; i < langs.length; i++) {
|
||||
// we use "lang" so it is set automagically in CSSHelper
|
||||
buf.append("<input type=\"radio\" class=\"optbox\" name=\"lang\" ");
|
||||
if (langs[i].equals(current))
|
||||
buf.append("checked=\"true\" ");
|
||||
buf.append("value=\"").append(langs[i]).append("\">").append(_(xlangs[i])).append("<br>\n");
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
@ -34,4 +34,14 @@ public abstract class HelperBase {
|
||||
public String _(String s) {
|
||||
return Messages.getString(s, _context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark a string for extraction by xgettext and translation.
|
||||
* Use this only in static initializers.
|
||||
* It does not translate!
|
||||
* @return s
|
||||
*/
|
||||
public static String _x(String s) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class Messages {
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLanguage(I2PAppContext ctx) {
|
||||
public static String getLanguage(I2PAppContext ctx) {
|
||||
String lang = ctx.getProperty(PROP_LANG);
|
||||
if (lang == null || lang.length() <= 0)
|
||||
lang = _localeLang;
|
||||
|
@ -202,9 +202,9 @@ public class SummaryBarRenderer {
|
||||
buf.append("<button type=\"submit\" name=\"updateAction\" value=\"Unsigned\" >")
|
||||
.append(_("Download Unsigned"))
|
||||
.append("<br>")
|
||||
.append(_helper.getUnsignedUpdateVersion())
|
||||
.append(' ')
|
||||
.append(_("Update"))
|
||||
.append(' ')
|
||||
.append(_helper.getUnsignedUpdateVersion())
|
||||
.append("</button>\n");
|
||||
}
|
||||
buf.append("</form>\n");
|
||||
|
Reference in New Issue
Block a user