IDEMPIERE-489 Make use of AD_Language configuration

This commit is contained in:
Elaine Tan 2013-03-20 20:25:06 +08:00
parent ee485727f7
commit 30af38e5b1
1 changed files with 25 additions and 18 deletions

View File

@ -148,25 +148,32 @@ public class Language implements Serializable
Locale locale = new Locale(language, country); Locale locale = new Locale(language, country);
if (DB.isConnected()) { if (DB.isConnected()) {
MLanguage dblang = MLanguage.get(Env.getCtx(), langInfo); MLanguage dblang = MLanguage.get(Env.getCtx(), langInfo);
Boolean decimalPoint = null; if (dblang == null)
if (dblang.getIsDecimalPoint() != null) {
decimalPoint = "Y".equals(dblang.getIsDecimalPoint()); ll = new Language (lang, lang, locale);
if (!( language.equals(dblang.getLanguageISO())
&& country.equals(dblang.getCountryCode())
)
) {
locale = new Locale(dblang.getLanguageISO(), dblang.getCountryCode());
} }
MediaSize mediaSize = MediaSize.ISO.A4; else
if (dblang.getAD_PrintPaper_ID() > 0) { {
MPrintPaper pp = MPrintPaper.get(dblang.getAD_PrintPaper_ID()); Boolean decimalPoint = null;
mediaSize = pp.getMediaSize(); if (dblang.getIsDecimalPoint() != null)
} decimalPoint = "Y".equals(dblang.getIsDecimalPoint());
ll = new Language(dblang.getPrintName(), langInfo, locale, decimalPoint, dblang.getDatePattern(), mediaSize); if (!( language.equals(dblang.getLanguageISO())
ll.m_fromDB = true; && country.equals(dblang.getCountryCode())
if (dblang.isBaseLanguage()) { )
idxReplace = 0; ) {
s_baseLanguage = ll; locale = new Locale(dblang.getLanguageISO(), dblang.getCountryCode());
}
MediaSize mediaSize = MediaSize.ISO.A4;
if (dblang.getAD_PrintPaper_ID() > 0) {
MPrintPaper pp = MPrintPaper.get(dblang.getAD_PrintPaper_ID());
mediaSize = pp.getMediaSize();
}
ll = new Language(dblang.getPrintName(), langInfo, locale, decimalPoint, dblang.getDatePattern(), mediaSize);
ll.m_fromDB = true;
if (dblang.isBaseLanguage()) {
idxReplace = 0;
s_baseLanguage = ll;
}
} }
} else { } else {
ll = new Language (lang, lang, locale); ll = new Language (lang, lang, locale);