inkex.localization module#
Allow extensions to translate messages.
- inkex.localization.localize(domain=GETTEXT_DOMAIN, localedir=GETTEXT_DIRECTORY)[source]#
Configure gettext and install _() function into builtins namespace for easy access
- inkex.localization.inkex_localize()[source]#
Return internal Translations instance for translation of the inkex module itself Those will always use the ‘inkscape’ domain and attempt to lookup the same catalog Inkscape uses
- inkex.localization.inkex_gettext(message)#
Shortcut for gettext. Import as:
from inkex.localize import inkex_gettext as _
- inkex.localization.inkex_ngettext(msgid1, msgid2, n)#
Shortcut for ngettext
New in version 1.2.
- inkex.localization.inkex_fgettext(message, *args, **kwargs)[source]#
Shortcut for gettext and subsequent formatting. Import as:
from inkex.localize import inkex_fgettext as _f
The positionals and keyword arguments are passed to
str.format()
.The call to xgettext must contain:
--keyword=_f
- inkex.localization.inkex_pgettext(context, message)#
Gettext with context. Import as:
from inkex.localize import inkex_pgettext as pgettext
Both parameters must be string literals. The call to xgettext must contain:
--keyword=pgettext:1c,2
New in version 1.2.