Modulemd.Translation

g GObject.Object GObject.Object Modulemd.Translation Modulemd.Translation GObject.Object->Modulemd.Translation

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (version, module_name, module_stream, modified)

copy ()

get_locales ()

get_translation_entry (locale)

set_modified (modified)

set_translation_entry (translation_entry)

validate ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

modified

int

r/w

The last modified time represented as a 64-bit integer (such as 201807011200)

module-name

str

r/w/co

The name of the module to which these translations apply.

module-stream

str

r/w/co

The name of the module stream to which these translations apply.

version

int

r/w/co

The metadata version of this Translation object.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Modulemd.Translation(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Modulemd.TranslationClass

classmethod new(version, module_name, module_stream, modified)
Parameters:
  • version (int) – The metadata version of this Modulemd.Translation.

  • module_name (str) – The name of the module to which these translations apply.

  • module_stream (str) – The name of the module stream to which these translations apply.

  • modified (int) – The last modified time represented as a 64-bit integer (such as 201807011200).

Returns:

A newly-allocated Modulemd.Translation object. This object must be freed with GObject.Object.unref().

Return type:

Modulemd.Translation

New in version 2.0.

copy()
Returns:

The copied Modulemd.Translation object.

Return type:

Modulemd.Translation

Create a copy of this Modulemd.Translation object.

New in version 2.0.

get_locales()
Returns:

An ordered #GStrv list of locales known to this Modulemd.Translation.

Return type:

[str]

New in version 2.0.

get_translation_entry(locale)
Parameters:

locale (str) – The locale of the translation to retrieve.

Returns:

The translation entry for the requested locale, or None if the locale was unknown.

Return type:

Modulemd.TranslationEntry

New in version 2.0.

set_modified(modified)
Parameters:

modified (int) – The last modified time represented as a 64-bit integer (such as 201807011200).

New in version 2.0.

set_translation_entry(translation_entry)
Parameters:

translation_entry (Modulemd.TranslationEntry) – A set of translations of this module stream for a particular locale.

New in version 2.0.

validate()
Raises:

GLib.Error

Return type:

bool

This method ensures that the translation is internally consistent for usage or dumping to YAML. It will be run implicitly prior to emitting YAML. This is not a complete linter, merely a sanity check that the values are not impossible.

New in version 2.0.

Property Details

Modulemd.Translation.props.modified
Name:

modified

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The last modified time represented as a 64-bit integer (such as 201807011200)

Modulemd.Translation.props.module_name
Name:

module-name

Type:

str

Default Value:

'__TRANSLATION_VALUE_UNSET__'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the module to which these translations apply.

Modulemd.Translation.props.module_stream
Name:

module-stream

Type:

str

Default Value:

'__TRANSLATION_VALUE_UNSET__'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the module stream to which these translations apply.

Modulemd.Translation.props.version
Name:

version

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The metadata version of this Translation object.