Revision 44338 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.i18n/src/main/java/org/gvsig/i18n/tools/impl/DefaultI18Manager.java
DefaultI18Manager.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.io.File; |
27 | 27 |
import java.net.MalformedURLException; |
28 |
import java.util.List; |
|
28 | 29 |
import java.util.Locale; |
29 |
import java.util.logging.Level; |
|
30 |
import java.util.logging.Logger; |
|
31 | 30 |
|
32 | 31 |
import org.gvsig.i18n.Messages; |
33 | 32 |
import org.gvsig.tools.i18n.I18nManager; |
... | ... | |
35 | 34 |
/** |
36 | 35 |
* This manager is in charge of providing with a richer text translation than |
37 | 36 |
* the one used by default. |
38 |
*
|
|
39 |
*
|
|
37 |
* |
|
38 |
* |
|
40 | 39 |
* @author gvSIG Team |
41 |
*
|
|
40 |
* |
|
42 | 41 |
*/ |
43 | 42 |
public class DefaultI18Manager implements I18nManager { |
44 | 43 |
|
45 |
public String getTranslation(String message) { |
|
46 |
return Messages.getText(message); |
|
47 |
} |
|
44 |
@Override |
|
45 |
public String getTranslation(String message) { |
|
46 |
return Messages.getText(message); |
|
47 |
} |
|
48 | 48 |
|
49 |
public String getTranslation(String message, String[] args) { |
|
50 |
return Messages.getText(message,args); |
|
49 |
@Override |
|
50 |
public String getTranslation(String message, String[] args) { |
|
51 |
return Messages.getText(message, args); |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public void addResourceFamily(String family, ClassLoader loader, |
|
56 |
String callerName) { |
|
57 |
if (!Messages.hasLocales()) { |
|
58 |
Messages.addLocale(Locale.getDefault()); |
|
51 | 59 |
} |
60 |
Messages.addResourceFamily(family, loader, callerName); |
|
61 |
} |
|
52 | 62 |
|
53 |
public void addResourceFamily(String family, ClassLoader loader, |
|
54 |
String callerName) { |
|
55 |
if (!Messages.hasLocales()) { |
|
56 |
Messages.addLocale(Locale.getDefault()); |
|
57 |
} |
|
58 |
Messages.addResourceFamily(family, loader, callerName); |
|
59 |
} |
|
63 |
@Override |
|
64 |
public void addResourceFamily(String family, File folder) { |
|
65 |
if (!Messages.hasLocales()) { |
|
66 |
Messages.addLocale(Locale.getDefault()); |
|
67 |
} |
|
68 |
try { |
|
69 |
Messages.addResourceFamily(family, folder); |
|
70 |
} catch (MalformedURLException ex) { |
|
71 |
throw new RuntimeException(ex); |
|
72 |
} |
|
73 |
} |
|
60 | 74 |
|
61 |
public void addResourceFamily(String family, File folder) { |
|
62 |
if (!Messages.hasLocales()) { |
|
63 |
Messages.addLocale(Locale.getDefault()); |
|
64 |
} |
|
65 |
try { |
|
66 |
Messages.addResourceFamily(family, folder); |
|
67 |
} catch (MalformedURLException ex) { |
|
68 |
throw new RuntimeException(ex); |
|
69 |
} |
|
70 |
} |
|
75 |
@Override |
|
76 |
public List<Locale> getPreferredLocales() { |
|
77 |
return Messages.getPreferredLocales(); |
|
78 |
} |
|
79 |
|
|
80 |
@Override |
|
81 |
public Locale getCurrentLocale() { |
|
82 |
return Messages.getCurrentLocale(); |
|
83 |
} |
|
71 | 84 |
} |
Also available in: Unified diff