return new MessageBundle(all, country, lang, exact);
}
private MessageBundle getBundleFor(GadgetSpec spec, Locale locale, boolean ignoreCache)
throws GadgetException {
LocaleSpec localeSpec = spec.getModulePrefs().getLocale(locale);
if (localeSpec == null) {
return MessageBundle.EMPTY;
}
if (localeSpec.getMessages().toString().length() == 0) {
return localeSpec.getMessageBundle();
}
LocaleQuery query = new LocaleQuery();
query.setSpecUri(localeSpec.getMessages())
.setGadgetUri(spec.getUrl())
// TODO: Get the real container that was used during the request here.
.setContainer(ContainerConfig.DEFAULT_CONTAINER)
.setIgnoreCache(ignoreCache);
query.locale = localeSpec;