* Translations:

- Use JVM language name if available
  - Correct Estonian language code from ee to et
This commit is contained in:
zzz
2013-01-29 13:44:36 +00:00
parent 95d0dc0419
commit 78dcfd830c
7 changed files with 41 additions and 5 deletions

View File

@ -73,7 +73,7 @@ public class ConfigUIHelper extends HelperBase {
* Any language-specific flag added to the icon set must be
* added to the top-level build.xml for the updater.
*/
private static final String langs[] = {"ar", "cs", "da", "de", "ee", "el", "en", "es", "fi",
private static final String langs[] = {"ar", "cs", "da", "de", "et", "el", "en", "es", "fi",
"fr", "hu", "it", "nl", "pl", "pt", "ru",
"sv", "uk", "vi", "zh"};
private static final String flags[] = {"lang_ar", "cz", "dk", "de", "ee", "gr", "us", "es", "fi",
@ -96,7 +96,7 @@ public class ConfigUIHelper extends HelperBase {
buf.append("checked=\"checked\" ");
buf.append("value=\"").append(langs[i]).append("\">")
.append("<img height=\"11\" width=\"16\" alt=\"\" src=\"/flags.jsp?c=").append(flags[i]).append("\"> ")
.append(_(xlangs[i])).append("<br>\n");
.append(Messages.getDisplayLanguage(langs[i], xlangs[i], _context)).append("<br>\n");
}
return buf.toString();
}

View File

@ -39,4 +39,17 @@ public class Messages extends Translate {
public static String getString(int n, String s, String p, I2PAppContext ctx) {
return Translate.getString(n, s, p, ctx, BUNDLE_NAME);
}
/**
* Return the "display language", e.g. "English" for the language specified
* by langCode, using the current language.
* Uses translation if available, then JVM Locale.getDisplayLanguage() if available, else default param.
*
* @param langCode two-letter lower-case
* @param dflt e.g. "English"
* @since 0.9.5
*/
public static String getDisplayLanguage(String langCode, String dflt, I2PAppContext ctx) {
return Translate.getDisplayLanguage(langCode, dflt, ctx, BUNDLE_NAME);
}
}