-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force POSIX implementation for strings relative path output #622
Conversation
This is better but I think the I got it to work by doing something like this:
I don't know if that works on *nix. I don't have node installed on my VM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At line 205ish relative( process.cwd().split( sep ).join( '/' ), filename ) + ':' + path.node.loc.start.line. Should be used where sep is taken from the base path module so it will match either a Windows separator or a POSIX separator.
Given that the .pot file no longer exists in the repository after #614, why do we need to do this at all? |
Since we'll still need to generate strings, I think there's value in ensuring that the output is consistent across OS's (OSes? OSs? Grammar 😩 ). |
The only benefit will come from someone who wants to help develop, work on translations and happens to use Windows. |
Pretty sure the correct spelling is OS\es. |
@BE-Webdesign I've taken another stab at this. I found In my testing, there's still a minor issue where if the project is cloned in "My Documents", the filename passed from Babel starts with |
Ah, that is a great idea.
That is super edge-casey and I don't think warrants any fix really. You can also mess with your user path a lot on windows so I wouldn't worry about this. |
Thanks for taking a look @BE-Webdesign ! |
Fixes #597
This pull request seeks to ensure consistent output of the
languages/gutenberg.pot
file between Windows and Unix by forcing the relative path string references to use the POSIX implementation of Node'spath
module.Testing instructions:
npm run gettext-strings
languages/gutenberg.pot
/
slash, not\
@BE-Webdesign, would you mind taking this for a spin on Windows?
Note: As of #614, the
.pot
file is now ignored from the Git repository, so you shouldn't expect to see any changes reported bygit status
.