01: package org.rapla.framework;
02:
03: import java.util.Calendar;
04: import java.util.Date;
05: import java.util.Locale;
06: import java.util.TimeZone;
07:
08: /** This class contains all locale specific information for Rapla. Like
09: <ul>
10: <li>Selected language.</li>
11: <li>Selected country.</li>
12: <li>Available languages (if the user has the possibility to choose a language)</li>
13: <li>TimeZone for appointments (This is always GMT+0)</li>
14: </ul>
15: <p>
16: Also it provides basic formating information for the dates.
17: </p>
18: <p>
19: Configuration is done in the rapla.xconf:
20: <pre>
21: <locale>
22: <languages default="de">
23: <language>de</language>
24: <language>en</language>
25: </languages>
26: <country>US</country>
27: </locale>
28: </pre>
29: If languages default is not set, the system default wil be used.<br>
30: If country code is not set, the system default will be used.<br>
31: </p>
32: */
33:
34: public interface RaplaLocale {
35: String ROLE = RaplaLocale.class.getName();
36: String LANGUAGE_ENTRY = "org.rapla.language";
37:
38: String[] getAvailableLanguages();
39:
40: /** creates a calendar initialized with the Rapla timezone ( that is always GMT+0 for Rapla ) and the selected locale*/
41: Calendar createCalendar();
42:
43: String formatTime(Date date);
44:
45: /** sets time to 0:00:00 or 24:00:00 */
46: Date toDate(Date date, boolean fillDate);
47:
48: /** sets time to 0:00:00 */
49: Date toDate(int year, int month, int date);
50:
51: /** sets date to 0:00:00 */
52: Date toTime(int hour, int minute, int second);
53:
54: /** Uses the first date parameter for year, month, date information and
55: the second for hour, minutes, second, millisecond information.*/
56: Date toDate(Date date, Date time);
57:
58: /** format long with the local NumberFormat */
59: String formatNumber(long number);
60:
61: /** format without year */
62: String formatDateShort(Date date);
63:
64: /** format with locale DateFormat.SHORT */
65: String formatDate(Date date);
66:
67: /** format with locale DateFormat.MEDIUM */
68: String formatDateLong(Date date);
69:
70: /** Abbreviation of locale weekday name of date. */
71: String getWeekday(Date date);
72:
73: /** Monthname of date. */
74: String getMonth(Date date);
75:
76: String getCharsetNonUtf();
77:
78: TimeZone getTimeZone();
79:
80: Locale getLocale();
81:
82: }
|