i18next/i18next-parser

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

olikami opened this issue ยท 0 comments

๐Ÿ› 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