Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): support updating group and array fields on CrowdIn #8

Merged
merged 6 commits into from
May 28, 2023

Conversation

thompsonsj
Copy link
Owner

Apply recursion to send source translations to CrowdIn for group and array fields, regardless of how deep they appear in the document.

Details

Text fields

All fields with a type of text that either:

  • appear at the top-level; or
  • are included in group or array fields;

are compiled into a single JSON file respecting the structure in which they appear in the document JSON.

Example:

{
    "simpleLocalizedField": "Hi there! I'm a simple field.",
    "groupField": {
        "title": "Group title field content"
    },
    "arrayField": [
        {
            "title": "Array field title content two"
        },
        {
            "title": "Array field title content one"
        }
    ],
    "testimonials": {},
    "meta": {
        "title": "Test global SEO title"
    }
}

Rich text fields

Fields with a type of richText are:

  • converted to HTML; and
  • sent to CrowdIn with in their own file.

These files are named using dot notation. For example:

  • localizedRichTextField.html
  • groupField.localizedRichTextField.html
  • arrayField[0].localizedRichTextField.html
  • arrayField[1].localizedRichTextField.html

@thompsonsj thompsonsj merged commit 2401499 into main May 28, 2023
@thompsonsj thompsonsj mentioned this pull request Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant