IDEMPIERE-2452 Country list doesn't support multiple translations

This commit is contained in:
Carlos Ruiz 2015-02-18 10:09:58 -05:00
parent c0dad6aa82
commit ee48288fda
1 changed files with 4 additions and 34 deletions

View File

@ -47,7 +47,7 @@ public class MCountry extends X_C_Country
/** /**
* *
*/ */
private static final long serialVersionUID = -4015127112992493778L; private static final long serialVersionUID = -4966707939803861163L;
/** /**
* Get Country (cached) * Get Country (cached)
@ -163,17 +163,6 @@ public class MCountry extends X_C_Country
+ " - Default=" + s_default); + " - Default=" + s_default);
} }
/**
* Return Language
* @return Name
*/
private String getEnvLanguage() {
String lang = Env.getAD_Language(Env.getCtx());
if (Language.isBaseLanguage(lang))
return null;
return lang;
}
/** /**
* Set the Language for Display (toString) * Set the Language for Display (toString)
* @param AD_Language language or null * @param AD_Language language or null
@ -232,22 +221,13 @@ public class MCountry extends X_C_Country
super(ctx, rs, trxName); super(ctx, rs, trxName);
} // MCountry } // MCountry
/** Translated Name */
private String m_trlName = null;
/** /**
* Return Name - translated if DisplayLanguage is set. * Return Name - translated if DisplayLanguage is set.
* @return Name * @return Name
*/ */
public String toString() public String toString()
{ {
if (getEnvLanguage() != null) return getTrlName();
{
String nn = getTrlName();
if (nn != null)
return nn;
}
return getName();
} // toString } // toString
/** /**
@ -256,13 +236,7 @@ public class MCountry extends X_C_Country
*/ */
public String getTrlName() public String getTrlName()
{ {
if (m_trlName == null && getEnvLanguage() != null) return getTrlName(Env.getAD_Language(Env.getCtx()));
{
m_trlName = get_Translation(COLUMNNAME_Name, getEnvLanguage());
if (m_trlName == null)
m_trlName = getName();
}
return m_trlName;
} // getTrlName } // getTrlName
/** /**
@ -272,11 +246,7 @@ public class MCountry extends X_C_Country
*/ */
public String getTrlName(String language) public String getTrlName(String language)
{ {
if ( language != null) return get_Translation(COLUMNNAME_Name, language);
{
m_trlName = get_Translation(COLUMNNAME_Name, language);
}
return m_trlName;
} // getTrlName } // getTrlName