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

Can't parse namespace from getFixedT usage #989

Open
pybuche opened this issue Mar 13, 2024 · 1 comment
Open

Can't parse namespace from getFixedT usage #989

pybuche opened this issue Mar 13, 2024 · 1 comment

Comments

@pybuche
Copy link

pybuche commented Mar 13, 2024

🐛 Bug Report

Looking at the documentation and different issues I found, especially this one (#703 (comment)), it seems that using i18n.getFixedT should help specify a single namespace for a whole file.

To Reproduce

I managed to craft a minimal reproduction repo here

Expected behavior

What I'm looking for behind this feature of getFixedT is to be able to specify a t function for a whole file, without repeating the namespace name at each function usage.

For instance, with a file defining lots of metadata for my app:

const t = i18n.getFixedT(null, "myFileNameSpace")

const DATA = [
   {
      name: t("item1.name"),
      description: t("item2.description"),
   },
   {
      name: t("item2.name"),
      description: t("item2.description"),
   },
]

I'd like the parser to extract a myFileNameSpace.json containing the keys specified. Instead, the keys are extracted in the default namespace.

Your Environment

  • runtime version: i.e. node v18, browser Chrome, latest version
  • i18next version: 23.10.1
  • i18next-parser version: 8.13.0
  • os: Mac
@GeorgEduard
Copy link

I'm having the same issue. It would be nice if we can get some info about this.

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

2 participants