Skip to main content

Tools for working with translations of modulemd

Project description

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


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mmdzanata, version 0.7
Filename, size File type Python version Upload date Hashes
Filename, size mmdzanata-0.7-py2-none-any.whl (9.9 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size mmdzanata-0.7-py3-none-any.whl (9.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mmdzanata-0.7.tar.gz (8.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page