Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Fix missing i18n path configuration #3

Merged
merged 2 commits into from
Jun 28, 2018
Merged

Fix missing i18n path configuration #3

merged 2 commits into from
Jun 28, 2018

Conversation

Tenchi2xh
Copy link
Contributor

No description provided.

@mdvanes
Copy link
Member

mdvanes commented Jun 28, 2018

I don't think this will work, because the environmental variable will exist server side and this code is client side. Instead, it would have to be replaced in the build step.

@Tenchi2xh
Copy link
Contributor Author

Didn't think about that, so I looked into it, apparently it could work.

This says that the static %PUBLIC_URL% are substituted even client-side, and then say that process.env.PUBLIC_URL acts the same for the JS side.

I still wasn't convinced by that but then I read this comment on an issue:

Thanks. It's a bit surprising that what looks like a node.js process environment variable is available on the client.

It's a very common practice called "envifying".

What does 'process.env' represent, logically? A snapshot of what the node.js process environment was when webpack ran?

Yes.

Apparently, it will capture this:

  "homepage": "http://www.codestar.nl/codestar-website-react"

from our package.json as that PUBLIC_URL variable.

Should we try?

@mdvanes
Copy link
Member

mdvanes commented Jun 28, 2018

Ah ok, it works because of magic. Sure lets merge it in.

@Tenchi2xh Tenchi2xh merged commit 5eb1a06 into develop Jun 28, 2018
@Tenchi2xh Tenchi2xh deleted the fix/i18n-path branch June 28, 2018 12:38
@Tenchi2xh
Copy link
Contributor Author

It worked :)

mts added a commit that referenced this pull request Oct 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants