# mmdzanata
## Prerequisites
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
* [koji](https://pagure.io/koji)
* [zanata-client](https://github.com/zanata/zanata-client)
To install on Fedora 28+, run:
```
dnf install libmodulemd koji zanata-client
```
## Installation
With the prerequisites installed, the latest version can be installed with
`pip install mmdzanata` or on Fedora 28+ with `dnf install mmdzanata`
(recommended).
## CLI Usage
### Zanata Client Setup
Use of the upload feature for string extraction requires setting up the
Zanata client appropriately. Follow the
[instructions](http://docs.zanata.org/en/release/client/configuration/) from
Zanata to set up your `~/.config/zanata.ini` file appropriately. Note that
you will want to do this against
https://fedora.zanata.org
and not
https://translate.zanata.org
### Extract Translatable Strings
To extract translatable strings from modules for a particular Fedora
release (e.g. f29):
```
mmdzanata --branch f29 extract [--upload]
```
This will read all of the module metadata from the Koji build-system and
convert the translatable strings to a Zanata-compatible gettext document. If
`--upload` is passed, it will also attempt to use the `zanata-cli` tool to
upload the strings to the Zanata server. See the "Zanata Client Setup"
section above for information on how to configure this.
### Produce modulemd-translations YAML
To read the translated strings from Zanata and convert them into
modulemd-translations YAML documents that can be included in repodata:
```
mmdzanata --branch f29 generate_modulemd
```
This will produce a YAML file in the current directory with all known
translated strings.
## API
### mmdzanata
The mmdzanata class has two primary methods:
* get_module_catalog_from_tags()
* generate_metadata()
#### mmdzanata.get_module_catalog_from_tags()
This returns a babel.message.Catalog object containing all of the
translatable strings from any module tagged with one of the passed tags.
#### mmmdzanata.generate_metadata()
This returns an iterable of modulemd-translation objects from the supplied
Zanata project and branch.
### mmdzanata.fedora
This class provides helper routines for dealing with translations in Fedora
Modules.
## Prerequisites
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
* [koji](https://pagure.io/koji)
* [zanata-client](https://github.com/zanata/zanata-client)
To install on Fedora 28+, run:
```
dnf install libmodulemd koji zanata-client
```
## Installation
With the prerequisites installed, the latest version can be installed with
`pip install mmdzanata` or on Fedora 28+ with `dnf install mmdzanata`
(recommended).
## CLI Usage
### Zanata Client Setup
Use of the upload feature for string extraction requires setting up the
Zanata client appropriately. Follow the
[instructions](http://docs.zanata.org/en/release/client/configuration/) from
Zanata to set up your `~/.config/zanata.ini` file appropriately. Note that
you will want to do this against
https://fedora.zanata.org
and not
https://translate.zanata.org
### Extract Translatable Strings
To extract translatable strings from modules for a particular Fedora
release (e.g. f29):
```
mmdzanata --branch f29 extract [--upload]
```
This will read all of the module metadata from the Koji build-system and
convert the translatable strings to a Zanata-compatible gettext document. If
`--upload` is passed, it will also attempt to use the `zanata-cli` tool to
upload the strings to the Zanata server. See the "Zanata Client Setup"
section above for information on how to configure this.
### Produce modulemd-translations YAML
To read the translated strings from Zanata and convert them into
modulemd-translations YAML documents that can be included in repodata:
```
mmdzanata --branch f29 generate_modulemd
```
This will produce a YAML file in the current directory with all known
translated strings.
## API
### mmdzanata
The mmdzanata class has two primary methods:
* get_module_catalog_from_tags()
* generate_metadata()
#### mmdzanata.get_module_catalog_from_tags()
This returns a babel.message.Catalog object containing all of the
translatable strings from any module tagged with one of the passed tags.
#### mmmdzanata.generate_metadata()
This returns an iterable of modulemd-translation objects from the supplied
Zanata project and branch.
### mmdzanata.fedora
This class provides helper routines for dealing with translations in Fedora
Modules.
Release files for mmdzanata 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mmdzanata-0.7.tar.gz | 8.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mmdzanata-0.7-py3-none-any.whl | Python 3 | none | any | Details |
| mmdzanata-0.7-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 28.1 kB
Release files / mmdzanata-0.7.tar.gz
| Download URL | mmdzanata-0.7.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07762e504aff542ee42f4c34b67ac06bca88191219d65489f3c770ce33b1d39c
|
|
BLAKE2b-256 checksum How to use checksums |
5452168297aa1deb2a970e11f8b475c4581bceef286de6822f3d063bc4c4ee13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.7.0
|
Release files / mmdzanata-0.7-py3-none-any.whl
| Download URL | mmdzanata-0.7-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f825f0825808633014178ef0c097085c29581e7124c68760d5e0c607f233470
|
|
BLAKE2b-256 checksum How to use checksums |
5f9c1538486289b4ac83f9f52c58469a1ccf08065993819ae2ebb2ea23ddd1f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.7.0
|
Release files / mmdzanata-0.7-py2-none-any.whl
| Download URL | mmdzanata-0.7-py2-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
621459bc5ada57fba3142626581f822afd39bdd278023a9f54c6367de2bc7b21
|
|
BLAKE2b-256 checksum How to use checksums |
104385d3ad4c2776c55ffcf79274a177314c6f4628e3944b20a48674a937b843
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.7.0
|