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.servlet.jsp.PageContext;
20  
21  /**
22   * <a href="UnicodeLanguageUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class UnicodeLanguageUtil {
27  
28      public static String format(
29          Locale locale, String pattern, Object argument) {
30  
31          return getUnicodeLanguage().format(locale, pattern, argument);
32      }
33  
34      public static String format(
35          Locale locale, String pattern, Object[] arguments) {
36  
37          return getUnicodeLanguage().format(locale, pattern, arguments);
38      }
39  
40      /**
41       * @deprecated
42       */
43      public static String format(
44          long companyId, Locale locale, String pattern, Object argument) {
45  
46          return getUnicodeLanguage().format(locale, pattern, argument);
47      }
48  
49      /**
50       * @deprecated
51       */
52      public static String format(
53          long companyId, Locale locale, String pattern, Object[] arguments) {
54  
55          return getUnicodeLanguage().format(locale, pattern, arguments);
56      }
57  
58      public static String format(
59          PageContext pageContext, String pattern, LanguageWrapper argument) {
60  
61          return getUnicodeLanguage().format(pageContext, pattern, argument);
62      }
63  
64      public static String format(
65          PageContext pageContext, String pattern, LanguageWrapper argument,
66          boolean translateArguments) {
67  
68          return getUnicodeLanguage().format(
69              pageContext, pattern, argument, translateArguments);
70      }
71  
72      public static String format(
73          PageContext pageContext, String pattern, LanguageWrapper[] arguments) {
74  
75          return getUnicodeLanguage().format(pageContext, pattern, arguments);
76      }
77  
78      public static String format(
79          PageContext pageContext, String pattern, LanguageWrapper[] arguments,
80          boolean translateArguments) {
81  
82          return getUnicodeLanguage().format(
83              pageContext, pattern, arguments, translateArguments);
84      }
85  
86      public static String format(
87          PageContext pageContext, String pattern, Object argument) {
88  
89          return getUnicodeLanguage().format(pageContext, pattern, argument);
90      }
91  
92      public static String format(
93          PageContext pageContext, String pattern, Object argument,
94          boolean translateArguments) {
95  
96          return getUnicodeLanguage().format(
97              pageContext, pattern, argument, translateArguments);
98      }
99  
100     public static String format(
101         PageContext pageContext, String pattern, Object[] arguments) {
102 
103         return getUnicodeLanguage().format(pageContext, pattern, arguments);
104     }
105 
106     public static String format(
107         PageContext pageContext, String pattern, Object[] arguments,
108         boolean translateArguments) {
109 
110         return getUnicodeLanguage().format(
111             pageContext, pattern, arguments, translateArguments);
112     }
113 
114     public static String get(Locale locale, String key) {
115         return getUnicodeLanguage().get(locale, key);
116     }
117 
118     public static String get(Locale locale, String key, String defaultValue) {
119         return getUnicodeLanguage().get(locale, key, defaultValue);
120     }
121 
122     /**
123      * @deprecated
124      */
125     public static String get(long companyId, Locale locale, String key) {
126         return getUnicodeLanguage().get(locale, key);
127     }
128 
129     /**
130      * @deprecated
131      */
132     public static String get(
133         long companyId, Locale locale, String key, String defaultValue) {
134 
135         return getUnicodeLanguage().get(locale, key, defaultValue);
136     }
137 
138     public static String get(PageContext pageContext, String key) {
139         return getUnicodeLanguage().get(pageContext, key);
140     }
141 
142     public static String get(
143         PageContext pageContext, String key, String defaultValue) {
144 
145         return getUnicodeLanguage().get(pageContext, key, defaultValue);
146     }
147 
148     public static String getTimeDescription(
149         PageContext pageContext, long milliseconds) {
150 
151         return getUnicodeLanguage().getTimeDescription(
152             pageContext, milliseconds);
153     }
154 
155     public static String getTimeDescription(
156         PageContext pageContext, Long milliseconds) {
157 
158         return getUnicodeLanguage().getTimeDescription(
159             pageContext, milliseconds);
160     }
161 
162     public static UnicodeLanguage getUnicodeLanguage() {
163         return _unicodeLanguage;
164     }
165 
166     public void setUnicodeLanguage(UnicodeLanguage unicodeLanguage) {
167         _unicodeLanguage = unicodeLanguage;
168     }
169 
170     private static UnicodeLanguage _unicodeLanguage;
171 
172 }