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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number in context is ignored/not working #1622

Closed
pomali opened this issue Jun 17, 2021 · 3 comments
Closed

Number in context is ignored/not working #1622

pomali opened this issue Jun 17, 2021 · 3 comments

Comments

@pomali
Copy link

pomali commented Jun 17, 2021

馃悰 Bug Report

Using number as context is same as using empty/missing context.
It fails silently. I found no mention about this in docs, and is quite unexpected.

To Reproduce

https://codesandbox.io/s/determined-dream-2n583?file=/src/index.js

// init resources.translation:
{
      issueType: "issue",
      issueType_1: "bug"
}

...

[
      i18n.t("issueType"),                  // "issue"
      i18n.t("issueType", { context: 1 }),  // "issue"
      i18n.t("issueType", { context: "1" }) // "bug"
]

Expected behavior

Not being able to use numbers as context could be intended, but current behavior is not up with my expectations.

Sensible alternatives:

Your Environment

  • runtime version: Chrome 91
  • i18next version: 20.2.2,
  • os: Mac
@adrai adrai closed this as completed in d304941 Jun 17, 2021
@adrai
Copy link
Member

adrai commented Jun 17, 2021

never used context as number, but with v20.3.2 it works now ;-)

@pomali
Copy link
Author

pomali commented Jun 17, 2021

Wow, that was fast! Thanks :)

@adrai
Copy link
Member

adrai commented Jun 17, 2021

If you like this module don鈥檛 forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.

There are many ways to help this project 馃檹

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