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

Missing type definitions for original i18next properties #37

Open
scrlkx opened this issue Sep 24, 2024 · 4 comments
Open

Missing type definitions for original i18next properties #37

scrlkx opened this issue Sep 24, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@scrlkx
Copy link

scrlkx commented Sep 24, 2024

Hey!

Please, take a look into the config bellow.

import i18n from "@astrolicious/i18n";

i18n({
  ns: [
    "common",
    "home",
    "hero",
    "how-we-work",
    "our-clients",
    "services",
    "cases",
    "who-we-are",
    "careers",
    "blog",
    "contact",
    "footer",
    "404",
    "500",
  ],
  defaultNamespace: "common",
  locales: ["en", "es"],
  defaultLocale: "en",
  strategy: "prefix",
  rootRedirect: {
    status: 301,
    destination: "en",
  },
})

If you try to use it on astro.config.mjs you should have no problem, but if you try it to move it into a TypeScript file it will complain that the ns property doesn't exist.

Maybe we should inherit the original properties from i18next? Is there any workaround I can use to trick it to have all the original properties?

@florian-lefebvre
Copy link
Member

Can you provide a minimal reproduction?

@florian-lefebvre florian-lefebvre added the question Further information is requested label Sep 25, 2024
@scrlkx
Copy link
Author

scrlkx commented Sep 27, 2024

Sure, take a look at scrlkx/flaky-field. However, I just notice I don't really have to define any namespaces, your package (I believe) will automatically map them for me. If that's correct, maybe we should mention it somewhere in the docs?

@florian-lefebvre
Copy link
Member

Indeed! It's not an bug but rather a docs issue. They could be clarified at https://astro-i18n.netlify.app/usage/translations/, wanna submit a PR?

@florian-lefebvre florian-lefebvre added documentation Improvements or additions to documentation and removed question Further information is requested labels Sep 30, 2024
@scrlkx
Copy link
Author

scrlkx commented Oct 3, 2024

I'll take a look as soon as I have some time available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants