MCPcopy
hub / github.com/tonikelope/megabasterd / tr

Method tr

src/main/java/com/tonikelope/megabasterd/I18n.java:79–100  ·  view source on GitHub ↗

Translate a key to the current locale. Lookup order: external override file (if loaded) -> active locale bundle -> English root bundle -> the key itself.

(String key)

Source from the content-addressed store, hash-verified

77 * bundle -> English root bundle -> the key itself.
78 */
79 public static String tr(String key) {
80 if (key == null) {
81 return null;
82 }
83 ResourceBundle ov = overrideBundle;
84 if (ov != null) {
85 try {
86 return ov.getString(key);
87 } catch (MissingResourceException ignored) {
88 }
89 }
90 ResourceBundle b = bundle;
91 try {
92 return b.getString(key);
93 } catch (MissingResourceException ignored) {
94 }
95 try {
96 return defaultBundle.getString(key);
97 } catch (MissingResourceException ignored) {
98 }
99 return key;
100 }
101
102 /** Translate with MessageFormat substitution. */
103 public static String tr(String key, Object... args) {

Callers 15

runMethod · 0.95
decryptELCMethod · 0.95
decryptDLCMethod · 0.95
MainPanelViewMethod · 0.95
attachTreeContextMenuMethod · 0.95
MainPanelMethod · 0.95
_check_old_versionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected