File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
HMCL/src/main/java/org/jackhuang/hmcl/util/i18n Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2121import org .jackhuang .hmcl .download .game .GameRemoteVersion ;
2222import org .jackhuang .hmcl .util .i18n .translator .Translator ;
2323import org .jetbrains .annotations .Nullable ;
24+ import org .jetbrains .annotations .PropertyKey ;
2425
2526import java .io .IOException ;
2627import java .io .InputStream ;
@@ -59,11 +60,11 @@ public static Translator getTranslator() {
5960 return locale .getTranslator ();
6061 }
6162
62- public static String i18n (String key , Object ... formatArgs ) {
63+ public static String i18n (@ PropertyKey ( resourceBundle = "assets.lang.I18N" ) String key , Object ... formatArgs ) {
6364 return locale .i18n (key , formatArgs );
6465 }
6566
66- public static String i18n (String key ) {
67+ public static String i18n (@ PropertyKey ( resourceBundle = "assets.lang.I18N" ) String key ) {
6768 return locale .i18n (key );
6869 }
6970
Original file line number Diff line number Diff line change 2424import org .jackhuang .hmcl .util .StringUtils ;
2525import org .jackhuang .hmcl .util .gson .JsonUtils ;
2626import org .jackhuang .hmcl .util .i18n .translator .Translator ;
27+ import org .jetbrains .annotations .PropertyKey ;
2728
2829import java .io .IOException ;
2930import java .io .InputStream ;
@@ -187,7 +188,7 @@ public List<Locale> getCandidateLocales() {
187188 return candidateLocales ;
188189 }
189190
190- public String i18n (String key , Object ... formatArgs ) {
191+ public String i18n (@ PropertyKey ( resourceBundle = "assets.lang.I18N" ) String key , Object ... formatArgs ) {
191192 try {
192193 return String .format (getResourceBundle ().getString (key ), formatArgs );
193194 } catch (MissingResourceException e ) {
@@ -199,7 +200,7 @@ public String i18n(String key, Object... formatArgs) {
199200 return key + Arrays .toString (formatArgs );
200201 }
201202
202- public String i18n (String key ) {
203+ public String i18n (@ PropertyKey ( resourceBundle = "assets.lang.I18N" ) String key ) {
203204 try {
204205 return getResourceBundle ().getString (key );
205206 } catch (MissingResourceException e ) {
You can’t perform that action at this time.
0 commit comments