Package to generate java constants for provided i18n.properties files.
Project description
i18n file generator
Provided multiple i18n.properties files, this will generate three Java classes Constants, Messages and ValidationMessages to link to the strings.
Usage
call generator.runGenerator(files: list, Ressource: str, targetPath: str, i18nPackagePath:str = null).
- files: List of i18n files to be considered (e.g. ['i18n.properties', 'i18n_de.properties'])
- resourcePath: path to the resource directory where the i18n files are stored (e.g. r'.\backend\domain\src\main\resources')
- targetPath: path to the target Directory where the Java classes should be created (e.g. r'.\backend\domain\src\main\java\org\derbanz\app\domain\i18n')
- i18nPackagePath: path to the I18N class handling the Translation. If left null, getter methods are not auto generated (e.g. 'org.derbanz.app.domain.base.I18N')
The Directory paths can be either absolute or relative, and they can be either raw or escaped (e.g. r'.\backend\domain\src\main\resources', r'D:\Development\app\backend\domain\src\main\resources', '.\\backend\\domain\\src\\main\\resources')
Example
from Banz_i18n_codegenerator import generator
# with getter methods
generator.run(['i18n_de.properties', 'i18n_en.properties'], 'D:\\\\Development\\\\app\\\\backend\\\\domain\\\\src\\\\main\\\\resources', r'.\backend\domain\src\main\java\org\derbanz\app\domain\i18n', 'org.derbanz.app.domain.base.I18N')
# without getter methods
generator.run(['i18n_de.properties', 'i18n_en.properties'], 'D:\\\\Development\\\\app\\\\backend\\\\domain\\\\src\\\\main\\\\resources', r'.\backend\domain\src\main\java\org\derbanz\app\domain\i18n')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file banz_i18n_codegenerator-1.1.0.tar.gz.
File metadata
- Download URL: banz_i18n_codegenerator-1.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27fe0183cbe03d0e6e22103032934975ea5c8c4568e7b32baf84346167dd88bc
|
|
| MD5 |
367e3e77706d451ada5e134041b735c2
|
|
| BLAKE2b-256 |
291ac3695c7902ccbdb3934c9480039a42a7b6ee412902523edf558c05bfa3ee
|
File details
Details for the file banz_i18n_codegenerator-1.1.0-py3-none-any.whl.
File metadata
- Download URL: banz_i18n_codegenerator-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
075b0770f714af5ebaf2d415ce08941aed1e3c347fdd245b2e0510be11dd7cdc
|
|
| MD5 |
c35a7944a4aae06f13368593a3f605aa
|
|
| BLAKE2b-256 |
47de6a8d6b2b0cae25666b90eede0b98618e7d5da02848d79fcc62d56ec2ae1f
|