KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > common > i18n > ConsoleTranslate


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.common.i18n;
26
27 import java.util.MissingResourceException JavaDoc;
28 import java.util.ResourceBundle JavaDoc;
29
30 /**
31  * This class defines a ConsoleTranslate
32  *
33  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
34  * @version 1.0
35  */

36 public final class ConsoleTranslate extends I18N
37 {
38   /**
39    * GUI message description is stored in a different file
40    */

41   public static final String JavaDoc CONSOLE_LANGUAGE_FILE = "c-jdbc-console-language";
42
43   /**
44    * Translation bundle for C-JDBC messages
45    */

46   public static ResourceBundle JavaDoc bundle;
47
48   static
49   {
50     try
51     {
52       bundle = ResourceBundle.getBundle(CONSOLE_LANGUAGE_FILE);
53     }
54     catch (MissingResourceException JavaDoc e)
55     {
56       e.printStackTrace();
57     }
58   }
59
60   /**
61    * @param key the key to translate
62    * @return translation
63    * @see I18N#get(ResourceBundle, String)
64    */

65   public static String JavaDoc get(String JavaDoc key)
66   {
67     return get(bundle, key);
68   }
69
70   /**
71    * @param key the key to translate
72    * @param parameter boolean parameter
73    * @return translation
74    * @see I18N#get(ResourceBundle, String, boolean)
75    */

76   public static String JavaDoc get(String JavaDoc key, boolean parameter)
77   {
78     return get(bundle, key, parameter);
79   }
80
81   /**
82    * @param key the key to translate
83    * @param parameter int parameter
84    * @return translation
85    * @see I18N#get(ResourceBundle, String, int)
86    */

87   public static String JavaDoc get(String JavaDoc key, int parameter)
88   {
89     return get(bundle, key, parameter);
90   }
91
92   /**
93    * @param key the key to translate
94    * @param parameter long parameter
95    * @return translation
96    * @see I18N#get(ResourceBundle, String, long)
97    */

98   public static String JavaDoc get(String JavaDoc key, long parameter)
99   {
100     return get(bundle, key, parameter);
101   }
102
103   /**
104    * @param key the key to translate
105    * @param parameters Object array parameter
106    * @return translation
107    * @see I18N#get(ResourceBundle, String, Object[])
108    */

109   public static String JavaDoc get(String JavaDoc key, Object JavaDoc[] parameters)
110   {
111     return get(bundle, key, parameters);
112   }
113
114   /**
115    * @param key the key to translate
116    * @param parameter Object parameter
117    * @return translation
118    * @see I18N#get(ResourceBundle, String, Object)
119    */

120   public static String JavaDoc get(String JavaDoc key, Object JavaDoc parameter)
121   {
122     return get(bundle, key, parameter);
123   }
124 }
Popular Tags