/*
 * Copyright (c) 2004-2017, by Alex Leigh.
 * All rights reserved.
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 */

package lc.mecha.util;

import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;

public class ResourceBundleUtil {
    public static void getBundles(final List<ResourceBundle> output, final String bundleBase, final List<Locale> locales) {
        for (final Locale locale : locales) {
            final ResourceBundle bundle = ResourceBundle.getBundle(bundleBase, locale);
            if (bundle == null) throw new IllegalStateException("Could not locate bundle for " + locale);
            output.add(bundle);
        }

    }
}
