Package io.quarkus.qute.i18n
Annotation Interface MessageBundle
Denotes a message bundle interface.
Each method represents a single message:
@MessageBundle
interface MyBundle {
@Message("Hello {name}!")
String hello_world(String name);
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe value may be one of the following:Message.ELEMENT_NAME,Message.HYPHENATED_ELEMENT_NAMEandMessage.UNDERSCORED_ELEMENT_NAME.The language tag (IETF) of the default locale.The name is used as a namespace in templates expressions -{msg:hello_world}, and as a part of the name of a message bundle localized file -msg_de.properties. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant value forlocale()indicating that the default locale specified via thequarkus.default-localeconfig property should be used.static final StringConstant value forvalue().static final StringConstant value forvalue()indicating that the name should be defaulted.
-
Field Details
-
DEFAULT_LOCALE
Constant value forlocale()indicating that the default locale specified via thequarkus.default-localeconfig property should be used.- See Also:
-
DEFAULT_NAME
Constant value forvalue().- See Also:
-
DEFAULTED_NAME
Constant value forvalue()indicating that the name should be defaulted.For a top-level class the "msg" is used.
For a nested class the name consists of the simple names of all enclosing classes in the hierarchy (top-level class goes first), followed by the simple name of the message bundle interface. Names are separated by underscores. For example, the name of the following message bundle will be defaulted to
Controller_indexand it could be used in a template via{Controller_index:hello(name)}:class Controller { @MessageBundle interface index { @Message("Hello {name}!") String hello(String name); } }- See Also:
-
-
Element Details
-
value
String valueThe name is used as a namespace in templates expressions -{msg:hello_world}, and as a part of the name of a message bundle localized file -msg_de.properties.If multiple bundles declare the same name then the build fails.
- Returns:
- the name of the bundle
- Default:
- "<<defaulted name>>"
-
defaultKey
String defaultKeyThe value may be one of the following:Message.ELEMENT_NAME,Message.HYPHENATED_ELEMENT_NAMEandMessage.UNDERSCORED_ELEMENT_NAME.- Returns:
- the default key strategy
- See Also:
- Default:
- "<<element name>>"
-
locale
String localeThe language tag (IETF) of the default locale.- Returns:
- the locale for the default message bundle
- See Also:
- Default:
- "<<default locale>>"
-