Introduce parameter objects for file format adapters/writers

Description

We should be able to use these parameter objects in FileFormatAdapters, FormatAdapterStreamingOutput, PoWriter2/PropWriter/XliffWriter.

// This one will really be a Java class: data class TranslatedDoc { // or ResourceWithTranslation? in zanata-common-api or -util // To be used pretty much everywhere we have a Resource with TranslationResource. val source: Resource val translation: TranslationResource val locale: LocaleId } // in org.zanata.adapter.FileFormatAdapter: parseDocumentFile(), parseTranslationFile() data class FileFormatAdapter.ParserOptions { // in services val rawFile: URI // (formerly originalFile/originalDoc) val params: Optional<String> val locale: LocaleId } // in org.zanata.adapter.FileFormatAdapter.writeTranslatedFile() data class FileFormatAdapter.WriterOptions { // in services val parserOptions: ParserOptions val translatedDoc: TranslatedDoc }

It might also make sense to create LocaleMappedTranslatedDoc, for use in org.zanata.client.commands.pull.PullStrategy#writeTransFile

// This one will really be a Java class too: data class LocaleMappedTranslatedDoc { // in zanata-client-commands val source: Resource val translation: TranslationResource val locale: LocaleMapping }

Assuming this goes in before Zanata 4.6.0, it would also be a good idea to remove the old method overloads which have the boolean approvedOnly parameter (which was only added in ZNTA-2437). So the methods which will accept approvedOnly will require the new parameter objects where applicable.

The original overloads which had neither the parameter objects nor approvedOnly will be removed if possible, otherwise deprecated for later removal (if part of public API).

Activity

Show:
Ready for Release

Details

Assignee

Reporter

Tested Version/s

Sprint

Priority

More fields

Created 12 June 2018 at 03:28
Updated 19 June 2018 at 05:21
Resolved 19 June 2018 at 05:21

Flag notifications