convert

Code to convert between different storage formats for localizations.

acesskey

functions used to manipulate access keys in strings.

class translate.convert.accesskey.UnitMixer(labelsuffixes, accesskeysuffixes)

Helper to mix separately defined labels and accesskeys into one unit.

match_entities(index)

Populates mixedentities from the index.

static mix_units(label_unit, accesskey_unit, target_unit)

Mix the given units into the given target_unit if possible.

Might return None if no match is possible.

translate.convert.accesskey.combine(label: str, accesskey: str, accesskey_marker: str = '&') str | None

Combine a label and and accesskey to form a label+accesskey string.

We place an accesskey marker before the accesskey in the label and this creates a string with the two combined e.g. “File” + “F” = “&File”

The case of the accesskey is preferred unless no match is found, in which case the alternate case is used.

Parameters:
  • label – a label

  • accesskey – The accesskey

Returns:

label+accesskey string or None if uncombineable

translate.convert.accesskey.extract(string: str, accesskey_marker: str = '&') tuple[str, str]

Extract the label and accesskey from a label+accesskey string.

The function will also try to ignore &entities; which would obviously not contain accesskeys. :param string: A string that might contain a label with accesskey marker :param accesskey_marker: The character that is used to prefix an access key

convert

csv2po

csv2tbx

dtd2po

factory

Factory methods to convert supported input files to supported translatable files.

exception translate.convert.factory.UnknownExtensionError(afile)
add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception translate.convert.factory.UnsupportedConversionError(in_ext=None, out_ext=None, templ_ext=None)
add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

html2po

ical2po

ini2po

json2po

moz2po

mozfunny2prop

mozlang2po

odf2xliff

oo2po

oo2xliff

php2po

po2csv

po2dtd

po2html

po2ical

po2ini

po2json

po2mozlang

po2moz

po2oo

po2php

po2prop

po2rc

po2resx

po2sub

po2symb

po2tiki

po2tmx

po2ts

po2txt

po2web2py

po2wordfast

po2xliff

po2yaml

pot2po

prop2mozfunny

prop2po

rc2po

resx2po

sub2po

symb2po

tiki2po

ts2po

txt2po

web2py2po

xliff2odf

xliff2oo

xliff2po

yaml2po