Пример #1
0
 def exportTranslationMessageData(self, translation_message):
     """See `ITranslationFormatExporter`."""
     # XPI file format uses singular_text and plural_text instead of
     # msgid_singular and msgid_plural.
     if translation_message.singular_text is not None:
         translation_message.msgid_singular = (
             translation_message.singular_text)
     if translation_message.plural_text is not None:
         translation_message.msgid_plural = translation_message.plural_text
     return GettextPOExporter.exportTranslationMessageData(
         self, translation_message)
Пример #2
0
 def exportTranslationMessageData(self, translation_message):
     """See `ITranslationFormatExporter`."""
     # XPI file format uses singular_text and plural_text instead of
     # msgid_singular and msgid_plural.
     if translation_message.singular_text is not None:
         translation_message.msgid_singular = (
             translation_message.singular_text)
     if translation_message.plural_text is not None:
         translation_message.msgid_plural = translation_message.plural_text
     return GettextPOExporter.exportTranslationMessageData(
         self, translation_message)
Пример #3
0
    def exportTranslationMessageData(self, translation_message):
        """See `ITranslationFormatExporter`."""
        # Special handling of context and plural forms.
        if translation_message.context is not None:
            # Let's turn context messages into legacy KDE context.
            translation_message.msgid_singular = u"_: %s\n%s" % (
                translation_message.context,
                translation_message.msgid_singular)
            translation_message.context = None
        elif translation_message.msgid_plural is not None:
            # Also, let's handle legacy KDE plural forms.
            translations = translation_message.translations
            for pluralform_index in range(len(translations)):
                if translations[pluralform_index] is None:
                    translations[pluralform_index] = ''
            translation_message._translations = ["\n".join(translations)]
            translation_message.msgid_singular = u"_n: %s\n%s" % (
                translation_message.msgid_singular,
                translation_message.msgid_plural)
            translation_message.msgid_plural = None

        return GettextPOExporter.exportTranslationMessageData(
            self, translation_message)
Пример #4
0
    def exportTranslationMessageData(self, translation_message):
        """See `ITranslationFormatExporter`."""
        # Special handling of context and plural forms.
        if translation_message.context is not None:
            # Let's turn context messages into legacy KDE context.
            translation_message.msgid_singular = u"_: %s\n%s" % (
                translation_message.context,
                translation_message.msgid_singular)
            translation_message.context = None
        elif translation_message.msgid_plural is not None:
            # Also, let's handle legacy KDE plural forms.
            translations = translation_message.translations
            for pluralform_index in xrange(len(translations)):
                if translations[pluralform_index] is None:
                    translations[pluralform_index] = ''
            translation_message._translations = ["\n".join(translations)]
            translation_message.msgid_singular = u"_n: %s\n%s" % (
                translation_message.msgid_singular,
                translation_message.msgid_plural)
            translation_message.msgid_plural = None

        return GettextPOExporter.exportTranslationMessageData(
            self, translation_message)