예제 #1
0
    def setUpTranslationImportQueueForTemplate(self, subdir):
        """Return an ITranslationImportQueueEntry for testing purposes.

        :param subdir: subdirectory in firefox-data to get XPI data from.
        """
        # Get the file to import.
        en_US_xpi = get_en_US_xpi_file_to_import(subdir)
        return import_pofile_or_potemplate(file_contents=en_US_xpi.read(),
                                           person=self.importer,
                                           potemplate=self.firefox_template)
예제 #2
0
    def setUpTranslationImportQueueForTemplate(self, subdir):
        """Return an ITranslationImportQueueEntry for testing purposes.

        :param subdir: subdirectory in firefox-data to get XPI data from.
        """
        # Get the file to import.
        en_US_xpi = get_en_US_xpi_file_to_import(subdir)
        return import_pofile_or_potemplate(
            file_contents=en_US_xpi.read(),
            person=self.importer,
            potemplate=self.firefox_template)
예제 #3
0
    def setUpTranslationImportQueueForTranslation(self, subdir):
        """Return an ITranslationImportQueueEntry for testing purposes.

        :param subdir: subdirectory in firefox-data to get XPI data from.
        """
        # Get the file to import. Given the way XPI file format works, we can
        # just use the same template file like a translation one.
        es_xpi = get_en_US_xpi_file_to_import(subdir)
        return import_pofile_or_potemplate(file_contents=es_xpi.read(),
                                           person=self.importer,
                                           pofile=self.spanish_firefox,
                                           by_maintainer=True)
예제 #4
0
    def setUpTranslationImportQueueForTranslation(self, subdir):
        """Return an ITranslationImportQueueEntry for testing purposes.

        :param subdir: subdirectory in firefox-data to get XPI data from.
        """
        # Get the file to import. Given the way XPI file format works, we can
        # just use the same template file like a translation one.
        es_xpi = get_en_US_xpi_file_to_import(subdir)
        return import_pofile_or_potemplate(
            file_contents=es_xpi.read(),
            person=self.importer,
            pofile=self.spanish_firefox,
            by_maintainer=True)