@@ -395,6 +395,7 @@ private List<String> postProcess(@NotNull List<String> text) {
395395 public List <String > forLocale (@ NotNull String locale ) {
396396 JsonConfiguration index = mapping .get (locale );
397397 if (index == null ) {
398+ Util .debugLog ("Fallback " + locale + " to default game-language locale caused by QuickShop doesn't support this locale" );
398399 if (MsgUtil .processGameLanguageCode (plugin .getConfiguration ().getOrDefault ("game-language" , "default" )).equals (locale )) {
399400 List <String > str = fallbackLocal ();
400401 if (str .isEmpty ()) {
@@ -407,12 +408,15 @@ public List<String> forLocale(@NotNull String locale) {
407408 } else {
408409 List <String > str = index .getStringList (path );
409410 if (str .isEmpty ()) {
410- return Collections .singletonList ("Missing Language Key: " + path );
411- } else {
412- return postProcess (str );
411+ // Fallback
412+ Util .debugLog ("Fallback " + path + " to bundle translation caused OTA & User's override file doesn't contains this key" );
413+ str = fallbackLocal ();
414+ if (str .isEmpty ()) {
415+ return Collections .singletonList ("Fallback Missing Language Key: " + path + ", report to QuickShop!" );
416+ }
413417 }
418+ return postProcess (str );
414419 }
415-
416420 }
417421
418422 /**
@@ -512,6 +516,7 @@ private String postProcess(@NotNull String text) {
512516 public String forLocale (@ NotNull String locale ) {
513517 JsonConfiguration index = mapping .get (locale );
514518 if (index == null ) {
519+ Util .debugLog ("Fallback " + locale + " to default game-language locale caused by QuickShop doesn't support this locale" );
515520 if (MsgUtil .processGameLanguageCode (plugin .getConfiguration ().getOrDefault ("game-language" , "default" )).equals (locale )) {
516521 String str = fallbackLocal ();
517522 if (str == null ) {
@@ -524,7 +529,12 @@ public String forLocale(@NotNull String locale) {
524529 } else {
525530 String str = index .getString (path );
526531 if (str == null ) {
527- return "Missing Language Key: " + path ;
532+ // Fallback
533+ Util .debugLog ("Fallback " + path + " to bundle translation caused OTA & User's override file doesn't contains this key" );
534+ str = fallbackLocal ();
535+ if (str == null ) {
536+ return "Fallback Missing Language Key: " + path + ", report to QuickShop!" ;
537+ }
528538 }
529539 return postProcess (str );
530540 }
0 commit comments