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

iw is missing from the PluralResolver, thus i18next-parse crashes #1494

Closed
kristian-puccio opened this issue Jul 24, 2020 · 6 comments
Closed

Comments

@kristian-puccio
Copy link

馃悰 Bug Report

The locale code iw is missing from the PluralResolver file.
So when you use i18next-parse to extract locales in that language it throws with the error
Cannot read property 'numbers' of undefined

To Reproduce

export function extractTranslations(locales: Array<string>) {
  const srcPath = 'src/**/*.{ts,tsx,js,jsx}';
  gulp
    .src(srcPath)
    .pipe(
      new i18nextParser({
        locales: ['en', 'iw'],
        lowerCaseLng: true,
        output: path.resolve(process.cwd(), 'localisation/$LOCALE/lang.json'),
      })
    )
    .pipe(gulp.dest(process.cwd()));
}

Expected behavior

iw should work when using i18next-parse.

Your Environment

  • runtime version: i.e. node v14
  • i18next version: i.e. 19.6.2
    "i18next-parser": "2.1.2",
  • os: Mac
@adrai
Copy link
Member

adrai commented Jul 24, 2020

Is iw = he (hebrew)?

@kristian-puccio
Copy link
Author

Yeah correct

@adrai adrai closed this as completed in 40c4ec8 Jul 24, 2020
@adrai
Copy link
Member

adrai commented Jul 24, 2020

Will be deployed with the next version...hope that is ok for you?

If needing it now, you can just use he or you can add rules using i18next.services.pluralResolver.addRule meanwhile...https://github.com/i18next/i18next/blob/master/src/PluralResolver.js#L90

@kristian-puccio
Copy link
Author

Legend thanks!

@adrai
Copy link
Member

adrai commented Jul 24, 2020

released with v19.6.3

@adrai
Copy link
Member

adrai commented Jul 24, 2020

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