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

Doesn't parse files that have [] in the path (e.g., Next.js app directory with [lang] #880

Open
olikami opened this issue Aug 9, 2023 · 0 comments

Comments

@olikami
Copy link

olikami commented Aug 9, 2023

馃悰 Bug Report

Files that are in folders with brackets around them (such as my [lang] folder) do not get parsed. This is especially problematic as this breaks when using the recommend approach for Next.js with the app folder.

To Reproduce

Try to parse any folders that contain [] in them. They will be visible in the Input (with verbose: true) but will not get parsed.

$ i18next {lib,app}/**/*.{ts,tsx}

  i18next Parser
  --------------
  Input:  lib/location/locations.ts, lib/block/block.tsx, lib/location/fancyLocation.tsx, app/i18n/index.ts, app/i18n/settings.ts, app/[lang]/aboutMeBlock/aboutMeBlock.tsx, app/[lang]/experienceBlock/experienceBlock.tsx, app/[lang]/informationBlock/informationBlock.tsx, app/[lang]/languagesBlock/languagesBlock.tsx, app/[lang]/languagesBlock/skillIndicator.tsx, app/[lang]/layout.tsx, app/[lang]/page.tsx, app/[lang]/skillsBlock/skillsBlock.tsx, app/[lang]/userBlock/userBlock.tsx
  Output: app/locales/$LOCALE/$NAMESPACE.json

  [read]    <redacted>/app/i18n/index.ts
Parsing <redacted>/app/i18n/index.ts
  [read]    <redacted>/app/i18n/settings.ts
Parsing <redacted>/app/i18n/settings.ts
  [read]    <redacted>/lib/block/block.tsx
Parsing <redacted>/lib/block/block.tsx
  [read]    <redacted>/lib/location/fancyLocation.tsx
Parsing <redacted>/lib/location/fancyLocation.tsx
  [read]    <redacted>/lib/location/locations.ts
Parsing <redacted>/lib/location/locations.ts

  Stats:  5 files were parsed
oli@olis-laptop oli.cv % 

Expected behavior

I expect all my files to be parsed, and the keys extracted.

Your Environment

  • runtime version: nodev20
  • i18next version: 23.4.4
  • os: Mac
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

1 participant