# ModulemdTranslationHelpers
## Prerequisites
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
* [koji](https://pagure.io/koji)
To install on Fedora 28+, run:
```
dnf install libmodulemd koji
```
## Installation
With the prerequisites installed, the latest version can be installed with
`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
python3-ModulemdTranslationHelpers` (recommended).
## CLI Usage
### Extract Translatable Strings
To extract translatable strings from modules for a particular Fedora
release (e.g. f29):
```
ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
```
This will read all of the module metadata from the Koji build-system and
convert the translatable strings to a portable object template (`.pot`)
document.
Specify the destination for the output file with `--pot-file`.
### Produce modulemd-translations YAML
To convert portable object (`.po`) files into
modulemd-translations YAML documents that can be included in repodata:
```
ModulemdTranslationHelpers --branch f29 generate_metadata \
[--pofile-dir <path>] \
[--yaml-file <path>]
```
This will read all files with a `.po` suffix in the `pofile-dir` path and
write the modulemd YAML to `yaml-file`.
## API
### ModulemdTranslationHelpers
The ModulemdTranslationHelpers package has two primary functions:
* get_module_catalog_from_tags()
* get_modulemd_translations()
#### ModulemdTranslationHelpers.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. It
can be passed to `babel.messages.pofile.write_po()` to create a portable
object template (`.pot`) file.
#### ModulemdTranslationHelpers.get_modulemd_translations()
This returns an iterable of modulemd-translation objects generated from a
set of paths to portable object (`.po`) files containing translation
information.
### ModulemdTranslationHelpers.Fedora
This package provides helper routines for dealing with translations in Fedora
Modules.
#### ModulemdTranslationHelpers.Fedora.KOJI_URL
The URL to the standard Fedora Koji instance.
#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
Looks up which Fedora version the current Rawhide branch will become.
#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
Gets the list of tags for modules in a given Fedora branch. (For rawhide,
make sure to use the value returned from get_fedora_rawhide_version.)
## Prerequisites
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
* [koji](https://pagure.io/koji)
To install on Fedora 28+, run:
```
dnf install libmodulemd koji
```
## Installation
With the prerequisites installed, the latest version can be installed with
`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
python3-ModulemdTranslationHelpers` (recommended).
## CLI Usage
### Extract Translatable Strings
To extract translatable strings from modules for a particular Fedora
release (e.g. f29):
```
ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
```
This will read all of the module metadata from the Koji build-system and
convert the translatable strings to a portable object template (`.pot`)
document.
Specify the destination for the output file with `--pot-file`.
### Produce modulemd-translations YAML
To convert portable object (`.po`) files into
modulemd-translations YAML documents that can be included in repodata:
```
ModulemdTranslationHelpers --branch f29 generate_metadata \
[--pofile-dir <path>] \
[--yaml-file <path>]
```
This will read all files with a `.po` suffix in the `pofile-dir` path and
write the modulemd YAML to `yaml-file`.
## API
### ModulemdTranslationHelpers
The ModulemdTranslationHelpers package has two primary functions:
* get_module_catalog_from_tags()
* get_modulemd_translations()
#### ModulemdTranslationHelpers.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. It
can be passed to `babel.messages.pofile.write_po()` to create a portable
object template (`.pot`) file.
#### ModulemdTranslationHelpers.get_modulemd_translations()
This returns an iterable of modulemd-translation objects generated from a
set of paths to portable object (`.po`) files containing translation
information.
### ModulemdTranslationHelpers.Fedora
This package provides helper routines for dealing with translations in Fedora
Modules.
#### ModulemdTranslationHelpers.Fedora.KOJI_URL
The URL to the standard Fedora Koji instance.
#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
Looks up which Fedora version the current Rawhide branch will become.
#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
Gets the list of tags for modules in a given Fedora branch. (For rawhide,
make sure to use the value returned from get_fedora_rawhide_version.)
Release files for ModulemdTranslationHelpers 0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ModulemdTranslationHelpers-0.6.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ModulemdTranslationHelpers-0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / ModulemdTranslationHelpers-0.6.tar.gz
| Download URL | ModulemdTranslationHelpers-0.6.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
104e3ba4041aa4c2934dfeccaf19decbf79423c9fba566eac65ee801050bd0c1
|
|
BLAKE2b-256 checksum How to use checksums |
d62bba3a7cff487ecc3156b25e712fc475db0f78d7d540aac5c877961a2df736
|
| 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/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.7.0
|
Release files / ModulemdTranslationHelpers-0.6-py3-none-any.whl
| Download URL | ModulemdTranslationHelpers-0.6-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ebb841d61276c9b7cde5e9e23751773647f1b845ba9b933892e0e47e9a7b723
|
|
BLAKE2b-256 checksum How to use checksums |
11de57dc55133a98ddbae9e099291300249dedb99e06943574b7d9da81701264
|
| 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/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.7.0
|