Metadata-Version: 2.1
Name: prop-tool
Version: 1.0.0
Summary: prop-tool: Java *.properties file sync checker and syncing tool.
Home-page: https://github.com/MarcinOrlowski/prop-tool
Author: Marcin Orlowski
Author-email: mail@marcinOrlowski.com
License: MIT License
Project-URL: Bug Tracker, https://github.com/MarcinOrlowski/prop-tool/issues
Project-URL: Documentation, https://github.com/MarcinOrlowski/prop-tool/
Project-URL: Source Code, https://github.com/MarcinOrlowski/prop-tool/
Keywords: java properties sync check validation
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: argparse (>=1.4.0)

# 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](https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertiesfileformat01.html).

## 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.
1. 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:

```bash
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):

```bash
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:

```bash
prop-tool --base test gui --lang de pl fr
```


## Limitations ##

* As of now `prop-tool` do not handle multiline entries.


