Core: Move date/time/size translations from console to core,

so apps can use them.
Fix translation in LogWriter, was never included in console.
This commit is contained in:
zzz
2019-12-17 17:21:35 +00:00
parent d054652952
commit bf94460420
37 changed files with 3901 additions and 7 deletions

View File

@ -1454,7 +1454,7 @@ public class DataHelper {
return t.replace(" ", " ");
}
private static final String BUNDLE_NAME = "net.i2p.router.web.messages";
private static final String BUNDLE_NAME = "net.i2p.util.messages";
private static String _t(String key) {
return Translate.getString(key, I2PAppContext.getGlobalContext(), BUNDLE_NAME);

View File

@ -158,17 +158,17 @@ abstract class LogWriter implements Runnable {
String arrows = reverse ? (nohtml ? "vvv" : "↓↓↓")
: (nohtml ? "^^^" : "↑↑↑");
return LogRecordFormatter.getWhen(_manager, lastRecord) + ' ' + arrows + ' ' +
_t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows +
ngettext("1 similar message omitted", "{0} similar messages omitted", dupCount) + ' ' + arrows +
LogRecordFormatter.NL;
}
private static final String BUNDLE_NAME = "net.i2p.router.web.messages";
private static final String BUNDLE_NAME = "net.i2p.util.messages";
/**
* gettext
* @since 0.9.3
*/
private String _t(int a, String b, String c) {
private String ngettext(String b, String c, int a) {
return Translate.getString(a, b, c, _manager.getContext(), BUNDLE_NAME);
}