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

How to use translations outside of React scope #3424

Open
Nik96i opened this issue Feb 1, 2025 · 2 comments
Open

How to use translations outside of React scope #3424

Nik96i opened this issue Feb 1, 2025 · 2 comments
Assignees

Comments

@Nik96i
Copy link

Nik96i commented Feb 1, 2025

Hi.
I created a Tolgee instance and export it like this:

export const tolgee = Tolgee()
  .use(DevTools())
  .use(FormatSimple())
  .init({
    availableLanguages: Object.keys(supportedLocales),
    ...
  });

When using this instance (tolgee.t()) outside of React scope, it doesn't load translations in non-default namespaces.
Is there a way to use lazy-loading of namespaces outside of React ? thanks.

@JanCizmar
Copy link
Contributor

Hello! This issue has to be transferred to tolgee-js repository. Transferring!

@JanCizmar JanCizmar transferred this issue from tolgee/tolgee-platform Feb 3, 2025
@stepan662
Copy link
Collaborator

Hey, you can use addActiveNs and await it.
https://docs.tolgee.io/js-sdk/api/core_package/tolgee#addactivens

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

No branches or pull requests

3 participants