l.t.u.gettext_po_exporter : module documentation

Part of lp.translations.utilities

Export module for gettext's .po file format.

Find more about this file format at: http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

Function strip_last_newline Return text with the final newline/carriage return stripped.
Function comments_text_representation Return text representation of the comments.
Function wrap_text Return a list of strings with the given text wrapped to given width.
Function msgid_text_representation Return text representation of the msgids.
Function translation_text_representation Return text representation of the translations.
Function export_translation_message Return a text representing translation_message.
Class GettextPOExporterBase Base support class to export Gettext .po files.
Class GettextPOExporter Support class to export Gettext .po files.
Class GettextPOChangedExporter Support class to export changed Gettext .po files.
def strip_last_newline(text):
Return text with the final newline/carriage return stripped.
def comments_text_representation(translation_message):
Return text representation of the comments.
Parameterstranslation_messageAn ITranslationMessageData that will get comments exported.
def wrap_text(text, prefix, wrap_width):
Return a list of strings with the given text wrapped to given width.

We are not using textwrap module because the .po file format has some peculiarities like:

msgid "" "a really long line."

instead of:

msgid "a really long" "line."

with a wrapping width of 21.

ParameterstextUnicode string to wrap.
prefixUnicode prefix to prepend to the given text before wrapping it.
wrap_widthThe width where the text should be wrapped.
def msgid_text_representation(translation_message, wrap_width):
Return text representation of the msgids.
Parameterstranslation_messageAn ITranslationMessageData that will get its msgids exported.
wrap_widthThe width where the text should be wrapped.
def translation_text_representation(translation_message, wrap_width):
Return text representation of the translations.
Parameterstranslation_messageAn ITranslationMessageData that will get its translations exported.
wrap_widthThe width where the text should be wrapped.
def export_translation_message(translation_message, wrap_width=77):
Return a text representing translation_message.
API Documentation for Launchpad, generated by pydoctor at 2018-08-21 00:00:07.