enhancement
major
minor
major
minor
enhancement
Currently, resources are declared in I18NConstants files and maintained accordingly in the module’s I18N properties. To do this, the fully qualified name of the property must be copied into the resource file, where the replacement text is then entered and translated into all languages.
Improvement
The English translation of the key is maintained directly in the JavaDoc comment for the property. This is then transferred to the module’s system resources by the JavaDoc task and subsequently translated into all supported languages using DeepL:
#!java
package my.package;
public class I18NConstants extends I18NConstantsBase {
/**
* Error message if a required attribute has no value.
*
* @en Value of {0} is missing
* @tooltip To complete the process, all values must be filled in.
*/
public static ResKey ERROR_MISSING_VALUE__ATTR;
...
}
The @en JavaDoc tag specifies the replacement text for the key in English. Optional documentation for the key is still possible.
Test
- Create an I18NConstants file with the key.
- Run `mvn install ` on the module (the DeepL API key must be configured).
- Check whether the key, the replacement value, and the translations have been added to the system resources (src/main/java/META-INF/...).