org.apache.avalon.fortress.examples.components
Interface Translator
- All Known Implementing Classes:
- TranslatorImpl
- public interface Translator
Translator component. This component provides simple translations of given
keys, identified by language name.
- Version:
- CVS $Revision: 1.6 $ $Date: 2004/02/24 22:31:21 $
- Author:
- Avalon Development Team
Field Summary |
static java.lang.String |
ROLE
Role identifying Component |
Method Summary |
java.lang.String[] |
getSupportedLanguages(java.lang.String key)
getSupportedLanguages returns an array of String
objects detailing which languages are supported for the given
key. |
java.lang.String |
getTranslation(java.lang.String key,
java.lang.String language)
getTranslation obtains a translation for a given
key in a given language. |
ROLE
public static final java.lang.String ROLE
- Role identifying Component
getSupportedLanguages
public java.lang.String[] getSupportedLanguages(java.lang.String key)
getSupportedLanguages
returns an array of String
objects detailing which languages are supported for the given
key.
- Parameters:
key
- a String
value identifying a translation
- Returns:
- a
String[]
array containing available language
translations for the given key
getTranslation
public java.lang.String getTranslation(java.lang.String key,
java.lang.String language)
getTranslation
obtains a translation for a given
key in a given language. The language parameter must be listed
in getSupportedLanguages
.
- Parameters:
key
- a String
value identifying a translationlanguage
- a String
value identifying the language
- Returns:
- translated text
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.