* 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:
zzz
2009-10-22 22:25:53 +00:00
parent ffd2721627
commit 0c74e640df
9 changed files with 67 additions and 23 deletions

View File

@ -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);

View File

@ -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();
}

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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");