gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / i18n / I18nManager.java @ 1396
History | View | Annotate | Download (2.54 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.tools.i18n; |
25 |
|
26 |
import java.io.File; |
27 |
|
28 |
public interface I18nManager { |
29 |
|
30 |
/**
|
31 |
* Get translation for the current language of <b>message</b>.
|
32 |
*
|
33 |
* If the translation not found return the message it self.
|
34 |
*
|
35 |
* @param message
|
36 |
* the message key used for translation.
|
37 |
*
|
38 |
* @return the traslated message
|
39 |
*/
|
40 |
public String getTranslation(String message); |
41 |
|
42 |
/**
|
43 |
* Get translation for the current language of <b>message</b>.
|
44 |
* This use the java MessageFormat utiity to replace args in the
|
45 |
* resulting translation message.
|
46 |
*
|
47 |
* If the translation not found return the message it self.
|
48 |
*
|
49 |
* @param message
|
50 |
* the message key used for translation.
|
51 |
*
|
52 |
* @param args
|
53 |
* @return the traslated message
|
54 |
*/
|
55 |
public String getTranslation(String message, String[] args); |
56 |
|
57 |
public void addResourceFamily(String family, ClassLoader loader, String callerName); |
58 |
|
59 |
/**
|
60 |
* Adds an additional family of resource files containing some translations.
|
61 |
* The search path to locate the files is provided by the dir parameter.
|
62 |
*
|
63 |
* Example:
|
64 |
* <code>i18nManager.addResourceFamily("text", new File("./resources"))</code>
|
65 |
*
|
66 |
* @param family The family name (or base name) which is used to search
|
67 |
* actual properties files.
|
68 |
* @param folder The search path to locate the property files
|
69 |
*/
|
70 |
|
71 |
public void addResourceFamily(String family, File folder); |
72 |
} |