GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fedora-modularity/ModulemdTranslationHelpers: A python library and CLI tool for extracting translatable strings and generating modulemd-translations YAML

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
ModulemdTranslationHelpers
ModulemdTranslationHelpers
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

ModulemdTranslationHelpers

Prerequisites

  • libmodulemd
  • 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+ (recommended) with:

dnf install python3-ModulemdTranslationHelpers 

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_translation_catalog_from_index()
  • get_modulemd_translations_from_catalog()

ModulemdTranslationHelpers.get_translation_catalog_from_index()

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_from_catalog()

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

About

A python library and CLI tool for extracting translatable strings and generating modulemd-translations YAML

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

5 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.