From a0ee11a9e71df37cf443894e371b46e2929b1879 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Thu, 15 Apr 2010 13:38:35 +0000 Subject: [PATCH] BF [2856097] - The "Enter new Location/Address" countries are not translate https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2856097&group_id=176962 --- .../src/org/compiere/grid/ed/VLocationDialog.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/org/compiere/grid/ed/VLocationDialog.java b/client/src/org/compiere/grid/ed/VLocationDialog.java index 60f3a78e81..4b7af60ed7 100644 --- a/client/src/org/compiere/grid/ed/VLocationDialog.java +++ b/client/src/org/compiere/grid/ed/VLocationDialog.java @@ -17,6 +17,7 @@ package org.compiere.grid.ed; import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -32,7 +33,9 @@ import java.util.logging.Level; import javax.swing.Box; import javax.swing.JComponent; import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.JOptionPane; +import javax.swing.ListCellRenderer; import javax.swing.SwingConstants; import org.compiere.apps.ADialog; @@ -80,6 +83,8 @@ public class VLocationDialog extends CDialog private int m_WindowNo = 0; + private JLabel m_label = new JLabel(); + /** * Constructor * @@ -115,6 +120,16 @@ public class VLocationDialog extends CDialog // Current Country MCountry.setDisplayLanguage(Env.getAD_Language(Env.getCtx())); fCountry = new CComboBox(MCountry.getCountries(Env.getCtx())); + ListCellRenderer renderer = new ListCellRenderer() + { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) + { + String text = ((MCountry)value).get_Translation(MCountry.COLUMNNAME_Name, Env.getAD_Language(Env.getCtx())); + m_label.setText(text); + return m_label; + } + }; + fCountry.setRenderer(renderer); fCountry.setSelectedItem(m_location.getCountry()); m_origCountry_ID = m_location.getC_Country_ID(); // Current Region