Skip to main content

JXDatePicker[Popup] needs i10n

2 replies [Last post]
elkner
Offline
Joined: 2003-06-10
Points: 0

Is localization for the JXDate* already planned? If not, it should find its way into the roadmap ASAP.

Right now I can live with the default locale, but later ...

The really quick and dirty hack, I use right now for the JXDatePicker.JXDatePickerPopup is:

---schnipp---
--- swingx.orig/src/java/org/jdesktop/swingx/JXDatePicker.java Thu Jun 9 19:27:40 2005
+++ swingx/src/java/org/jdesktop/swingx/JXDatePicker.java Tue Jun 28 11:23:49 2005
@@ -535,7 +577,14 @@

private final class TodayAction extends AbstractAction {
TodayAction() {
- super("Today is " + new SimpleDateFormat("dd MMM yyyy").format(new Date()));
+ super();
+ // jel: don't like this hack - real locale support would be the
+ // better choice
+ String text = UIManager.getString("JXDatePicker.todayIs");
+ if (text == null) {
+ text = "Today is {0,date,long}";
+ }
+ putValue(Action.NAME, MessageFormat.format(text, new Date()));
}

public void actionPerformed(ActionEvent ae) {
--- swingx.orig/src/java/org/jdesktop/swingx/plaf/resources/swingx.properties Mon Jun 20 18:39:55 2005
+++ swingx/src/java/org/jdesktop/swingx/plaf/resources/swingx.properties Tue Jun 28 11:15:57 2005
@@ -4,3 +4,4 @@
JXTable.column.packAll=Pack All Columns
JXTable.column.packSelected=Pack Selected Column

+JXDatePicker.todayIs=Today is {0,date,long}
--- swingx.orig/src/java/org/jdesktop/swingx/plaf/resources/swingx_de.properties Mon Jun 20 18:39:55 2005
+++ swingx/src/java/org/jdesktop/swingx/plaf/resources/swingx_de.properties Tue Jun 28 11:18:34 2005
@@ -4,3 +4,4 @@
JXTable.column.packAll=Alle Spalten anpassen
JXTable.column.packSelected=Ausgewählte Spalte anpassen

+JXDatePicker.todayIs=Heute ist der {0,date,long}
---schnapp---

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dmouse
Offline
Joined: 2003-06-09
Points: 0

Yes JXDatePicker is definitely going to be i10n. In fact it should be right now, but it seems that some of the latest changes haven't filtered their way into the resource files as necessary. The best thing to do with any of these issues you find is to file a bug report. Thanks for pointing this out!

elkner
Offline
Joined: 2003-06-10
Points: 0

OK, thanx.