nosi.core.i18n.I18nFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of igrp-core Show documentation
Show all versions of igrp-core Show documentation
IGRP Framework is a powerful and highly customizable platform developed by the Operational Nucleus for the Information Society (NOSi) to create web applications, it provides out of box, several modules to make easy to create stand-alone, production-grade web applications: authentication and access-control, business processes automation, reporting, page builder with automatic code generation and incorporation of the Once-Only-Principle, written in Java. IGRP Framework WAR - Contains some keys resources that give UI to IGRP Framework and others supports files.
package nosi.core.i18n;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* Marcel Iekiny
* Oct 27, 2017
*/
public final class I18nFactory {
private I18nFactory() {}
public static I18n createI18n(String name, Locale locale) {
I18n i18n = null;
try {
i18n = new I18n(ResourceBundle.getBundle(name, locale));
}catch(Exception e) {
try {
i18n = new I18n(ResourceBundle.getBundle(I18nManager.DEFAULT_CORE_BUNDLE_NAME, locale));
} catch (Exception e2) {
// e.printStackTrace();
}
}
return i18n;
}
}