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

Customers file filters are not used for file extension checking

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • None
    • InstantTranslate
    • High
    • Custom customers file filters are not used for file extension checking when using file translation in InstantTranslate

      problem / reproduction

      • Add a second customer to a user
      • Add to that customer a separate bconf which supports new file types
        • application/modules/editor/Plugins/Okapi/tests/OkapiExportBconfTest/typo3.bconf can be used 
      • Open InstantTranslate
        1. choose Translate file
        2. since the user has multiple customers now, there is a dropdown:
        1. Choose the User (must not be the first customer assigned to the client, otherwise the bug would not happen)
        2. upload application/modules/editor/Plugins/Okapi/tests/OkapiExportBconfTest/workfiles/export-contentelements-14104-EN.xliff.typo3
        3. ERROR: file type is not recognized

      desired behaviour

      File type is recognized and import works since the "Thomas Tes" client from the screenshot has a bconf assigned which supports the typo3 file ending.

      technical reason and solution

      The reason behind is, that in application/modules/editor/PrivatePlugins/InstantTranslate/Controllers/InstanttranslateController.php only the supported file types of the first customer are stored in the UI for checking: 

       

      $this->view->Php2JsVars()->set(
          'supportedFileExtensions',
          FileTypeSupport::fileTranslationInstance()->getSupportedExtensions()
      ); 

      This should be changed, so that all supported extensions of all clients of a user are passed to the UI. Suggestion as 2D array, first level customer IDs, second level the file extensions. 
      Then in the instanttranslate UI can the proper array be used depending on the chosen Customer.
       
       
       

       

            volodymyr@mittagqi.com Volodymyr Kyianenko
            tlauria Thomas Lauria
            Aleksandar Mitrev, Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: