Skip to content

Support partial file translation via includeKeys in lara.yaml #46

@EmilianoMorghen

Description

@EmilianoMorghen

Currently, it is not possible to translate only a specific portion of a file. If a translation file contains multiple keys, the current lara.yaml configuration lacks the granularity to target just a subset of those keys for translation.

I propose adding an includeKeys property to the file configuration block in lara.yaml. This would allow developers to explicitly state which keys should be translated, while ignoring the rest of the file.

Example
Given the following source file:

{
  "first": "First",
  "second": "Second"
}

If I only want to translate the "second" key, the proposed lara.yaml configuration would look something like this:

version: "1.0.0"
project:
  instruction: "Project-wide translation instruction"
locales:
  source: en
  target:
    - es
    - fr
memories:
  - mem_abc123
glossaries:
  - gls_xyz789
files:
  json:
    include:
      - "src/i18n/[locale].json"
    exclude: []
    lockedKeys: []
    ignoredKeys: []
    includeKeys:
      - "second" # <-- Proposed feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions