Last updated:
0 purchases
mmdzanata 0.7
# 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```## InstallationWith 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 SetupUse of the upload feature for string extraction requires setting up theZanata client appropriately. Follow the[instructions](http://docs.zanata.org/en/release/client/configuration/) fromZanata to set up your `~/.config/zanata.ini` file appropriately. Note thatyou will want to do this againsthttps://fedora.zanata.organd nothttps://translate.zanata.org### Extract Translatable StringsTo extract translatable strings from modules for a particular Fedorarelease (e.g. f29):```mmdzanata --branch f29 extract [--upload]```This will read all of the module metadata from the Koji build-system andconvert 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### mmdzanataThe 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 thetranslatable strings from any module tagged with one of the passed tags.#### mmmdzanata.generate_metadata()This returns an iterable of modulemd-translation objects from the suppliedZanata project and branch.### mmdzanata.fedoraThis class provides helper routines for dealing with translations in FedoraModules.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.