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.PortletConfig;
20  import javax.portlet.PortletRequest;
21  
22  import javax.servlet.http.HttpServletRequest;
23  import javax.servlet.http.HttpServletResponse;
24  import javax.servlet.jsp.PageContext;
25  
26  /**
27   * <a href="Language.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   */
31  public interface Language {
32  
33      public String format(Locale locale, String pattern, Object argument);
34  
35      public String format(
36          Locale locale, String pattern, Object argument,
37          boolean translateArguments);
38  
39      public String format(Locale locale, String pattern, Object[] arguments);
40  
41      public String format(
42          Locale locale, String pattern, Object[] arguments,
43          boolean translateArguments);
44  
45      public String format(
46          PageContext pageContext, String pattern, LanguageWrapper argument);
47  
48      public String format(
49          PageContext pageContext, String pattern, LanguageWrapper argument,
50          boolean translateArguments);
51  
52      public String format(
53          PageContext pageContext, String pattern, LanguageWrapper[] arguments);
54  
55      public String format(
56          PageContext pageContext, String pattern, LanguageWrapper[] arguments,
57          boolean translateArguments);
58  
59      public String format(
60          PageContext pageContext, String pattern, Object argument);
61  
62      public String format(
63          PageContext pageContext, String pattern, Object argument,
64          boolean translateArguments);
65  
66      public String format(
67          PageContext pageContext, String pattern, Object[] arguments);
68  
69      public String format(
70          PageContext pageContext, String pattern, Object[] arguments,
71          boolean translateArguments);
72  
73      public String format(
74          PortletConfig portletConfig, Locale locale, String pattern,
75          Object argument);
76  
77      public String format(
78          PortletConfig portletConfig, Locale locale, String pattern,
79          Object argument, boolean translateArguments);
80  
81      public String format(
82          PortletConfig portletConfig, Locale locale, String pattern,
83          Object[] arguments);
84  
85      public String format(
86          PortletConfig portletConfig, Locale locale, String pattern,
87          Object[] arguments, boolean translateArguments);
88  
89      public String get(Locale locale, String key);
90  
91      public String get(Locale locale, String key, String defaultValue);
92  
93      public String get(PageContext pageContext, String key);
94  
95      public String get(PageContext pageContext, String key, String defaultValue);
96  
97      public String get(PortletConfig portletConfig, Locale locale, String key);
98  
99      public String get(
100         PortletConfig portletConfig, Locale locale, String key,
101         String defaultValue);
102 
103     public Locale[] getAvailableLocales();
104 
105     public String getCharset(Locale locale);
106 
107     public String getLanguageId(HttpServletRequest request);
108 
109     public String getLanguageId(Locale locale);
110 
111     public String getLanguageId(PortletRequest portletRequest);
112 
113     public Locale getLocale(String languageCode);
114 
115     public String getTimeDescription(
116         PageContext pageContext, long milliseconds);
117 
118     public String getTimeDescription(
119         PageContext pageContext, Long milliseconds);
120 
121     public void init();
122 
123     public boolean isAvailableLocale(Locale locale);
124 
125     public boolean isDuplicateLanguageCode(String languageCode);
126 
127     public void resetAvailableLocales(long companyId);
128 
129     public void updateCookie(
130         HttpServletRequest request, HttpServletResponse response,
131         Locale locale);
132 
133 }