Annotation Type LocalizableResource.Generate

Enclosing interface:
LocalizableResource

@Retention(RUNTIME) @Target(TYPE) public static @interface LocalizableResource.Generate
Requests that a translation source file be generated from the annotated interface. The file type is determined by the format argument, and the file name by the optional fileName argument. Some file formats support aggregating messages from multiple interfaces into one file, while others do not; also, additional parameters may be specified via format-specific annotations -- see the documentation of the MessageCatalogFormat implementation for details. Examples:
  • @Generate(format = "com.google.gwt.i18n.server.PropertyCatalogFactory")
    generates properties files for all locales, and the names will be of the form MyMessages_locale.properties
  • @Generate(format = {"com.example.ProprietaryFormat1", "com.example.ProprietaryFormat2"}, fileName = "myapp_translate_source", locales = {"default"})
    generates default files in two proprietary formats, with filenames like myapp_translate_source.p1 and myapp_translate_source.p2
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Fully-qualified class names of the generator classes.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A platform-specific filename for output.
    A list of locales for which to generate this output file.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Placeholder used to detect that no value was supplied for the fileName parameter.
  • Field Details

    • DEFAULT

      static final String DEFAULT
      Placeholder used to detect that no value was supplied for the fileName parameter.
      See Also:
  • Element Details

    • format

      String[] format
      Fully-qualified class names of the generator classes. Each class must implement com.google.gwt.i18n.server.MessageCatalogFactory (com.google.gwt.i18n.rebind.format.MessageCatalogFormat still works, but is deprecated). Strings are used here instead of class literals because the generators will likely contain non-translatable code and thus can't be referenced from translatable code directly. Each generator may define additional annotations to supply other necessary parameters.
    • fileName

      String fileName
      A platform-specific filename for output. If not present, the file will be named based on the fully-qualified name of the annotated interface. File names without a slash are given a relative name based on the fully-qualified package name of the annotated interface. Relative pathnames are generated in the auxiliary module directory (moduleName-aux in the output directory, which is specified by the "-out" flag to the compiler, or the current directory if not present) -- absolute path names are not allowed. Unless exactly one locale is specified for locales (not just only one locale happened to be compiled for), the locale will be appended to the name (such as _default [for the default locale], _en_US, etc) as well as the proper extension for the specified format. Note that if multiple generators are used, they will have the same base filename so the extensions must be different.
      Default:
      "[default]"
    • locales

      String[] locales
      A list of locales for which to generate this output file. If no locales are specified, all locales for which the application is compiled for will be generated. Note that the default locale is "default".
      Default:
      {}