Source code: org/javahispano/canyamo/services/i18n/Language.java
1 /*
2 Caņamo, portal framework
3 Copyright (c) 2002
4 Alberto Molpeceres, javaHispano (http://www.javahispano.org)
5 All rights reserved.
6 .
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14 Neither the name of Alberto Molpeceres, javaHispano nor the names of its
15 contributors may be used to endorse or promote products derived from
16 this software without specific prior written permission.
17 .
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
22 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 package org.javahispano.canyamo.services.i18n;
31
32 import java.util.*;
33 import java.text.*;
34
35 /**
36 * This interface represents a Language which can be managed by I18nManager.
37 *<br><br>
38 *A <code>Language</code> is only a class which can "translated" keys into the
39 *language it contains.
40 *
41 * @author <a href="mailto:al AT javahispano DOT org">Alberto Molpeceres</a>
42 * @created 25. März 2002
43 */
44 public interface Language {
45
46 /**
47 * Gets the "translated" value of the given key
48 *<br><br>
49 *Same as <code>get</code>
50 *
51 * @param key Word key
52 * @return translated value
53 */
54 public String getValue(String key);
55
56
57 /**
58 * Gets the "translated" value of the given key
59 *<br><br>
60 *Same as <code>getValue</code>
61 *
62 * @param key Word key
63 * @return translated value
64 */
65 public String get(String key);
66
67
68 /**
69 * Gets langauge's name
70 *
71 * @return name
72 */
73 public String getName();
74
75
76
77 /**
78 * Gets a long-date formatter for this language
79 *<br>
80 * which can be used to format dates
81 *according to the selected language
82 *<br><br>
83 *Example: 01-23-2002
84 *
85 * @return date formatter
86 */
87 public DateFormat getLongDateFormat();
88
89
90 /**
91 * Gets a short-date formatter for this language
92 *<br>
93 * which can be used to format dates
94 *according to the selected language
95 *<br><br>
96 *Example: 01-23-02
97 *
98 * @return date formatter
99 */
100 public DateFormat getShortDateFormat();
101
102 }
103