Rename _() for translation to _t() for Java 9 compatibility (ticket #1456)

This commit is contained in:
dg2-new
2015-09-25 19:55:36 +00:00
parent 04690bed9f
commit 22b9876b68
227 changed files with 2930 additions and 2927 deletions

View File

@@ -1546,7 +1546,7 @@ public class DataHelper {
// years
t = ngettext("1 year", "{0} years", (int) (ms / (365L * 24 * 60 * 60 * 1000)));
} else {
return _("n/a");
return _t("n/a");
}
// Replace minus sign to work around
// bug in Chrome (and IE?), line breaks at the minus sign
@@ -1593,7 +1593,7 @@ public class DataHelper {
// years
t = ngettext("1 year", "{0} years", (int) (ms / (365L * 24 * 60 * 60 * 1000)));
} else {
return _("n/a");
return _t("n/a");
}
if (ms < 0)
t = t.replace("-", "&minus;");
@@ -1602,7 +1602,7 @@ public class DataHelper {
private static final String BUNDLE_NAME = "net.i2p.router.web.messages";
private static String _(String key) {
private static String _t(String key) {
return Translate.getString(key, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
}

View File

@@ -145,7 +145,7 @@ abstract class LogWriterBase implements Runnable {
private String dupMessage(int dupCount, LogRecord lastRecord, boolean reverse) {
String arrows = reverse ? "&darr;&darr;&darr;" : "^^^";
return LogRecordFormatter.getWhen(_manager, lastRecord) + ' ' + arrows + ' ' +
_(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows + '\n';
_t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows + '\n';
}
private static final String BUNDLE_NAME = "net.i2p.router.web.messages";
@@ -154,7 +154,7 @@ abstract class LogWriterBase implements Runnable {
* gettext
* @since 0.9.3
*/
private String _(int a, String b, String c) {
private String _t(int a, String b, String c) {
return Translate.getString(a, b, c, _manager.getContext(), BUNDLE_NAME);
}

View File

@@ -65,7 +65,7 @@ public abstract class Translate {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _("foo {0} bar", _("baz"))
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/