padpo/README.md

103 lines
2.0 KiB
Markdown
Raw Normal View History

2019-11-05 15:30:14 +00:00
# padpo
2019-11-05 15:45:45 +00:00
2019-11-05 15:30:14 +00:00
Linter for gettext files (*.po)
2019-11-05 15:45:45 +00:00
2019-11-05 15:51:07 +00:00
Created to help the translation of official Python docs in French: https://github.com/python/python-docs-fr
2019-11-05 16:30:47 +00:00
Il faut demander aux traducteurs s'ils n'ont pas de pot quand ils traduisent, maintenant ils ont `padpo`
:smile: :laughing: :stuck_out_tongue_winking_eye: :joy: (note : il était tard le soir quand j'ai trouvé le nom).
2019-11-05 15:45:45 +00:00
**WORK IN PROGRESS**
## License
BSD 3-clause
2019-11-05 15:56:03 +00:00
Pull request are welcome.
2019-11-05 15:45:45 +00:00
## Trademark
* Code in one file (TM) :+1:
* It works on my machine (TM) :computer:
* Need refactoring (TM) :construction_worker:
## Usage
2019-11-05 15:52:20 +00:00
Using the *activated virtual environment* created during the installation:
2019-11-05 15:45:45 +00:00
2019-11-16 10:58:04 +00:00
For a local input file:
```bash
2019-11-18 17:08:19 +00:00
python -m padpo --input-path a_file.po
2019-11-16 10:58:04 +00:00
```
or for a local input directory:
```bash
2019-11-18 17:08:19 +00:00
python -m padpo --input-path a_directory_containing_po_files
2019-11-16 10:58:04 +00:00
```
or for a pull request in python-docs-fr repository (here pull request #978)
2019-11-05 15:45:45 +00:00
```bash
2019-11-18 17:08:19 +00:00
python -m padpo --python-docs-fr 978
2019-11-05 15:45:45 +00:00
```
2019-11-16 10:58:04 +00:00
or for a pull request in a GitHub repository (here python/python-docs-fr/pull/978)
2019-11-05 15:45:45 +00:00
```bash
2019-11-18 17:08:19 +00:00
python -m padpo --github python/python-docs-fr/pull/978
2019-11-05 15:45:45 +00:00
```
2019-11-05 16:08:08 +00:00
![Screenshot](screenshot.png)
2019-11-05 15:45:45 +00:00
## Installation
2019-11-18 16:35:37 +00:00
### Automatic installation
```
pip install padpo
```
### Manual installation
2019-11-05 16:34:30 +00:00
1. Create a virtual environment with Python 3.7 and above
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
```bash
python3.7 -m venv venv
```
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
2. Activate the virtual environment
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
```bash
source venv/bin/activate
```
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
3. Install dependencies
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
```bash
pip install -r requirements.txt
```
2019-11-16 10:58:04 +00:00
2019-11-18 16:35:37 +00:00
4. Get grammalecte (normally this is done automatically at first usage)
2019-11-16 10:58:04 +00:00
2019-11-05 15:45:45 +00:00
```bash
pip install wheel
2019-11-05 15:45:45 +00:00
wget https://grammalecte.net/grammalecte/zip/Grammalecte-fr-v1.5.0.zip
2019-11-05 16:01:57 +00:00
unzip Grammalecte-fr-v1.5.0.zip -d Grammalecte-fr-v1.5.0
2019-11-05 15:45:45 +00:00
cd Grammalecte-fr-v1.5.0
pip install .
```
2019-11-18 16:02:09 +00:00
## Update on PyPI
* git pull
* activate venv
* change version in `setup.py` and in `padpo.__init__`
* clean
* `rm -rf build/ dist/ eggs/`
* TODO make a script for this (and better clean)
* `python setup.py sdist`
* `python setup.py bdist_wheel`
* `twine upload dist/*`