Package com.iizix.text
Enum LocaleString
- java.lang.Object
-
- java.lang.Enum<LocaleString>
-
- com.iizix.text.LocaleString
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LocaleString>
public enum LocaleString extends java.lang.Enum<LocaleString>
The LocaleString enum that hold strings in various languages. The strings are placed in predefined system text tables the predefined "builtin" project. When using these texts, they automatically search for these ID's defined in the user application's text tables that are flagged to also handle LocaleString's. This makes it possible to have custom text replacements and/or additional translations into other languages not provided in the system.Other text IDs are also present in:
The ID for each entry is prepended with "sys." for the text tables. These are the defined texts:
Text ID Fallback English text -------------------------------- --------------------------------- General: sys.ValueConversionError_HTML [b]Input error[/b][br]{} (in HTML, "Input error: {}" for PLAIN). sys.ValueConversionError_PLAIN Input error: {} Actions: sys.Action_OK OK sys.Action_Cancel Cancel sys.Action_Close Close sys.Action_Yes Yes sys.Action_No No sys.Action_Confirm Confirm sys.Action_Continue Continue sys.Action_Abort Abort Time: sys.Time_short_now now sys.Time_medium_now now sys.Time_long_now just now sys.Time_short_less_than_1_minute < 1 m sys.Time_medium_less_than_1_minute < 1 min sys.Time_long_less_than_1_minute less than a minute sys.Time_short_less_than_1_hour < 1 h sys.Time_medium_less_than_1_hour < 1 hour sys.Time_long_less_than_1_hour less than a minute sys.Time_short_less_than_1_day < 1 d sys.Time_medium_less_than_1_day < 1 day sys.Time_long_less_than_1_day less than a day sys.Time_short_less_than_1_week < 1 w sys.Time_medium_less_than_1_week < 1 week sys.Time_long_less_than_1_week less than a week sys.Time_short_less_than_1_year < 1 y sys.Time_medium_less_than_1_year < 1 year sys.Time_long_less_than_1_year less than a year sys.Time_short_Second s sys.Time_short_Seconds s sys.Time_medium_Second sec sys.Time_medium_Seconds secs sys.Time_long_Second second sys.Time_long_Second_1 one second sys.Time_long_Seconds seconds sys.Time_short_Minute m sys.Time_short_Minutes m sys.Time_medium_Minute min sys.Time_medium_Minutes mins sys.Time_long_Minute minute sys.Time_long_Minute_1 one minute sys.Time_long_Minutes minutes sys.Time_short_Hour h sys.Time_short_Hours h sys.Time_medium_Hour hour sys.Time_medium_Hours hours sys.Time_long_Hour hour sys.Time_long_Hour_1 one hour sys.Time_long_Hours hours sys.Time_short_Day d sys.Time_short_Days d sys.Time_medium_Day day sys.Time_medium_Days days sys.Time_long_Day day sys.Time_long_Day_1 one day sys.Time_long_Days days sys.Time_short_Week w sys.Time_short_Weeks w sys.Time_medium_Week week sys.Time_medium_Weeks weeks sys.Time_long_Week week sys.Time_long_Week_1 one week sys.Time_long_Weeks weeks sys.Time_short_Week y sys.Time_short_Weeks y sys.Time_medium_Week year sys.Time_medium_Weeks years sys.Time_long_Week year sys.Time_long_Week_1 one year sys.Time_long_Weeks years Distance: sys.Distance_short_near near sys.Distance_long_near close by sys.Distance_short_meter m sys.Distance_short_meters m sys.Distance_long_meter one meter sys.Distance_long_meters meters sys.Distance_short_kilometer m sys.Distance_short_kilometers m sys.Distance_long_kilometer one kilometer sys.Distance_long_kilometers kilometers Device capabilities: devcap.Phone Phone capabilities (smart or feature phone) devcap.Battery Battery status capabilities devcap.Contacts Contacts database capabilities devcap.Compass Compass capabilities devcap.Camera Camera capabilities devcap.Geolocation Geolocation capabilities devcap.GPS GPS capabilities devcap.Touch Touch capabilities devcap.Mouse Mouse capabilities (Desktop device) devcap.Pen Pen capabilities devcap.Motion Motion capabilities (accelerometer) devcap.Microphone Microphone (sound capture) capabilities devcap.VideoCapture Video capture capabilities devcap.Sound Play music or basic sounds capabilities devcap.SpeechSynthesis Speech synthesis (speech output) devcap.SpeechRecognition Speech recognition (for commands and text input) devcap.Vibration Vibration capabilities
- Author:
- Christopher Mindus
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description KString
asKString()
Gets the KString for an enum value.KString
asKString(SessionInfo sessionInfo)
Gets the KString for an enum value.static KString
asKString(SessionInfo sessionInfo, java.lang.String textID)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.static KString
asKString(SessionInfo sessionInfo, java.lang.String textID, KString fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.static KString
asKString(ILocaleString localeString, java.lang.String textID, KString fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.static KString
asKString(java.lang.String textID)
Looks up a text ID from the system tables.static KString
asKString(java.lang.String textID, KString fallback)
Looks up a text ID from the system tables.java.lang.String
asString()
Gets the plain string for an enum value.java.lang.String
asString(SessionInfo sessionInfo)
Gets the plain string for an enum value.static java.lang.String
asString(SessionInfo sessionInfo, java.lang.String textID)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.static java.lang.String
asString(SessionInfo sessionInfo, java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.java.lang.String
asString(ILocaleString localeString)
Gets the plain string for an enum value.static java.lang.String
asString(ILocaleString localeString, java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.static java.lang.String
asString(java.lang.String textID)
Looks up a text ID from the system tables.static java.lang.String
asString(java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables.static LocaleString
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LocaleString[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ValueConversionError_HTML
public static final LocaleString ValueConversionError_HTML
The message for an invalid value conversion in HTML: "[b]Input error[/b][br]".
-
ValueConversionError_PLAIN
public static final LocaleString ValueConversionError_PLAIN
The message for an invalid value conversion in plain text: "Input error: ".
-
Action_OK
public static final LocaleString Action_OK
"OK" text for actions.
-
Action_Cancel
public static final LocaleString Action_Cancel
"Cancel" text for actions.
-
Action_Close
public static final LocaleString Action_Close
"Close" text for actions.
-
Action_Yes
public static final LocaleString Action_Yes
"Yes" text for actions.
-
Action_No
public static final LocaleString Action_No
"No" text for actions.
-
Action_Confirm
public static final LocaleString Action_Confirm
"Confirm" text for actions.
-
Action_Continue
public static final LocaleString Action_Continue
"Continue" text for actions.
-
Action_Abort
public static final LocaleString Action_Abort
"Abort" text for actions.
-
Time_short_now
public static final LocaleString Time_short_now
-
Time_medium_now
public static final LocaleString Time_medium_now
-
Time_long_now
public static final LocaleString Time_long_now
-
Time_short_less_than_1_minute
public static final LocaleString Time_short_less_than_1_minute
-
Time_medium_less_than_1_minute
public static final LocaleString Time_medium_less_than_1_minute
-
Time_long_less_than_1_minute
public static final LocaleString Time_long_less_than_1_minute
-
Time_short_less_than_1_hour
public static final LocaleString Time_short_less_than_1_hour
-
Time_medium_less_than_1_hour
public static final LocaleString Time_medium_less_than_1_hour
-
Time_long_less_than_1_hour
public static final LocaleString Time_long_less_than_1_hour
-
Time_short_less_than_1_day
public static final LocaleString Time_short_less_than_1_day
-
Time_medium_less_than_1_day
public static final LocaleString Time_medium_less_than_1_day
-
Time_long_less_than_1_day
public static final LocaleString Time_long_less_than_1_day
-
Time_short_less_than_1_week
public static final LocaleString Time_short_less_than_1_week
-
Time_medium_less_than_1_week
public static final LocaleString Time_medium_less_than_1_week
-
Time_long_less_than_1_week
public static final LocaleString Time_long_less_than_1_week
-
Time_short_less_than_1_year
public static final LocaleString Time_short_less_than_1_year
-
Time_medium_less_than_1_year
public static final LocaleString Time_medium_less_than_1_year
-
Time_long_less_than_1_year
public static final LocaleString Time_long_less_than_1_year
-
Time_short_Second
public static final LocaleString Time_short_Second
-
Time_short_Seconds
public static final LocaleString Time_short_Seconds
-
Time_medium_Second
public static final LocaleString Time_medium_Second
-
Time_medium_Seconds
public static final LocaleString Time_medium_Seconds
-
Time_long_Second
public static final LocaleString Time_long_Second
-
Time_long_Second_1
public static final LocaleString Time_long_Second_1
-
Time_long_Seconds
public static final LocaleString Time_long_Seconds
-
Time_short_Minute
public static final LocaleString Time_short_Minute
-
Time_short_Minutes
public static final LocaleString Time_short_Minutes
-
Time_medium_Minute
public static final LocaleString Time_medium_Minute
-
Time_medium_Minutes
public static final LocaleString Time_medium_Minutes
-
Time_long_Minute
public static final LocaleString Time_long_Minute
-
Time_long_Minute_1
public static final LocaleString Time_long_Minute_1
-
Time_long_Minutes
public static final LocaleString Time_long_Minutes
-
Time_short_Hour
public static final LocaleString Time_short_Hour
-
Time_short_Hours
public static final LocaleString Time_short_Hours
-
Time_medium_Hour
public static final LocaleString Time_medium_Hour
-
Time_medium_Hours
public static final LocaleString Time_medium_Hours
-
Time_long_Hour
public static final LocaleString Time_long_Hour
-
Time_long_Hour_1
public static final LocaleString Time_long_Hour_1
-
Time_long_Hours
public static final LocaleString Time_long_Hours
-
Time_short_Day
public static final LocaleString Time_short_Day
-
Time_short_Days
public static final LocaleString Time_short_Days
-
Time_medium_Day
public static final LocaleString Time_medium_Day
-
Time_medium_Days
public static final LocaleString Time_medium_Days
-
Time_long_Day
public static final LocaleString Time_long_Day
-
Time_long_Day_1
public static final LocaleString Time_long_Day_1
-
Time_long_Days
public static final LocaleString Time_long_Days
-
Time_short_Week
public static final LocaleString Time_short_Week
-
Time_short_Weeks
public static final LocaleString Time_short_Weeks
-
Time_medium_Week
public static final LocaleString Time_medium_Week
-
Time_medium_Weeks
public static final LocaleString Time_medium_Weeks
-
Time_long_Week
public static final LocaleString Time_long_Week
-
Time_long_Week_1
public static final LocaleString Time_long_Week_1
-
Time_long_Weeks
public static final LocaleString Time_long_Weeks
-
Time_short_Year
public static final LocaleString Time_short_Year
-
Time_short_Years
public static final LocaleString Time_short_Years
-
Time_medium_Year
public static final LocaleString Time_medium_Year
-
Time_medium_Years
public static final LocaleString Time_medium_Years
-
Time_long_Year
public static final LocaleString Time_long_Year
-
Time_long_Year_1
public static final LocaleString Time_long_Year_1
-
Time_long_Years
public static final LocaleString Time_long_Years
-
Distance_short_near
public static final LocaleString Distance_short_near
-
Distance_long_near
public static final LocaleString Distance_long_near
-
Distance_short_less_than_1_kilometer
public static final LocaleString Distance_short_less_than_1_kilometer
-
Distance_long_less_than_1_kilometer
public static final LocaleString Distance_long_less_than_1_kilometer
-
Distance_short_meter
public static final LocaleString Distance_short_meter
-
Distance_short_meters
public static final LocaleString Distance_short_meters
-
Distance_long_meter
public static final LocaleString Distance_long_meter
-
Distance_long_meter_1
public static final LocaleString Distance_long_meter_1
-
Distance_long_meters
public static final LocaleString Distance_long_meters
-
Distance_short_kilometer
public static final LocaleString Distance_short_kilometer
-
Distance_short_kilometers
public static final LocaleString Distance_short_kilometers
-
Distance_long_kilometer
public static final LocaleString Distance_long_kilometer
-
Distance_long_kilometer_1
public static final LocaleString Distance_long_kilometer_1
-
Distance_long_kilometers
public static final LocaleString Distance_long_kilometers
-
-
Method Detail
-
values
public static LocaleString[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocaleString c : LocaleString.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocaleString valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
asString
public java.lang.String asString()
Gets the plain string for an enum value. The string will be in the client session's language setting, the application session's setting or the default language setting and if none of these were found in the specified order, the
string is returned.fallback
- Returns:
- The String for the enum in most accurate locale.
-
asString
public java.lang.String asString(SessionInfo sessionInfo)
Gets the plain string for an enum value. The string will be in the client session's language setting, the application session's setting or the default language setting and if none of these were found in the specified order, the
string is returned.fallback
- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.- Returns:
- The String for the enum in most accurate locale.
-
asString
public java.lang.String asString(ILocaleString localeString)
Gets the plain string for an enum value. The string will be in the client session's language setting, the application session's setting or the default language setting and if none of these were found in the specified order, the
string is returned.fallback
- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
forfallback
return value if text ID is not found.- Returns:
- The String for the enum in most accurate locale.
-
asKString
public KString asKString()
Gets the KString for an enum value. The string will be in the client session's language setting, the application session's setting or the default language setting and if none of these were found in the specified order, the
string is returned.fallback
- Returns:
- The KString for the enum in most accurate locale.
-
asKString
public KString asKString(SessionInfo sessionInfo)
Gets the KString for an enum value. The string will be in the client session's language setting, the application session's setting or the default language setting and if none of these were found in the specified order, the
string is returned.fallback
- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.- Returns:
- The KString for the enum in most accurate locale.
-
asString
public static java.lang.String asString(java.lang.String textID)
Looks up a text ID from the system tables. The session information is looked up from the current thread if possible, otherwise the text will not be found.- Parameters:
textID
- The text ID to look-up.- Returns:
- The potentially localized string
or
textID "textID" not found
if none is found.
-
asString
public static java.lang.String asString(java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables. The session information is looked up from the current thread if possible, otherwise the text will not be found.- Parameters:
textID
- The text ID to look-up.- Returns:
- The potentially localized string or the
fallback
String, ortextID "textID" not found
if none is found andfallback
isnull
.
-
asString
public static java.lang.String asString(SessionInfo sessionInfo, java.lang.String textID)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.textID
- The text ID to look-up.- Returns:
- The potentially localized string or the
fallback
String, ortextID "textID" not found
if none is found.
-
asString
public static java.lang.String asString(SessionInfo sessionInfo, java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.textID
- The text ID to look-up.fallback
- The fallback text, ornull
for none.- Returns:
- The potentially localized string or the
fallback
String, ortextID "textID" not found
if none is found andfallback
isnull
.
-
asString
public static java.lang.String asString(ILocaleString localeString, java.lang.String textID, java.lang.String fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
forfallback
return value if text ID is not found.textID
- The text ID to look-up.fallback
- The fallback string ornull
for none.- Returns:
- The potentially localized string or the
fallback
String, ortextID "textID" not found
if none is found andfallback
isnull
.
-
asKString
public static KString asKString(java.lang.String textID)
Looks up a text ID from the system tables. The session information is looked up from the current thread if possible, otherwise the text will not be found.- Parameters:
textID
- The text ID to look-up.- Returns:
- The potentially localized KString
or
textID "textID" not found
if none is found.
-
asKString
public static KString asKString(java.lang.String textID, KString fallback)
Looks up a text ID from the system tables. The session information is looked up from the current thread if possible, otherwise the text will not be found.- Parameters:
textID
- The text ID to look-up.- Returns:
- The potentially localized KString or the
fallback
KString, ortextID "textID" not found
if none is found andfallback
isnull
.
-
asKString
public static KString asKString(SessionInfo sessionInfo, java.lang.String textID)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.textID
- The text ID to look-up.- Returns:
- The potentially localized KString or the
fallback
KString, ortextID "textID" not found
if none is found.
-
asKString
public static KString asKString(SessionInfo sessionInfo, java.lang.String textID, KString fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
sessionInfo
- The session information, ornull
if not available. ifnull
the system will attempt to look up the current client or application session from the current thread.textID
- The text ID to look-up.fallback
- The fallback text, ornull
for none.- Returns:
- The potentially localized KString or the
fallback
KString, ortextID "textID" not found
if none is found andfallback
isnull
.
-
asKString
public static KString asKString(ILocaleString localeString, java.lang.String textID, KString fallback)
Looks up a text ID from the system tables with an optionalsessionInfo
parameter that can be non-null to define the locale, otherwise it is looked up.- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
forfallback
return value if text ID is not found.textID
- The text ID to look-up.fallback
- The fallback KString ornull
for none.- Returns:
- The potentially localized KString or the
fallback
KString, ortextID "textID" not found
if none is found andfallback
isnull
.
-
-