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      public static String format(
49          long companyId, Locale locale, String pattern, Object argument) {
50  
51          return getUnicodeLanguage().format(
52              companyId, locale, pattern, argument);
53      }
54  
55      public static String format(
56          long companyId, Locale locale, String pattern, Object[] arguments) {
57  
58          return getUnicodeLanguage().format(
59              companyId, locale, pattern, arguments);
60      }
61  
62      public static String format(
63          PageContext pageContext, String pattern, Object argument) {
64  
65          return getUnicodeLanguage().format(pageContext, pattern, argument);
66      }
67  
68      public static String format(
69          PageContext pageContext, String pattern, Object argument,
70          boolean translateArguments) {
71  
72          return getUnicodeLanguage().format(
73              pageContext, pattern, argument, translateArguments);
74      }
75  
76      public static String format(
77          PageContext pageContext, String pattern, Object[] arguments) {
78  
79          return getUnicodeLanguage().format(pageContext, pattern, arguments);
80      }
81  
82      public static String format(
83          PageContext pageContext, String pattern, Object[] arguments,
84          boolean translateArguments) {
85  
86          return getUnicodeLanguage().format(
87              pageContext, pattern, arguments, translateArguments);
88      }
89  
90      public static String format(
91          PageContext pageContext, String pattern, LanguageWrapper argument) {
92  
93          return getUnicodeLanguage().format(pageContext, pattern, argument);
94      }
95  
96      public static String format(
97          PageContext pageContext, String pattern, LanguageWrapper argument,
98          boolean translateArguments) {
99  
100         return getUnicodeLanguage().format(
101             pageContext, pattern, argument, translateArguments);
102     }
103 
104     public static String format(
105         PageContext pageContext, String pattern, LanguageWrapper[] arguments) {
106 
107         return getUnicodeLanguage().format(pageContext, pattern, arguments);
108     }
109 
110     public static String format(
111         PageContext pageContext, String pattern, LanguageWrapper[] arguments,
112         boolean translateArguments) {
113 
114         return getUnicodeLanguage().format(
115             pageContext, pattern, arguments, translateArguments);
116     }
117 
118     public static String get(Locale locale, String key) {
119         return getUnicodeLanguage().get(locale, key);
120     }
121 
122     public static String get(long companyId, Locale locale, String key) {
123         return getUnicodeLanguage().get(companyId, locale, key);
124     }
125 
126     public static String get(
127         long companyId, Locale locale, String key, String defaultValue) {
128 
129         return getUnicodeLanguage().get(companyId, locale, key, defaultValue);
130     }
131 
132     public static String get(PageContext pageContext, String key) {
133         return getUnicodeLanguage().get(pageContext, key);
134     }
135 
136     public static String get(
137         PageContext pageContext, String key, String defaultValue) {
138 
139         return getUnicodeLanguage().get(pageContext, key, defaultValue);
140     }
141 
142     public static String getTimeDescription(
143         PageContext pageContext, Long milliseconds) {
144 
145         return getUnicodeLanguage().getTimeDescription(
146             pageContext, milliseconds);
147     }
148 
149     public static String getTimeDescription(
150         PageContext pageContext, long milliseconds) {
151 
152         return getUnicodeLanguage().getTimeDescription(
153             pageContext, milliseconds);
154     }
155 
156     public static UnicodeLanguage getUnicodeLanguage() {
157         return _unicodeLanguage;
158     }
159 
160     public void setUnicodeLanguage(UnicodeLanguage unicodeLanguage) {
161         _unicodeLanguage = unicodeLanguage;
162     }
163 
164     private static UnicodeLanguage _unicodeLanguage;
165 
166 }