You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Importing a catalog that has parentheses in the pathname throws the following error in the Vite integration:
Error: Requested resource <pathname_with_parentheses> is not matched to any of your catalogs paths specified in "lingui.config".
To Reproduce
await import("./(foo).catalog.po")
Minimal reproduction in a Remix.run app (using the unstable Vite integration): repl
Expected behavior
The catalog should be recognized correctly regardless of special characters and imported successfully.
Additional context
Why do I care about parentheses in pathnames? I would like to generate a separate catalog for each route, so that each of them can load their own translations with minimal network overhead. However, Remix uses parentheses in pathnames for defining optional parameters, causing the imports to fail.
Finally, I'd like to thank the authors for creating the sexiest I18N solution there is. Thank you.
The text was updated successfully, but these errors were encountered:
jozefmery
changed the title
[Vite] Parenthesis in the catalog pathname break the loader
[Vite] Parentheses in the catalog pathname break the loader
Dec 14, 2023
jozefmery
changed the title
[Vite] Parentheses in the catalog pathname break the loader
[Vite] Parentheses in catalog pathnames causes them to be unrecognized
Dec 14, 2023
Fixing this issue may be as simple as escaping the parentheses so they are not interpreted as RegEx capture groups. If I can, I'll try to cook up a PR.
Describe the bug
Importing a catalog that has
parentheses
in the pathname throws the following error in the Vite integration:Error: Requested resource <pathname_with_parentheses> is not matched to any of your catalogs paths specified in "lingui.config".
To Reproduce
await import("./(foo).catalog.po")
Minimal reproduction in a Remix.run app (using the unstable Vite integration): repl
Expected behavior
The catalog should be recognized correctly regardless of special characters and imported successfully.
Additional context
Why do I care about parentheses in pathnames? I would like to generate a separate catalog for each route, so that each of them can load their own translations with minimal network overhead. However, Remix uses parentheses in pathnames for defining optional parameters, causing the imports to fail.
Finally, I'd like to thank the authors for creating the sexiest I18N solution there is. Thank you.
The text was updated successfully, but these errors were encountered: