@@ -0,0 +1,1101 @@
+package com.github.aureliano.achmed;%0A%0Aimport java.util.Locale;%0A%0Aimport org.apache.log4j.Logger;%0A%0Aimport com.github.aureliano.achmed.idiom.LanguageCode;%0Aimport com.github.aureliano.achmed.idiom.LanguageSingleton;%0A%0Apublic final class AppConfiguration %7B%0A%0A%09private static final Logger logger = Logger.getLogger(AppConfiguration.class);%0A%09%0A%09private LanguageCode language;%0A%09%0A%09public AppConfiguration() %7B%0A%09%09this.applyConfiguration();%0A%09%7D%0A%09%0A%09public void applyConfiguration() %7B%0A%09%09logger.info(%22Apply core configuration.%22);%0A%09%09this.configureLocale();%0A%09%09LanguageSingleton.instance().setDefaultLanguageCode(this.language);%0A%09%7D%0A%09%0A%09public LanguageCode getLanguage() %7B%0A%09%09return language;%0A%09%7D%0A%09%0A%09private void configureLocale() %7B%0A%09%09logger.info(%22Configuring default locale.%22);%0A%09%09%0A%09%09Locale locale = Locale.getDefault();%0A%09%09String code = locale.getLanguage() + %22_%22 + locale.getCountry();%0A%09%09%0A%09%09logger.info(String.format(%0A%09%09%09%09%22Using default locale to %25s with language %25s (%25s).%22,%0A%09%09%09%09locale.getDisplayCountry(),%0A%09%09%09%09locale.getDisplayLanguage(),%0A%09%09%09%09code%0A%09%09%09)%0A%09%09);%0A%09%09%0A%09%09this.language = LanguageCode.valueOf(code.toUpperCase());%0A%09%7D%0A%7D

Create app configuration singleton.