Skip to content

Commit d996cb7

Browse files
committed
Update README.md
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent b19a0d8 commit d996cb7

1 file changed

Lines changed: 36 additions & 32 deletions

File tree

README.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,69 @@
22
## Prerequisites
33
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
44
* [koji](https://pagure.io/koji)
5-
* [zanata-client](https://github.com/zanata/zanata-client)
65

76
To install on Fedora 28+, run:
87
```
9-
dnf install libmodulemd koji zanata-client
8+
dnf install libmodulemd koji
109
```
1110

1211
## Installation
1312
With the prerequisites installed, the latest version can be installed with
14-
`pip install mmdzanata` or on Fedora 28+ with `dnf install mmdzanata`
15-
(recommended).
13+
`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
14+
python3-ModulemdTranslationHelpers` (recommended).
1615

1716
## CLI Usage
18-
### Zanata Client Setup
19-
Use of the upload feature for string extraction requires setting up the
20-
Zanata client appropriately. Follow the
21-
[instructions](http://docs.zanata.org/en/release/client/configuration/) from
22-
Zanata to set up your `~/.config/zanata.ini` file appropriately. Note that
23-
you will want to do this against
24-
https://fedora.zanata.org
25-
and not
26-
https://translate.zanata.org
2717

2818
### Extract Translatable Strings
2919
To extract translatable strings from modules for a particular Fedora
3020
release (e.g. f29):
3121
```
32-
mmdzanata --branch f29 extract [--upload]
22+
ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
3323
```
3424
This will read all of the module metadata from the Koji build-system and
35-
convert the translatable strings to a Zanata-compatible gettext document. If
36-
`--upload` is passed, it will also attempt to use the `zanata-cli` tool to
37-
upload the strings to the Zanata server. See the "Zanata Client Setup"
38-
section above for information on how to configure this.
25+
convert the translatable strings to a Zanata-compatible gettext document.
26+
Specify the destination for the POT file with `--pot-file`.
3927

4028
### Produce modulemd-translations YAML
4129
To read the translated strings from Zanata and convert them into
4230
modulemd-translations YAML documents that can be included in repodata:
4331
```
44-
mmdzanata --branch f29 generate_modulemd
32+
ModulemdTranslationHelpers --branch f29 generate_metadata \
33+
[--pofile-dir <path>] \
34+
[--yaml-file <path>]
35+
4536
```
4637

47-
This will produce a YAML file in the current directory with all known
48-
translated strings.
38+
This will read all files with a `.po` suffix in the `pofile-dir` path and
39+
write the modulemd YAML to `yaml-file`.
4940

5041
## API
51-
### mmdzanata
52-
The mmdzanata class has two primary methods:
42+
### ModulemdTranslationHelpers
43+
The ModulemdTranslationHelpers package has two primary functions:
5344
* get_module_catalog_from_tags()
54-
* generate_metadata()
45+
* get_modulemd_translations()
5546

56-
#### mmdzanata.get_module_catalog_from_tags()
57-
This returns a babel.message.Catalog object containing all of the
58-
translatable strings from any module tagged with one of the passed tags.
47+
#### ModulemdTranslationHelpers.get_module_catalog_from_tags()
48+
This returns a `babel.message.Catalog` object containing all of the
49+
translatable strings from any module tagged with one of the passed tags. It
50+
can be passed to `babel.messages.pofile.write_po()` to create a portable
51+
object template (`.pot`) file.
5952

60-
#### mmmdzanata.generate_metadata()
61-
This returns an iterable of modulemd-translation objects from the supplied
62-
Zanata project and branch.
53+
#### ModulemdTranslationHelpers.get_modulemd_translations()
54+
This returns an iterable of modulemd-translation objects generated from a
55+
set of paths to portable object (`.po`) files containing translation
56+
information.
6357

64-
### mmdzanata.fedora
65-
This class provides helper routines for dealing with translations in Fedora
58+
### ModulemdTranslationHelpers.Fedora
59+
This package provides helper routines for dealing with translations in Fedora
6660
Modules.
61+
62+
#### ModulemdTranslationHelpers.Fedora.KOJI_URL
63+
The URL to the standard Fedora Koji instance.
64+
65+
#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
66+
Looks up which Fedora version the current Rawhide branch will become.
67+
68+
#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
69+
Gets the list of tags for modules in a given Fedora branch. (For rawhide,
70+
make sure to use the value returned from get_fedora_rawhide_version.)

0 commit comments

Comments
 (0)