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

[Fix] Fix typo errors #1703

Merged
merged 1 commit into from Jun 18, 2018
Merged

[Fix] Fix typo errors #1703

merged 1 commit into from Jun 18, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 16, 2018

[Senario]
Someone is now accessing the home page with a root path / ( Such as https://nodejs.org/):

The current is now guiding you to an English page.

Now I guide you to a page where you like according to your local system language from accept-language, which looks better and more friendly.

[Notices]
Please run npm i to install a 3-rd party accept-language before you run or deploy this.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lpinca
Copy link
Member

lpinca commented Jun 17, 2018

This would not work in production as the server is only used for development. Not sure how useful this feature is for development.

@ghost
Copy link
Author

ghost commented Jun 18, 2018

@lpinca
I had a test before submitting here, and everything goes fine with me.

For FF and Chrome, it can read out accept-language and guide me where I actually want to go.
For IE, some IEs cannot pre-set the accept-Language so the default is still English.

All in all, I only check when you are accessing the root without a default language, it will try to fetch your pre-set lang from the browser (Maybe according to your localization system) and guide you to a correct website of a lang. Because I didn't change any rules but just attach dynamically lang to the root

E.g:
If you are accessing——https://nodejs.org/ => It will guide to https://nodejs.org/lang , if some lang is checked.

And This would not work in production as the server is only used for development. What does this mean? Have u got any special things on your server? So have you got any suggestions or ideas?
Is it possible to make the same function on the deployment?

Thanks anyway!

@fhemberger
Copy link
Contributor

@Maledong Files in production are served pre-gzipped through nginx (using npm run deploy) for performance reasons. Config can be found here: https://github.com/nodejs/build/blob/master/setup/www/resources/config/nodejs.org

We already had a discussion about this in: #806 (comment) (and even in the io.js days: nodejs/iojs.org#235)

Unfortunately, there's only a 3rd party module for nginx. So this has to be addressed by the @nodejs/build team.

@ghost ghost changed the title [New Feature Request] Auto-Detect Language when request is ONLY a / [Fix] Fix typo errors Jun 18, 2018
@ghost
Copy link
Author

ghost commented Jun 18, 2018

Well thanks all!

I changed my commit to fix a typo error instead. Language will be discussed with all of you later after I read your discussion first.

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

Successfully merging this pull request may close these issues.

5 participants