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

[Tooling] Generate translation reference JSON during build #6143

Closed
macandcheese opened this issue Dec 21, 2022 · 7 comments
Closed

[Tooling] Generate translation reference JSON during build #6143

macandcheese opened this issue Dec 21, 2022 · 7 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. estimate - 3 A day or two of work, likely requires updates to tests. p - low Issue is non core or affecting less that 10% of people using the library tooling Issues relating to build system fixes or improvements.

Comments

@macandcheese
Copy link
Contributor

macandcheese commented Dec 21, 2022

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

@macandcheese macandcheese added tooling Issues relating to build system fixes or improvements. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Dec 21, 2022
@jcfranco
Copy link
Member

@macandcheese I think we could generate something for this quite easily. What's the desired timeline for this?

@macandcheese
Copy link
Contributor Author

As soon as reasonable without a rush - not high priority.

Whenever it is available I can add it into documentation site. Currently we only show the English string.

@benelan
Copy link
Member

benelan commented Jan 26, 2023

Yeah I can whip something up after the patch period and other v1 stuff quiets down

@benelan benelan added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jan 26, 2023
@benelan benelan self-assigned this Jan 26, 2023
@brittneytewks brittneytewks added p - low Issue is non core or affecting less that 10% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. labels Mar 21, 2023
@jcfranco
Copy link
Member

@benelan Were you able to whip something up for this? We modified the milestone, but can move it sooner if it's feasible.

@benelan
Copy link
Member

benelan commented Mar 23, 2023

I haven't gotten to this yet, there are some higher priority items on my plate

@benelan benelan added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jun 20, 2023
benelan added a commit that referenced this issue Jun 25, 2023
**Related Issue:** #6143

## Summary

Generates `dist/extras/translations-json.json` which contains the t9n
values per component in the following format:

```jsonc
{
    "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"
                // ...
            }
        }
    }
}
```
@benelan benelan added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jun 25, 2023
@github-actions github-actions bot assigned geospatialem and unassigned benelan Jun 25, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jun 27, 2023
@geospatialem
Copy link
Member

Verified with 1.4.3 in the calcite-components-examples repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. estimate - 3 A day or two of work, likely requires updates to tests. p - low Issue is non core or affecting less that 10% of people using the library tooling Issues relating to build system fixes or improvements.
Projects
None yet
Development

No branches or pull requests

6 participants