Error: Sorry, a file exists where you are trying to create a subdirectory

I have problems with the GitHub Integration, my po files are located in the folder lang\po, my yaml configuration is:

git:
  filters:
  - filter_type: dir
    file_format: PO
    source_file_extension: po
    source_language: en
    source_file_dir: lang/po
    translation_files_expression: 'lang/po/<lang>.po'

The URL of my repo is:

Syncing fails now because Transifex tries to create a file at lang/po/de.po/de.po which cannot work because there is already a file at lang/po/de.po.

lang/po/de.po/de.po appears to be incorrect, it should be lang/po/de.po.

What could be the reason for this problem?

Hello!

I cloned your repo and found this issue:

  1. In your YAML file, there is extra space and also an indentation issue; please add an extra tab in each line from the “filters:” line to the “translation_files_expression” line; optionally remove the blank space on the first line:

After this, you’ll notice that your repo is uploaded successfully in Transifex, but you’ll see that all your files will be uploaded as source files. Is this expected? Could you please help me understand which files would be the source files and which would be the translation files?

Hello,
thanks for the help.

In your YAML file, there is extra space and also an indentation issue; please add an extra tab in each line from the “filters:” line to the “translation_files_expression” line; optionally remove the blank space on the first line:

I used an example found online, probably from here:

After this, you’ll notice that your repo is uploaded successfully in Transifex, but you’ll see that all your files will be uploaded as source files. Is this expected?

In the beginning, I was totally clueless about how transifex works, I didn’t know if I need one or multiple files or resources. I started then reading the documentation and looked at the mkvtoolnix repo. I still didn’t understand it but suspected that I only need one resource, so I deleted all resources except the one I had already translated. Later I found that there is a CLI tool that can be used instead of GitHub Integration, so I tried it and after a while I could successfully pull my translation, GitHub Integration is now disabled.

I’m still very confused but seem to make progress. Is there a recommendation GitHub Integration versus CLI? I’ve more CLI than git experience, and mkvtoolnix also seem to use the CLI.

Using gettext the source file is probably the .pot file that is used to update the .po files, I don’t have this file on GitHub because mkvtoolnix also does not have it in the repo, I use mkvtoolnix as reference because the author has a lot of experience with gettext and programming in general, I use transifex because it’s used by mkvtoolnix.

Both integrations work well, but which one to choose depends on the flow of your project:

  • I would recommend Github in case your project is in a repository (this will allow for easy automation of push and pull activity for sources and translations, with the only manual step once translations are complete, they will do a merge of the pull request request)
  • I would recommend CLI in case you do not have a repository, if you work on your project locally, or if have a repo but for any reason cannot connect their repo with Transifex using our GitHub integration. In your case, It seems that you are unable to use the Github integration feature because there is no source file available in your repository. To explain, the GitHub integration feature works by searching for the source content in your repository, uploading it to our platform, and then sending the translations made in our platform back to your repository.

Let me know if the above helps or if you have any further questions.

- Sandy

Thanks for the explanation and support. I have everything working now and am very content with transifex.

1 Like