Annotation Interface BaseBundleName


@Documented @Retention(SOURCE) @Target(FIELD) @ClassVersion(sourceVersion="$Id: BaseBundleName.java 995 2022-01-23 01:09:35Z tquadrat $") @API(status=STABLE, since="0.1.0") public @interface BaseBundleName

This annotation is used to mark a String constant that holds the base bundle name for the resource bundle for the messages and texts. When the annotation processor finds more than one field with this annotation, the result is unpredictable.

The code for the default language is used when there is no resource bundle for the current language/locale setting. If not explicitly set, the default is "en", the language code for English.

If this annotation is not used at all, the constant "MessagesAndTexts" will be used for the base bundle name and the locale ENGLISH is used as the default language.

When used with modules, the base bundle name should be either a simple class name without a package name, or the package should be open for this module (org.tquadrat.foundation.i18n); otherwise a resource bundle provider must be provided (and the methods I18nUtil.loadResourceBundle(String) and I18nUtil.loadResourceBundle(String,Module) cannot be used). This is because this library is one module, while the (generated) application resource bundle lives in another module, and is therefore not accessible. In opposite, a bundle without package is accessible from everywhere.

Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: BaseBundleName.java 995 2022-01-23 01:09:35Z tquadrat $
Since:
0.1.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The default language.
  • Element Details

    • defaultLanguage

      The default language.
      Returns:
      The language code for the default language.
      Default:
      "en"