001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.kernel.language;
022:
023: import java.util.Locale;
024:
025: import javax.portlet.ActionRequest;
026: import javax.portlet.RenderRequest;
027:
028: import javax.servlet.http.HttpServletRequest;
029: import javax.servlet.http.HttpServletResponse;
030: import javax.servlet.jsp.PageContext;
031:
032: /**
033: * <a href="Language.java.html"><b><i>View Source</i></b></a>
034: *
035: * @author Brian Wing Shun Chan
036: *
037: */
038: public interface Language {
039:
040: public String format(Locale locale, String pattern, Object argument);
041:
042: public String format(Locale locale, String pattern,
043: Object[] arguments);
044:
045: public String format(long companyId, Locale locale, String pattern,
046: Object argument);
047:
048: public String format(long companyId, Locale locale, String pattern,
049: Object[] arguments);
050:
051: public String format(PageContext pageContext, String pattern,
052: Object argument);
053:
054: public String format(PageContext pageContext, String pattern,
055: Object argument, boolean translateArguments);
056:
057: public String format(PageContext pageContext, String pattern,
058: Object[] arguments);
059:
060: public String format(PageContext pageContext, String pattern,
061: Object[] arguments, boolean translateArguments);
062:
063: public String format(PageContext pageContext, String pattern,
064: LanguageWrapper argument);
065:
066: public String format(PageContext pageContext, String pattern,
067: LanguageWrapper argument, boolean translateArguments);
068:
069: public String format(PageContext pageContext, String pattern,
070: LanguageWrapper[] arguments);
071:
072: public String format(PageContext pageContext, String pattern,
073: LanguageWrapper[] arguments, boolean translateArguments);
074:
075: public String get(Locale locale, String key);
076:
077: public String get(long companyId, Locale locale, String key);
078:
079: public String get(long companyId, Locale locale, String key,
080: String defaultValue);
081:
082: public String get(PageContext pageContext, String key);
083:
084: public String get(PageContext pageContext, String key,
085: String defaultValue);
086:
087: public Locale[] getAvailableLocales();
088:
089: public String getCharset(Locale locale);
090:
091: public String getLanguageId(ActionRequest req);
092:
093: public String getLanguageId(RenderRequest req);
094:
095: public String getLanguageId(HttpServletRequest req);
096:
097: public String getLanguageId(Locale locale);
098:
099: public Locale getLocale(String languageCode);
100:
101: public String getTimeDescription(PageContext pageContext,
102: Long milliseconds);
103:
104: public String getTimeDescription(PageContext pageContext,
105: long milliseconds);
106:
107: public void updateCookie(HttpServletResponse res, Locale locale);
108:
109: }
|