Skip to content

[Tooling] Generate translation reference JSON during build #6143

@macandcheese

Description

@macandcheese

Summary

The documentation site uses the docs-json.json file in the extras folder of our distributable to format and display docs to users. We would benefit from having a similar output for the updated translation files.

docs-json.json includes each file's messageOverride string names, but not the default values, which would be valuable to show in documentation. It would be great if these were included as well.

Alternatively, and maybe easier than fighting jsdoc, we could generate our own translations-json.json at build time, since the files seem to be in a predictable location and format: (/dist/assets/<component>/t9n).

Desired Outcome

Something like this, but any format works as long as the default are available somehow.

{
    "components": {
        "calcite-action": {
            "loading": {
                "en": "Close",
                "es": "Cerrar"
                ...
            },
            "disabled": {
                "en": "Close",
                "es": "Cerrar"
                ...
            }
        },
        "calcite-alert": {
            "loading": {
                "en": "Close",
                "es": "Cerrar"
                ...
            },
            "disabled": {
                "en": "Close",
                "es": "Cerrar"
                ...
            }
        }
    }
}

Resources

No response

Metadata

Metadata

Assignees

Labels

4 - verifiedIssues that have been tested, confirmed as mitigated, and are ready to close.estimate - 3A day or two of work, likely requires updates to tests.p - lowIssue is non core or affecting less that 10% of people using the librarytoolingIssues relating to build system fixes or improvements.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions