Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2266

Custom file filter configuration with GUI / BCONF Management

    XMLWordPrintable

Details

    • High

    Description

      Okapi is used under the hood in translate5 to convert 84 different file types to xliff for import purposes.
      In many scenarios it is necessary to configure those import filters, e.g. to configure certain types of XML, define to exclude columns in an Excel file etc.
      Currently for this a bconf file can be created with Okapi Rainbow (a complicated desktop application, only usable for localization engineers) and passed along with the translate5 import package.
      The goal is, to develop an interface in translate5, that allows this configuration for the important filter definitions of Okapi.

      This sounds more complex, than it actually is, because a lot can be implemented in a generic way and used for the different file types.

      In this process it should also be possible to change the SRX file for segmentation rules, that is included in the Okapi bconf used by translate5. It should be possible to upload a changed srx file for a certain client specific configuration.

      Import versus export bconf

      So far only the import bconf is handled by the new developments. The export bconf mechanisms stay as they are.

      Implementation in the GUI - system configuration

      Title of the panel:

      EN: File format conversion

      DE: Dateiformatkonvertierung

       

      Panel heading:

      EN: File filter conversion sets

      DE: Dateiformatkonvertierungssets

       

       

      For each file extension listed in the table at
      http://www.okapiframework.org/wiki/index.php?title=Filters
      one line is added to the tree grid.

      Filter title in the second column should be the text in the "Format" column of the same page in the okapi wiki.

      Value in the 4th column "Okapi configuration" should be the string listed on the same page in the okapi wiki.

      If there are more than 1 filter options for a file extension, only one line should be added and per default the filter configuration is active, that is set in translate5s default import bconf.

      Default bconf / filter set

      The default okapi bconf is parsed and used to produce a default filter set with the name "Default filter set".

      It contains as subrows all filters that are available in the filter set.

      Action icons

      Edit: opens a panel next to the right of the filtered tree

      • For main row:
        • Offers to edit the name of the filter set.
        • Is not available for the default filter set.
        • Offers "Copy and adjust filters".
        • Offers "Upload changed segmentation rules (SRX)". This saves the uploaded SRX file to the below described file structure
        • Offers "Upload changed Okapi pipeline". This saves the uploaded Pipeline file to the below described file structure
      • For sub rows:
        • Offers to edit the configuration options for a filter.
        • Offers to edit the configuration name like "okf_openxml@translate5" - where only the part after the @ is editable
        • The name of the filter should not be editable - here always the default name of the default set it used
        • For the default filter set the configuration options are not editable

      Copy:

      • For main row:
        • Asks for a name of the new set and copies a set with all its subrows.
      • For sub rows:
        • Icon not available

      Delete: Only available for the main row. Deletes the filter set. Is only available for the custom filter sets, not for the default one.

      Download:

      • Only available for main row
      • Opens a submenu that offers the following options for download
        • Packaged configuration (bconf)
        • Segmentation rules (SRX)
        • Okapi pipeline (pipeline)

      Add bconf / filter set

      Somewhere at a good place above the grid columns a button is added "Add filter set". A click on the button adds a new main row to the grid, opens it for editing and places the cursor inside the (empty) name field for the filter set. Only if a name is entered, the filter set is saved. Everything is copied from the default filter set.

      Upload bconf / filter set

      Next to the "add filter set" button an "upload filter set" button exists. It offers a file upload dialogue to upload a bconf file.

      The contained files (srx, pipeline etc.) are saved as proposed below.

      Implementation in the GUI - client area

      The new tab should contain the same GUI components and functionality, as the "File format conversion" panel in the system configuration.

      Yet:

      • File filter sets created on system configuration level should be listed, but not editable or deletable
      • A new filterable boolean column "Client set" is added as first column (if that is easy, otherwise as second column)
      • Default sorting should be: First the client filter sets, second the system ones. And secondary sorting by name of filter set.
      • The client filter sets should not be listed in system configuration area, but only in the client one. And only those of the currently edited client.

      What information is saved how

      The following information should be saved in the database:

      • Existing filter sets and their parameters
        • name
        • What custom filters they contain
        • if pipeline or srx are customized

      They should not contain the actual configuration of a filter.

      The actual filter configuration is only contained in the file structure of the bconf file.

      This is saved unpacked to the file system, read from there if the configuration should be changed and packed on the fly, when a configuration is used for import purposes.

      If the pipeline or the srx file are not changed from the default bconf, they are not copied from the default bconf file directory, but fetched from there, when the bconf is packed.

      The other files that are packaged in a bconf are generated by translate5, when a filter set/filter is edited:

      • extensions-mapping.txt
      • the different fprm-files, one for each customized filter

       How filter configuration forms should look like

      When a user clicks "edit" for a filter, in a right side panel the filter configuration should be editable.

      At the top of the panel there is a label "Okapi configuration" and afterwards the Okapi configuration is printed, that is configured for the currently edited file extension. If there are more than one Okapi configurations available for the current file extension, instead a drop down is offered, where the selected configuration can be switched, including customized versions of the okapi configuration, that are availabe inside the current filter set.

      Below or next to the label "Okapi configuration" the link to the page that describes the config options in the okapi wiki is shown, as it is available at http://www.okapiframework.org/wiki/index.php?title=Filters

      Below a button "Copy and customize current configuration" is shown. If clicked, it creates a copy of the current filter configuration and selects it for the currently selected file extension.

      Below the form fields that Okapi Rainbow offers are shown and in case of a custom configuration also editable. The form fields do not have to be organized in the same way as in Rainbow - this might be changed where it makes sense. Yet the functionality should be the same.

      For the first release we start only with the configuration for the following file extensions:

      • htm
      • html
      • shmtl
      • xhtml
      • xml
      • idml
      • docx
      • xlsx
      • pptx
      • odt
      • .docm
      • .dotx
      • .dotm
      • .ods
      • .ots
      • .odg
      • .otg
      • .odp
      • .otp
      • .odt
      • .ott

      Others will follow afterwards.

      Information and download link for Okapi Rainbow can be found here: http://okapiframework.org/wiki/index.php?title=Rainbow

       

       

      Xliff should be added to the list of supported file formats with the options, okapi supports. An additional option should handle, if the file should be passed to okapi at all (and therefore optionally segmented) or not. This also solves https://jira.translate5.net/browse/TRANSLATE-2164

       

      Bconfs in Import-ZIPs

      Support for Bconfs in Import-ZIPs is to be removed. Also note this on the Import-ZIP documentation in Confluence. If a bconf is detected inside an Import-ZIP, show a hint to the user it has to be uploaded beforehand and selected from the bconf dropdown in Project Import Wizard.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              axelbecher Axel Becher
              marcmittag Marc Mittag [Administrator]
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: