Splitting a source file with existing translations

I have a source file that has existing translations managed by the GitLab integration which needs to be split up.

Example:

Source file:

en/foo.json

{
  "label": "example",
  "entries": {
    "one": {
      "name": "one",
      "description": "one description"
    },
    "two": {
      "name": "two",
      "description": "two description"
    },
    "three": {
      "name": "three",
      "description": "three description"
    }
}

This needs to then be split into three files.

en/foo_one.json

{
  "label": "example1",
  "entries": {
    "one": {
      "name": "one",
      "description": "one description"
    }
}

en/foo_two.json

{
  "label": "example2",
  "entries": {
    "two": {
      "name": "two",
      "description": "two description"
    }
}

en/foo_three

{
  "label": "example3",
  "entries": {
    "three": {
      "name": "three",
      "description": "three description"
    }
}

The requirement here is that we split this file out without losing any of the translations. All the keys/values will remain with the same name ({"three": "name": "three", "description", "three description" etc.) in the split out files with only the label field changing once split out.

My initial thought was:

  1. Stop Gitlab Integration
  2. Split the source file as needed into separate files
  3. Split each output/language file
  4. Re-enable Gitlab integration

Will Crowdin be smart enough to understand this change and handle it gracefully?

Another thought was:

  1. Stop Gitlab integration
  2. Split the source file as needed into separate files
  3. Delete old output/language files
  4. Re-enable Gitlab integration

Will Crowdin keep the translations from foo.json and keep the translations across the split files (foo_one.json etc.)?

Or is there a “blessed” way of doing this I’m not aware of?

Our config if helpful:

base_path: .
base_url: "https://api.crowdin.com"
pull_request_title: Localization update
pull_request_labels:
  - Localization
commit_message: "[ci skip]"
preserve_hierarchy: true
files:
  - source: /src/babele/en/*.json
    translation: /src/babele/%locale%/%original_file_name%
    type: json
    translation_replace:
      _: "-"

Hi!

If you want to separate one file into three ones, we’d suggest deleting the source file from Crowdin > then have these 3 files in your GitLab repository > sync it to Crowdin. If translations won’t appear in Crowdin, you’re welcome to do the pre-translation via TM:

Hi Natalia, thanks for the quick response!

Apologies in advance as I am a Crowdin noob so want to make sure I have the order of operations as I don’t want to accidentally blast the project’s volunteer translators hard work!

If I’m understanding correctly all projects have a TM by default so I don’t need to create a new one.

For clarity I’m also dealing with some file renames at the same time so I’ll include those steps just for completeness!

Also these changes are currently on a feature branch in git which will be merged into the Crowdin tracked branch.

Which means I think I should follow the below process:

  1. Stop Gitlab integration
  2. Merge feature branch into master
  3. Rename files that need renaming in the Crowdin UI
  4. Delete the file that is to be split in the Crowdin UI
  5. Re-enable Gitlab Integration
  6. Sync with Gitlab
  7. Follow the steps to load the translations from TM (link you provided)

Is that correct?