1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.language;
24  
25  import java.util.Locale;
26  
27  import javax.servlet.jsp.PageContext;
28  
29  /**
30   * <a href="UnicodeLanguageUtil.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Brian Wing Shun Chan
33   */
34  public class UnicodeLanguageUtil {
35  
36      public static String format(
37          Locale locale, String pattern, Object argument) {
38  
39          return getUnicodeLanguage().format(locale, pattern, argument);
40      }
41  
42      public static String format(
43          Locale locale, String pattern, Object[] arguments) {
44  
45          return getUnicodeLanguage().format(locale, pattern, arguments);
46      }
47  
48      /**
49       * @deprecated
50       */
51      public static String format(
52          long companyId, Locale locale, String pattern, Object argument) {
53  
54          return getUnicodeLanguage().format(locale, pattern, argument);
55      }
56  
57      /**
58       * @deprecated
59       */
60      public static String format(
61          long companyId, Locale locale, String pattern, Object[] arguments) {
62  
63          return getUnicodeLanguage().format(locale, pattern, arguments);
64      }
65  
66      public static String format(
67          PageContext pageContext, String pattern, LanguageWrapper argument) {
68  
69          return getUnicodeLanguage().format(pageContext, pattern, argument);
70      }
71  
72      public static String format(
73          PageContext pageContext, String pattern, LanguageWrapper argument,
74          boolean translateArguments) {
75  
76          return getUnicodeLanguage().format(
77              pageContext, pattern, argument, translateArguments);
78      }
79  
80      public static String format(
81          PageContext pageContext, String pattern, LanguageWrapper[] arguments) {
82  
83          return getUnicodeLanguage().format(pageContext, pattern, arguments);
84      }
85  
86      public static String format(
87          PageContext pageContext, String pattern, LanguageWrapper[] arguments,
88          boolean translateArguments) {
89  
90          return getUnicodeLanguage().format(
91              pageContext, pattern, arguments, translateArguments);
92      }
93  
94      public static String format(
95          PageContext pageContext, String pattern, Object argument) {
96  
97          return getUnicodeLanguage().format(pageContext, pattern, argument);
98      }
99  
100     public static String format(
101         PageContext pageContext, String pattern, Object argument,
102         boolean translateArguments) {
103 
104         return getUnicodeLanguage().format(
105             pageContext, pattern, argument, translateArguments);
106     }
107 
108     public static String format(
109         PageContext pageContext, String pattern, Object[] arguments) {
110 
111         return getUnicodeLanguage().format(pageContext, pattern, arguments);
112     }
113 
114     public static String format(
115         PageContext pageContext, String pattern, Object[] arguments,
116         boolean translateArguments) {
117 
118         return getUnicodeLanguage().format(
119             pageContext, pattern, arguments, translateArguments);
120     }
121 
122     public static String get(Locale locale, String key) {
123         return getUnicodeLanguage().get(locale, key);
124     }
125 
126     public static String get(Locale locale, String key, String defaultValue) {
127         return getUnicodeLanguage().get(locale, key, defaultValue);
128     }
129 
130     /**
131      * @deprecated
132      */
133     public static String get(long companyId, Locale locale, String key) {
134         return getUnicodeLanguage().get(locale, key);
135     }
136 
137     /**
138      * @deprecated
139      */
140     public static String get(
141         long companyId, Locale locale, String key, String defaultValue) {
142 
143         return getUnicodeLanguage().get(locale, key, defaultValue);
144     }
145 
146     public static String get(PageContext pageContext, String key) {
147         return getUnicodeLanguage().get(pageContext, key);
148     }
149 
150     public static String get(
151         PageContext pageContext, String key, String defaultValue) {
152 
153         return getUnicodeLanguage().get(pageContext, key, defaultValue);
154     }
155 
156     public static String getTimeDescription(
157         PageContext pageContext, long milliseconds) {
158 
159         return getUnicodeLanguage().getTimeDescription(
160             pageContext, milliseconds);
161     }
162 
163     public static String getTimeDescription(
164         PageContext pageContext, Long milliseconds) {
165 
166         return getUnicodeLanguage().getTimeDescription(
167             pageContext, milliseconds);
168     }
169 
170     public static UnicodeLanguage getUnicodeLanguage() {
171         return _unicodeLanguage;
172     }
173 
174     public void setUnicodeLanguage(UnicodeLanguage unicodeLanguage) {
175         _unicodeLanguage = unicodeLanguage;
176     }
177 
178     private static UnicodeLanguage _unicodeLanguage;
179 
180 }