Package io.quarkus.qute.i18n
Annotation Type MessageBundle
-
@Retention(RUNTIME) @Target(TYPE) public @interface MessageBundle
Denotes a message bundle interface.Each method represents a single message:
@MessageBundle interface MyBundle { @Message("Hello {name}!") String hello_world(String name); }
-
-
Field Summary
Fields Modifier and Type Fields Description static String
DEFAULT_LOCALE
Constant value forlocale()
indicating that the default locale specified via thequarkus.default-locale
config property should be used.static String
DEFAULT_NAME
Constant value forvalue()
.static String
DEFAULTED_NAME
Constant value forvalue()
indicating that the name should be defaulted.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
defaultKey
The value may be one of the following:Message.ELEMENT_NAME
,Message.HYPHENATED_ELEMENT_NAME
andMessage.UNDERSCORED_ELEMENT_NAME
.String
locale
The language tag (IETF) of the default locale.String
value
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
.
-
-
-
-
DEFAULTED_NAME
static final String 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_index
and it could be used in a template via{Controller_index:hello(name)}
:class Controller { @MessageBundle interface index { @Message("Hello {name}!") String hello(String name); } }
-
-
Element Detail
-
value
String value
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
.If multiple bundles declare the same name then the build fails.
- Returns:
- the name of the bundle
- Default:
- "<<defaulted name>>"
-
-
-
defaultKey
String defaultKey
The value may be one of the following:Message.ELEMENT_NAME
,Message.HYPHENATED_ELEMENT_NAME
andMessage.UNDERSCORED_ELEMENT_NAME
.- Returns:
- the default key strategy
- See Also:
Message.key()
- Default:
- "<<element name>>"
-
-
-
locale
String locale
The language tag (IETF) of the default locale.- Returns:
- the locale for the default message bundle
- See Also:
Locale.forLanguageTag(String)
- Default:
- "<<default locale>>"
-
-