How to get rid of untranslatable files in the pull request?

I am new to Crowdin and I try to use it for my Android project.

The configuration file looks like this:

files:
  - source: /app/src/main/res/values/
    translation: /app/src/main/res/values-%two_letters_code%/%original_file_name%
    translatable_elements:
      - /app/src/main/res/values/strings.xml
      - /app/src/main/res/values/preferences.xml

The content section configures two files preferences.xml and strings.xml:

image

When I look at the pull request every now and then files are added which I did not intentionally configure, e.g. styles_congress.xml, placeholder.xml. I deleted the relevant commits before but the files keep on reappearing.

How can I permanently exclude these files?

Translatable elements ->array of strings, not files.

This one refers to files

  • source: /app/src/main/res/values/

But that, all inside values and over it is taken into translation. Try specifying more strict path, like adding 2 paths or so:

  • source: /app/src/main/res/values/preferences.xml
  • source: /app/src/main/res/values/strings.xml

Thank you for the explanation. I was not aware that this was misconfigured.
I fixed this now.

Is there anything I need to do to the Crowdin (website) so it picks up the updated configuration?

Should be enough to pause integration, edit config, then force synch it

The GitHub configuration currently shows sync issues:

Even though I clicked Sync Now the issues are not resolved.

Since I can only post one image at a time.

Here is the master branch configuration:

I have not yet understood where the source of truth is. Is the configuration file (crowdin.yml) always read by the website? Is a change on the website written into the file? Does the website configuration (in the screenshots) reflect the content of the configuration file (if in sync)? What happens if click Delete Integration?

@tbsprs

Is the configuration file (crowdin.yml ) always read by the website → yes, after pausing and resuming an integration + force synchronization, or during next synchronization schedule. But keep in mind that in case of conflicts some changes may be not taken into account and displayed as Issue (if configuration via UI was totally different that via yaml file).

Is a change on the website written into the file? → no, only 1 way, they’re not combined.

Does the website configuration (in the screenshots) reflect the content of the configuration file (if in sync)? → if it written properly and have no conflicts with existing one, then yes. 99% sure there are missing a slash or comma or folder in the path, so no files are chosen.

What happens if click Delete Integration ? → You will need to set up it once more.

Here’s my advice, delete the current one because I’m sure it’s mixed up right now, delete crowdin.yaml file from repository you’re using, and move all content you have right in Crowdin com into some new folder/branch (create a new branch and just move all staff there).

Re set up the integration using pre-made configuration in crowdin.yaml (there should be a button “Load existing configuration file” during synch), or, what I prefere more, use the UI during first synch (it provides vizualization and you will see which files you add.

Hope it helped.

I tried my best with pausing and resuming the integration but since there is no clear error message nor resolution hint I was not able to resolve the issue. I also do not understand what to do with the File Filters entry shown in my screenshot.

I also tried deleting and recreating the configuration which led to a new commit on my master branch without my confirmation. It modified the crowdin.yml file. I would have expected a pull request instead.

I am kind of lost. Can someone guide me through this (maybe with screenshots) resolving this please? I have to mention that I did not initially set the project up. The person who did it is gone without notice.

@tbsprs

I also tried deleting and recreating the configuration which led to a new commit on my master branch without my confirmation. It modified the crowdin.yml file. I would have expected a pull request instead.

So the changed were taken into an account by system or not?

I also do not understand what to do with the File Filters entry shown in my screenshot.

It’s the same as Source path form .yaml file, just add a visualization of what you’ll have

How’s your configuration file looks right now?

Hello all,

@tbsprs I’ve provided your account with 1 additional project, which means that you can have 2 projects right now.

I would advise you to make a clone of that branch, or any other branch, create a fresh project and do some tests.

The logic of the GitHub connector is straightforward and I am sure that all that separates you from success is a few tests in a new test environment (project).

1 Like

@JoseMariaDeVeer Yes, the changes I made in the web interface were synced into my GitHub project. You can see it here on GitHub: EventFahrplan/EventFahrplan/commit/dc69440ab51687a221a6c960948c79bb9c3f612f.

@Dima Thank you for the test project. I tried setting up the configuration from scratch on a test branch named master-crowdin-test. It seems that the configuration in the crowdin.yml file in the repository which looks like this …

files:
  - source:
      - /app/src/main/res/values/strings.xml
      - /app/src/main/res/values/preferences.xml
    translation: /app/src/main/res/values-%two_letters_code%/%original_file_name%

… already has errors in how I defined sources.

I created a new configuration via the web interface by explicitly excluding files:

files:
  - source: /app/src/main/res/values/*.xml
    ignore:
      - attrs.xml
      - booleans.xml
      - colors.xml
      - dimens.xml
      - colors_congress.xml
      - integers.xml
      - placeholder.xml
      - styles_congress.xml
    translation: app/src/main/res/values-%two_letters_code%/%original_file_name%

Now the synchronization is “green”.

I was not able to write a rules with [set] or placeholders to specify only strings.xml and preferences.xml. Is there a easier way to configure a list of allowed files without specifying each files which should be ignored?

Maybe, DuuanVanVaagh knows?


Edit:

I found this simplification:

files:
  - source: /app/src/main/res/values/preferences.xml
    translation: app/src/main/res/values-%two_letters_code%/%original_file_name%
  - source: /app/src/main/res/values/strings.xml
    translation: app/src/main/res/values-%two_letters_code%/%original_file_name%

@tbsprs

UI configuration worked well because of having only 1 line source/translation.

If you wish to add 2 files only, you will need to have 2 separate source+translation paths, just as it is written in our documentation:

Alternatively, you can create a new folder that would contain those 2 files only (if your environment allows you to do so). In this case, specifying only that folder in the configuration would be enough:

  • source: /app/src/main/res/values/customfolder/*.xml
1 Like

The configuration looks good now \o/

Thank you for the explanation. I must say the documentation could be a bit more explicit for the example of a subset of files in the same folder.

Will Crowdin automatically update the pull request and delete the disallowed files which have been added earlier (see my initial post)? Or do I have to delete them from the branch myself?

If you’re about files that are stored in Crowdin, not in the GitHub, you’d better delete them manually.

I am referring to the untranslatable files which were added to this branch: See GitHub: EventFahrplan/EventFahrplan/pull/466/files (sorry, I am not allowed to post links here)

Delete all you don’t need, config anyway wouldn’t bring the file that you haven’t add into that config patterns.