common/src/main/java/com/kakoo/foundation/common/resource/bundle/ResourceBundleManager.java
/**
     * Registers a resource bundle file for the given locale.
     * <p>
     * If the resource bundle in the given locale cannot be found, the resource bundle in the default locale is
     * registered.
     *
     * @param baseBundleName Base bundle file name.
     * @param locale Locale.
     */
Registers a resource bundle file for the given locale.

If the resource bundle in the given locale cannot be found, the resource bundle in the default locale is
registered.

@param baseBundleName Base bundle file name.
@param locale Locale.
Registers a resource bundle file for the given locale . If the resource bundle in the given locale cannot be found the resource bundle in the default locale is registered . @param baseBundleName Base bundle file name . @param locale Locale .
@Synchronized
    public static final void register(final @NonNull String baseBundleName, final @NonNull Locale locale)
    {
        initialize();
        ResourceBundle bundle;
        List<ResourceBundle> resources;
        if (!exist(baseBundleName, locale))
        {
            resources = BUNDLES.get(locale);
            if (resources == null)
            {
                resources = new ArrayList<>();
            }
            bundle = ResourceBundle.getBundle(baseBundleName, locale);
            if (bundle != null)
            {
                resources.add(ResourceBundle.getBundle(baseBundleName, locale));
                BUNDLES.put(locale, resources);
                log.info(String.format("Registered resource bundle file: '%s', locale: '%s'", baseBundleName, locale));
            }
            else
            {
                log.warn(String.format("Can't find resource bundle file: '%s', locale: '%s'", baseBundleName, locale));
            }
        }
        else
        {
            log.info(String.format("Already registered resource bundle file: '%s', locale: '%s'", baseBundleName, locale));
        }
            bundle = ResourceBundle.getBundle(baseBundleName);
            resources.add(bundle);
            BUNDLES.put(Locale.getDefault(), resources);
            log.info(String.format("Registered resource bundle file: '%s', for default locale: '%s'", baseBundleName, Locale.getDefault()));
        }
    }
@ Synchronized public static final void register ( final @ NonNull String baseBundleName , final @ NonNull Locale locale ) { initialize ( ) ; ResourceBundle bundle ; List < ResourceBundle > resources ; if ( ! exist ( baseBundleName , locale ) ) { resources = BUNDLES . get ( locale ) ; if ( resources == null ) { resources = new ArrayList < > ( ) ; } bundle = ResourceBundle . getBundle ( baseBundleName , locale ) ; if ( bundle != null ) { resources . add ( ResourceBundle . getBundle ( baseBundleName , locale ) ) ; BUNDLES . put ( locale , resources ) ; log . info ( String . format ( "Registered resource bundle file: '%s', locale: '%s'" , baseBundleName , locale ) ) ; } else { log . warn ( String . format ( "Can't find resource bundle file: '%s', locale: '%s'" , baseBundleName , locale ) ) ; } } else { log . info ( String . format ( "Already registered resource bundle file: '%s', locale: '%s'" , baseBundleName , locale ) ) ; } }
Registers a resource bundle file for the given locale.
Registers a resource bundle file for the given locale .
// Register the bundle using the given locale if not the same as the current one. //        // Also register the bundle using the default locale. //        if (!exist(baseBundleName, Locale.getDefault())) //        { //            resources = BUNDLES.get(Locale.getDefault()); //            if (resources == null) //            { //                resources = new ArrayList<>(); //            } // //            bundle = ResourceBundle.getBundle(baseBundleName); //            resources.add(bundle); //            BUNDLES.put(Locale.getDefault(), resources); //            log.info(String.format("Registered resource bundle file: '%s', for default locale: '%s'", baseBundleName, Locale.getDefault())); //        }