Skip to main content

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:

  1. All keys present in base file are also present in translation file.
  2. 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

prop-tool-1.0.0.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

prop_tool-1.0.0-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

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