Transifex-Github integration (Question2Answer) / Error: There were some errors in your configuration file. At least one filter is required

I try to setup Transifex-Github integration for Question2Answer (Q2A) popular open source Q&A platform for PHP/MySQL.
Transifex project: https://explore.transifex.com/q2a-fi/q2a-finnish-suomi-translation/
Github repo: https://github.com/q2a-suomi/question2answer/tree/master

In master branch there is transifex.yml but that doesn’t work.

git:
filters:
- filter_type: dynamic
  file_format: PHP
  source_language: en
  source_files_expression: qa-include/lang/<file>.php
  translation_files_expression: 'qa-lang/<lang>/<file>.php'

I get error:

There were some errors in your configuration file
At least one filter is required

How to fix problem?

Hello Marko,

I was able to replicate your issue; this is happening because there is an error in the indentation of your YAML file. You need to add an extra tab in all the lines after the “git:” line:

git:
  filters:
  - filter_type: dynamic
    file_format: PHP
    source_language: en
    source_files_expression: qa-include/lang/<file>.php
    translation_files_expression: 'qa-lang/<lang>/<file>.php'

After fixing this, you’ll see another error:
Screenshot 2023-09-05 at 11.41.43

This is because “PHP” is an invalid file format; please look at the multiple PHP file_format options we have available in our documentation. I consider your file can use “PHP_ARRAY” as the file_format option.
Screenshot 2023-09-05 at 12.14.40

After this, you will see a new error (I promise this is the last one!):

This is because in the file qa-lang-main.php, you need to put quote symbols around the numbers 1 and 4 in lines 65 and 80.
Screenshot 2023-09-05 at 11.52.02

After placing the quotes, you can sync again, and all your files will be uploaded successfully.

You can also make all these changes from the beginning and avoid this rocky road!

I hope you find this answer helpful; let me know if you have any questions,

- Sandy

1 Like