1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.kernel.language;
16  
17  import java.util.Locale;
18  
19  import javax.portlet.PortletRequest;
20  
21  import javax.servlet.http.HttpServletRequest;
22  import javax.servlet.http.HttpServletResponse;
23  import javax.servlet.jsp.PageContext;
24  
25  /**
26   * <a href="Language.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   */
30  public interface Language {
31  
32      public String format(Locale locale, String pattern, Object argument);
33  
34      public String format(
35          Locale locale, String pattern, Object argument,
36          boolean translateArguments);
37  
38      public String format(Locale locale, String pattern, Object[] arguments);
39  
40      public String format(
41          Locale locale, String pattern, Object[] arguments,
42          boolean translateArguments);
43  
44      public String format(
45          PageContext pageContext, String pattern, LanguageWrapper argument);
46  
47      public String format(
48          PageContext pageContext, String pattern, LanguageWrapper argument,
49          boolean translateArguments);
50  
51      public String format(
52          PageContext pageContext, String pattern, LanguageWrapper[] arguments);
53  
54      public String format(
55          PageContext pageContext, String pattern, LanguageWrapper[] arguments,
56          boolean translateArguments);
57  
58      public String format(
59          PageContext pageContext, String pattern, Object argument);
60  
61      public String format(
62          PageContext pageContext, String pattern, Object argument,
63          boolean translateArguments);
64  
65      public String format(
66          PageContext pageContext, String pattern, Object[] arguments);
67  
68      public String format(
69          PageContext pageContext, String pattern, Object[] arguments,
70          boolean translateArguments);
71  
72      public String get(Locale locale, String key);
73  
74      public String get(Locale locale, String key, String defaultValue);
75  
76      public String get(PageContext pageContext, String key);
77  
78      public String get(PageContext pageContext, String key, String defaultValue);
79  
80      public Locale[] getAvailableLocales();
81  
82      public String getCharset(Locale locale);
83  
84      public String getLanguageId(HttpServletRequest request);
85  
86      public String getLanguageId(Locale locale);
87  
88      public String getLanguageId(PortletRequest portletRequest);
89  
90      public Locale getLocale(String languageCode);
91  
92      public String getTimeDescription(
93          PageContext pageContext, long milliseconds);
94  
95      public String getTimeDescription(
96          PageContext pageContext, Long milliseconds);
97  
98      public void init();
99  
100     public boolean isAvailableLocale(Locale locale);
101 
102     public boolean isDuplicateLanguageCode(String languageCode);
103 
104     public void resetAvailableLocales(long companyId);
105 
106     public void updateCookie(
107         HttpServletRequest request, HttpServletResponse response,
108         Locale locale);
109 
110 }