Skip to content

tolgee pull CLI command with JSON_TOLGEE setup gives nested format rather than flattned key/value #167

@schang124

Description

@schang124

I want my pulled i18n json files to have flatten key/value pair, but when I pull it from the cloud, it returns nested key.
Could you investigate this issue and give an option to have flatten key?

Here is my settings:

// package.json
"tolgee:pull": "pnpm tolgee pull"
// .tolgeerc
{
  "$schema": "https://docs.tolgee.io/cli-schema.json",
  "projectId": 12745,
  "format": "JSON_TOLGEE",
  "patterns": [
    "./src/**/*.ts?(x)"
  ],
  "push": {
    "files": [
      {
        "path": "./src/i18n/en.json",
        "language": "en"
      },
      {
        "path": "./src/i18n/ko.json",
        "language": "ko"
      }
    ],
    "forceMode": "OVERRIDE"
  },
  "pull": {
    "path": "./src/i18n"
  }
}

Results

// expected
{
  "a.b.c": "test text"
}

// actual result
{
  "a": {
    "b": {
      "c": "test text"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions