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

fix: tray translation waits for i18n init #2604

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

SgtPooki
Copy link
Member

The lazy-loading ctx feature didn't catch that i18n wasn't being init before tray translations were attempted.

That means the tray-menu-item translations were occurring prior to loading the
translation files, which defaults the translated result to the given key.

This PR resolves that problem.

fixes #2595

@SgtPooki SgtPooki linked an issue Aug 29, 2023 that may be closed by this pull request
@SgtPooki SgtPooki requested a review from a team as a code owner August 29, 2023 20:58
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

Copy link
Contributor

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validated the fix works locally.

src/context.js Outdated Show resolved Hide resolved
src/i18n.js Outdated
@@ -26,6 +28,7 @@ module.exports = async function () {
}
})
logger.info('[i18n] init done')
ctx.setProp('i18n_init_done', true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would the context bloat too much if i18n instance is assigned to the context instead of just a boolean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that, and I don't think it's necessary to store it in mem since we just need awareness of when the init is done

@SgtPooki SgtPooki merged commit fd4857f into main Aug 29, 2023
7 checks passed
@SgtPooki SgtPooki deleted the 2595-bug-tray-menu-labels-are-not-translated branch August 29, 2023 21:54
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.

bug: tray-menu labels are not translated
2 participants