net.sf.jeters.internationalization
Interface Translatable

All Known Implementing Classes:
AssistedComponent, AssistedTranslatable, DefaultGUI, FileIO, MediaWikiIO, RegExReplacer, RegExReplacer_User, UserIO

public interface Translatable

interface for components with strings that can be translated to different languages. Components implementing Translatable will get ResourceBundle objects depending on JETERS current locale and the .properties files available for the component.

In many cases, it is much more convenient to use AssistedTranslatable instead of directly implementing this interface. However, the following informations about .properties files apply to AssistedTranslatable, too.

Property files must be named lang_[language]_[COUNTRY].properties (where [language] and [COUNTRY] identify the locale the file is to be used for, the possible values are those from ISO 639-1 and ISO 3166-1). They must be placed in a folder languages/[ComponentClassSimpleName]/ either relative to JETERS' root directory or to the root dir inside the component's jar.

Please note that [ComponentClassSimpleName] refers to the output of .getSimpleName() applied to the component's class.

So if you want to internationalize your component, do the following:


Additional possibility: Including a displayName property in your .properties allows you to set localized component names.

Author:
Tobias Knerr

Method Summary
 void setLanguageResourceBundle(java.util.ResourceBundle langRB)
          sets the ResourceBundle that contains the messages to use
 

Method Detail

setLanguageResourceBundle

void setLanguageResourceBundle(java.util.ResourceBundle langRB)
sets the ResourceBundle that contains the messages to use

Parameters:
langRB - ResourceBundle to retrieve Strings from