Skip to main content

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

banz_i18n_codegenerator-1.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

banz_i18n_codegenerator-1.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for banz_i18n_codegenerator-1.1.0.tar.gz
Algorithm Hash digest
SHA256 27fe0183cbe03d0e6e22103032934975ea5c8c4568e7b32baf84346167dd88bc
MD5 367e3e77706d451ada5e134041b735c2
BLAKE2b-256 291ac3695c7902ccbdb3934c9480039a42a7b6ee412902523edf558c05bfa3ee

See more details on using hashes here.

File details

Details for the file banz_i18n_codegenerator-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for banz_i18n_codegenerator-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 075b0770f714af5ebaf2d415ce08941aed1e3c347fdd245b2e0510be11dd7cdc
MD5 c35a7944a4aae06f13368593a3f605aa
BLAKE2b-256 47de6a8d6b2b0cae25666b90eede0b98618e7d5da02848d79fcc62d56ec2ae1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page