Skip to content

Fails to extract on Windows due to wrong path.sep used (2.4) #262

Closed
@MartijnHols

Description

@MartijnHols

Describe the bug
lingui extract returns No locales defined! when extracting messages on Windows.

To Reproduce
Run lingui extract on a Windows machine in cmd.

Additional context
The issue is that locale returned by

const [locale] = filename.split(path.sep).reverse()
contains the entire path, not just the locale name. This is because path.sep is \ while the result from glob.sync contains paths with forward slashes /. Replacing path.sep with / fixes this specific issue (but my extraction still fails because of a different error).

I would have made a PR if I didn't fear side-effects.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions