KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > LocaleBean


1 /*
2  * LocaleBean.java
3  */

4 package org.contineo.core;
5
6 /**
7  * A central bean for handling all localisation information like data format.
8  * @author Sebastian Stein
9  */

10 public class LocaleBean {
11
12     /**
13      * Returns the standard date format for the specified language
14      */

15     public String JavaDoc getDateFormat(String JavaDoc language) {
16         String JavaDoc dateFormat;
17         if (language.equalsIgnoreCase("de"))
18             dateFormat = "dd.MM.yyyy";
19         else if (language.equalsIgnoreCase("fr"))
20             dateFormat = "dd/MM/yyyy";
21         else if (language.equalsIgnoreCase("es"))
22             dateFormat = "dd-MM-yyyy";
23         else if (language.equalsIgnoreCase("it"))
24             dateFormat = "dd-MM-yyyy";
25         else
26             dateFormat = "yyyy/MM/dd";
27
28         return dateFormat;
29     }
30 }
Popular Tags