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

Include translator comments from parent nodes in en.json5 instead of just terminal nodes #4565

Open
sarayourfriend opened this issue Jun 27, 2024 · 0 comments
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: mgmt Related to repo management and automations

Comments

@sarayourfriend
Copy link
Collaborator

Problem

Given the following en.json5 fragment, the intended translator comments do not appear in the .pot:

{
    homepage: {
        /** homepage.content.a-b are used to describe blah blah blah */
        content: {
            a: "",
            b: "",
        },
    },
}

Instead, it's necessary to move the comment on content to each of homepage.content.a and .b, which means duplicating this information. This can be quite tedious to maintain, especially when details about a string change. The repeated comments also make the file harder to read (and it's already pretty bad in that regard, being just a huge blob of json!).

Description

We should include comments from parent nodes when pulling the comments for each Entry in json-to-pot. Currently, it only retrieves the comment from the current Entry node (which is always a terminal one in getComment). It should walk up the tree of entry.parent... until !parent and include each comment.

Additional context

Noticed during #4549.

@sarayourfriend sarayourfriend added 🟩 priority: low Low priority and doesn't need to be rushed 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: mgmt Related to repo management and automations labels Jun 27, 2024
@openverse-bot openverse-bot moved this to 📋 Backlog in Openverse Backlog Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: mgmt Related to repo management and automations
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant