prop-tool: Java *.properties file sync checker and syncing tool.
Project description
prop-tool
prop-tool
- Java *.properties file sync checker and syncing tool.
This utility can be used to check if translation files stay in sync with base file. It can also rewrite translation files adding missing keys based on the content of base file.
Based on *.properties
file format docs.
Validation
For prop-tool
base file A
and its translation file B
are in sync when:
- All keys present in base file are also present in translation file.
- There's no dangling keys (not existing in base) present in translation file.
NOTE: as this is quite common that translation file may not be updated instantly, prop-tool
considers key presence condition
fulfilled also when given key exists in B
file but is commented out and follow expected comment format:
# ==> KEY =
If you want to ensure that all keys are in fact translated, use --strict
mode while checking.
When running with --strict
option, all keys
Fixing files
You can use prop-tool
to update your translation files by using --fix
option. I such case prop-tool
will completely rewrite
translation files, adding missing keys (in commented out form).
NOTE: Be aware that --fix
do NOT update existing translation file but builds it completely using base file as reference and
existing translations (if present). No other content of translation files (i.e. comments etc) will be preserved.
Usage examples
Check if de
translation of test.properties
exists and is in sync:
prop-tool --base test.properties --lang de
You can ommit .properties
suffix in command line argument. It will be automatically added (so the file MUST have .properties
file name suffix, otherwise it will not be found):
prop-tool --base test --lang de
it will then look for test_de.properties
file in the same folder test.properties
resides and check it.
Check if de
, pl
and fr
translations of test.properties
and gui.properties
exist and are in sync:
prop-tool --base test gui --lang de pl fr
Limitations
- As of now
prop-tool
do not handle multiline entries.
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
Hashes for prop_tool-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c24a58374a35771ee6c7b9be026b44a7df365177b5b26f13a99fdc14ffcd8b6b |
|
MD5 | e065a03c92c549568648320549ec33ca |
|
BLAKE2b-256 | 0d6c5e687bcdcce968dec3487c20bce172a6bcc6de75b3a273e96e520340cb6b |