Module org.tquadrat.foundation.i18n
Package org.tquadrat.foundation.i18n
Annotation Interface Message
@Retention(SOURCE)
@Target(FIELD)
@ClassVersion(sourceVersion="$Id: Message.java 882 2021-02-27 19:01:25Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public @interface Message
Use this annotation to define the text for a message that has
to be translated. Texts for UI elements or alike will be defined with the
annotation
Text.
The build process will take care of this definition and creates the required resource bundle properties files.
Use this annotation as follows:
@Message
(
description = "A message",
translations =
{
@Translation( language = "en", text = "This is an English message" ),
@Translation( language = "de", text = "Dies ist eine Nachricht in Deutsch" )
}
)
public static final int MSG_MessageKey = 1704;
or
@Message
(
description = "A message",
translations =
{
@Translation( language = "en", text = "This is an English message" ),
@Translation( language = "de", text = "Dies ist eine Nachricht in Deutsch" )
}
)
public static final String MSG_MessageKey = "AMessage";
The value for the constant together with the prefix defined with the
annotation
MessagePrefix
has to be unique.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: Message.java 882 2021-02-27 19:01:25Z tquadrat $
- Since:
- 0.1.0
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionReturns the description for the text.Returns the list of valid translations for the message.
-
Element Details
-
description
Returns the description for the text.- Returns:
- The description.
-
translations
Returns the list of valid translations for the message.- Returns:
- The translations.
-
