Skip to content
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

fetchLocale should use relative URL #258

Open
monitz87 opened this issue Apr 6, 2017 · 2 comments
Open

fetchLocale should use relative URL #258

monitz87 opened this issue Apr 6, 2017 · 2 comments

Comments

@monitz87
Copy link

monitz87 commented Apr 6, 2017

There is a function called fetchLocale in packages/core/lib/msgfmt-client.js that creates a script from which I assume all the strings are read and loaded into the msgfmt object. That script's url is generated with Meteor.absoluteUrl, which is fine for production, but creates problems when working locally.

For instance, I'm trying to test my app on my iPhone, by connecting to my computer's IP address (where the app is running). Since the server is running on my computer, the script's url is http://localhost:3000/msgfmt/locale/all/0, so when my phone tries to fetch it, it finds nothing and so no strings are found. Maybe using a relative path is the way to go.

Cheers

@gadicc
Copy link
Owner

gadicc commented May 2, 2017

Hi @monitz87, sorry for the late reply. You should set your ROOT_URL environment variable to reflect your computer's network IP address. I think that's preferable to adding code to msgfmt that behaves differently in development, and will also solve similar issues you might have with other packages in the future.

@monitz87
Copy link
Author

monitz87 commented May 2, 2017

Thanks, I will try that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants