1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 }