Integration with Github - File structure

Hello guys,

I’m trying to integrate a project that has somewhat a unique file structure, meaning not all files are available for all languages:

  • src//translations.json → this file is available for all languages
  • src/en/incident.json --------> these are available only for EN and DE
  • src/de/incident.json -------|

I’m having trouble setting the transifex.yml to reflect that structure. It’s easy for the file in which is available for all languages, by using the translation_files_expression, but to tell transifex that I don’t have this incident.json file in any other languages other than EN and DE is what I don’t know how.

I have already tried ignore_files and ignore_dirs, but these are not working, as Transifex still shows on the resources that src/en/incident.json is not translated to Arabic, for example.

Any help will be highly appreciated.

Hello Rodrigo,

Let me know if I understand the situation well: You have a project with X amount of target languages, but you have files like incident.json that you do not want to translate to all target languages; you only want to translate these files to 2 out of all the target languages of this project, and I assume that the issue is that when you upload incident.json file resource, Transifex platform creates translation files for all the target languages instead of only for the two ones you need. Is this correct?

If the above is correct, can I ask if there is any reason why you do not want Transifex to create translation files for all target languages? Is this for the word count? Because if you add a resource and five target languages, even if you haven’t translated a word, your word count is occupied. Example: Source words = 100, Target Languages = 5, Your total occupied word count is 500 even if you haven’t translated a word.

If the above is true, this is why ignore_files and ignore_dirs were not working for you because these filters are only to ignore files and directories when you bring them from your GitHub repo to your Transifex project and not the other way around.

Please let me know if I understand the issue correctly so I can help you find a solution. Thank you in advance.

- Sandy

Hello Sandy, thank you for your reply. You’re correct in your assumption, that’s exactly what I want. The fact is, there are some parts of the website, where we offer more language support than others. And yes, the word count it’s important. Is there a way to circumvent this issue and accurately reflect a file structure like this?

1 Like

Hello Rodrigo,

Thank you for confirming the scenario. In this case, the only way to have some files with few target languages and other files with more target languages is to create multiple projects and link these projects to the same repository, and use ignore_files and ignore_dirs to avoid importing the files you do not want to have translations in the project’s target language.

Let’s say you can have Project A with only DE and EN as languages; and Project B with multiple languages.

  • In this scenario, you must add src/en/incident.json to project A and adjust the GitHub integration to ignore the rest of the files with ignore_files and ignore_dirs.
  • Files like src//translations.json can be in project B, and you will need to adjust the GitHub integration to ignore src/en/incident.json with ignore_files and ignore_dirs.

I also created a product improvement suggestion for creating a way to add target languages to a project at a resource level to make users able to choose in which of the target languages you want your files to be translated. I’ll let you know if this is deployed in future releases as soon as this functionality is ready for you to use.

Let me know if you have further questions,

Thank you for choosing Transifex!

- Sandy