1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.language;
21  
22  import java.util.Locale;
23  
24  import javax.servlet.jsp.PageContext;
25  
26  /**
27   * <a href="UnicodeLanguageUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   *
31   */
32  public class UnicodeLanguageUtil {
33  
34      public static String format(
35          Locale locale, String pattern, Object argument) {
36  
37          return getUnicodeLanguage().format(locale, pattern, argument);
38      }
39  
40      public static String format(
41          Locale locale, String pattern, Object[] arguments) {
42  
43          return getUnicodeLanguage().format(locale, pattern, arguments);
44      }
45  
46      public static String format(
47          long companyId, Locale locale, String pattern, Object argument) {
48  
49          return getUnicodeLanguage().format(
50              companyId, locale, pattern, argument);
51      }
52  
53      public static String format(
54          long companyId, Locale locale, String pattern, Object[] arguments) {
55  
56          return getUnicodeLanguage().format(
57              companyId, locale, pattern, arguments);
58      }
59  
60      public static String format(
61          PageContext pageContext, String pattern, Object argument) {
62  
63          return getUnicodeLanguage().format(pageContext, pattern, argument);
64      }
65  
66      public static String format(
67          PageContext pageContext, String pattern, Object argument,
68          boolean translateArguments) {
69  
70          return getUnicodeLanguage().format(
71              pageContext, pattern, argument, translateArguments);
72      }
73  
74      public static String format(
75          PageContext pageContext, String pattern, Object[] arguments) {
76  
77          return getUnicodeLanguage().format(pageContext, pattern, arguments);
78      }
79  
80      public static String format(
81          PageContext pageContext, String pattern, Object[] arguments,
82          boolean translateArguments) {
83  
84          return getUnicodeLanguage().format(
85              pageContext, pattern, arguments, translateArguments);
86      }
87  
88      public static String format(
89          PageContext pageContext, String pattern, LanguageWrapper argument) {
90  
91          return getUnicodeLanguage().format(pageContext, pattern, argument);
92      }
93  
94      public static String format(
95          PageContext pageContext, String pattern, LanguageWrapper argument,
96          boolean translateArguments) {
97  
98          return getUnicodeLanguage().format(
99              pageContext, pattern, argument, translateArguments);
100     }
101 
102     public static String format(
103         PageContext pageContext, String pattern, LanguageWrapper[] arguments) {
104 
105         return getUnicodeLanguage().format(pageContext, pattern, arguments);
106     }
107 
108     public static String format(
109         PageContext pageContext, String pattern, LanguageWrapper[] arguments,
110         boolean translateArguments) {
111 
112         return getUnicodeLanguage().format(
113             pageContext, pattern, arguments, translateArguments);
114     }
115 
116     public static String get(Locale locale, String key) {
117         return getUnicodeLanguage().get(locale, key);
118     }
119 
120     public static String get(long companyId, Locale locale, String key) {
121         return getUnicodeLanguage().get(companyId, locale, key);
122     }
123 
124     public static String get(
125         long companyId, Locale locale, String key, String defaultValue) {
126 
127         return getUnicodeLanguage().get(companyId, locale, key, defaultValue);
128     }
129 
130     public static String get(PageContext pageContext, String key) {
131         return getUnicodeLanguage().get(pageContext, key);
132     }
133 
134     public static String get(
135         PageContext pageContext, String key, String defaultValue) {
136 
137         return getUnicodeLanguage().get(pageContext, key, defaultValue);
138     }
139 
140     public static String getTimeDescription(
141         PageContext pageContext, Long milliseconds) {
142 
143         return getUnicodeLanguage().getTimeDescription(
144             pageContext, milliseconds);
145     }
146 
147     public static String getTimeDescription(
148         PageContext pageContext, long milliseconds) {
149 
150         return getUnicodeLanguage().getTimeDescription(
151             pageContext, milliseconds);
152     }
153 
154     public static UnicodeLanguage getUnicodeLanguage() {
155         return _unicodeLanguage;
156     }
157 
158     public void setUnicodeLanguage(UnicodeLanguage unicodeLanguage) {
159         _unicodeLanguage = unicodeLanguage;
160     }
161 
162     private static UnicodeLanguage _unicodeLanguage;
163 
164 }