[Minor] ignore empty bundleNames

This commit is contained in:
Robert von Burg 2020-08-07 15:00:27 +02:00
parent 24c305564b
commit 5d7aa1945c
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package li.strolch.utils;
import static li.strolch.utils.helper.StringHelper.EMPTY;
import static li.strolch.utils.helper.StringHelper.isEmpty;
import java.io.File;
import java.io.FileInputStream;
@ -102,8 +103,9 @@ public class I18nMessage {
public String getMessage(Locale locale) {
ResourceBundle bundle = getBundle(locale);
if (bundle == null) {
if (isEmpty(this.bundleName))
return getMessage();
logger.warn("No bundle found for " + this.bundleName + " " + locale);
logger.info("Available: ");
getBundleMap().forEach((s, map) -> {
logger.info(" " + s);
map.forEach((l, resourceBundle) -> logger.info(" " + l + ": " + map.keySet()));