001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.l10n;
028:
029: import com.sun.midp.i18n.ResourceBundle;
030: import com.sun.midp.i18n.ResourceConstants;
031:
032: /**
033: * The English-US localization of ResourceBundle (the default, in
034: * the absence of any locale info specified).
035: * This also acts like a template for future localization experts
036: * to work on, when creating locale specific strings. Look for
037: * the message "L10N: REPLACE WITH LOCALE SPECIFIC VALUES" and
038: * replace with locale specific values.
039: *
040: * LocalizedStringsBase.java is generated from
041: * src/configuration/configurator/share/l10n/en-US.xml
042: */
043: public class LocalizedStrings extends LocalizedStringsBase implements
044: ResourceBundle {
045: /**
046: * Fetch the entire resource content.
047: *
048: * @return 2 dimension array of keys and US English strings.
049: */
050: public String getString(int index) {
051: return getContent(index);
052: }
053:
054: /**
055: * Overrides ResourceBundle.getLocalizedDateString.
056: * Returns a string representing the date in locale specific
057: * date format.
058: * @param dayOfWeek a String representing the day of the week.
059: * @param date a String representing the date.
060: * @param month a String representing the month.
061: * @param year a String representing the year.
062: * @return a formatted date string that is suited for the target
063: * language.
064: * In English, this will return:
065: * "Dec 05, 2003"
066: * (L10N: REPLACE WITH LOCALE SPECIFIC VALUE)
067: */
068: public String getLocalizedDateString(String dayOfWeek, String date,
069: String month, String year) {
070: return month + " " + date + ", " + year;
071: }
072:
073: /**
074: * Overrides ResourceBundle.getLocalizedTimeString.
075: * Returns a string representing the time in locale specific
076: * time format.
077: * @param hour a String representing the hour.
078: * @param min a String representing the minute.
079: * @param sec a String representing the second.
080: * @param ampm a String representing am or pm.
081: * Note that ampm can be null.
082: * @return a formatted time string that is suited for the target
083: * language.
084: * In English, this will return;
085: * "10:05:59 PM"
086: * (L10N: REPLACE WITH LOCALE SPECIFIC VALUE)
087: *
088: */
089: public String getLocalizedTimeString(String hour, String min,
090: String sec, String ampm) {
091: return (hour + ":" + min + ((ampm == null) ? "" : (" " + ampm)));
092: }
093:
094: /**
095: * Overrides ResourceBundle.getLocalizedDateTimeString.
096: * Returns the localized date time string value.
097: * @param dayOfWeek a String representing the day of the week.
098: * @param date a String representing the date.
099: * @param month a String representing the month.
100: * @param year a String representing the year.
101: * @param hour a String representing the hour.
102: * @param min a String representing the minute.
103: * @param sec a String representing the second.
104: * @param ampm a String representing am or pm.
105: * Note that ampm can be null.
106: * @return a formatted date and time string that is suited for the.
107: * target language.
108: * In English, this will return:
109: * "Fri, 05 Dec 2000 10:05:59 PM"
110: * (L10N: REPLACE WITH LOCALE SPECIFIC VALUE)
111: */
112: public String getLocalizedDateTimeString(String dayOfWeek,
113: String date, String month, String year, String hour,
114: String min, String sec, String ampm) {
115: return getLocalizedDateString(dayOfWeek, date, month, year)
116: + " " + getLocalizedTimeString(hour, min, sec, ampm);
117: }
118:
119: /**
120: * Returns the locale specific first day of the week.
121: * @return the first day of the week is; e.g., Sunday in US.
122: * (L10N: REPLACE WITH LOCALE SPECIFIC VALUE)
123: */
124: public int getLocalizedFirstDayOfWeek() {
125: return java.util.Calendar.SUNDAY;
126: }
127:
128: /**
129: * Returns whether AM_PM field comes after the time field or
130: * not in this locale.
131: * @return true for US.
132: * (L10N: REPLACE WITH LOCALE SPECIFIC VALUE)
133: */
134: public boolean isLocalizedAMPMafterTime() {
135: return true;
136: }
137: }
|