java.lang.Object
is.codion.common.i18n.Messages
A class providing shared internationalization messages for common UI elements and actions
throughout the Codion framework.
This class provides localized messages for standard UI operations such as Cancel, OK, Clear, Refresh, and other common actions. Messages are loaded from resource bundles and support multiple locales with automatic fallback to the default locale when translations are not available.
Thread Safety:
This class is thread-safe. All methods are static and the underlying MessageBundle
handles concurrent access safely.
Supported Locales:
- English (default) - Messages.properties
- Icelandic (is_IS) - Messages_is_IS.properties
Usage Examples:
// Get localized messages String cancelText = Messages.cancel(); String okText = Messages.ok(); // Get mnemonics for keyboard navigation char cancelMnemonic = Messages.cancelMnemonic(); char clearMnemonic = Messages.clearMnemonic(); // Use in UI components JButton cancelButton = new JButton(Messages.cancel()); cancelButton.setMnemonic(Messages.cancelMnemonic());
Adding New Messages:
To add new messages:
- Add the key constant to this class
- Add the corresponding entries to all Messages*.properties files
- Add public static methods to access the messages
- Update this documentation to reflect the new messages
Mnemonic Guidelines:
Mnemonics should be unique within each locale to avoid keyboard navigation conflicts.
If a mnemonic string is empty, the corresponding method returns the null character ('\0').
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cancel()
static char
static String
clear()
static char
static String
clearTip()
static String
copy()
static String
error()
static String
find()
static String
login()
static String
no()
static String
ok()
static char
static String
password()
static String
print()
static char
static String
refresh()
static char
static String
static String
search()
static String
username()
static String
yes()
-
Method Details
-
cancel
- Returns:
- cancel
-
cancelMnemonic
public static char cancelMnemonic()- Returns:
- cancel mnemonic
-
print
- Returns:
-
printMnemonic
public static char printMnemonic()- Returns:
- print mnemonic
-
error
- Returns:
- error
-
yes
- Returns:
- yes
-
no
- Returns:
- no
-
ok
- Returns:
- ok
-
okMnemonic
public static char okMnemonic()- Returns:
- ok mnemonic
-
copy
- Returns:
- copy
-
login
- Returns:
- login
-
username
- Returns:
- username
-
password
- Returns:
- password
-
search
- Returns:
- search
-
clear
- Returns:
- clear
-
clearTip
- Returns:
- clear tip
-
clearMnemonic
public static char clearMnemonic()- Returns:
- clear mnemonic
-
find
- Returns:
- find
-
refresh
- Returns:
- refresh
-
refreshMnemonic
public static char refreshMnemonic()- Returns:
- refresh mnemonic
-
refreshTip
- Returns:
- refresh tip
-