nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

issue with uk site

Open ColinMoulds opened this issue 7 years ago • 8 comments

i wasn't sure what nodejs/ to use but https://nodejs.org/uk/ is in russian for no apparent reason!

ColinMoulds avatar Feb 13 '19 10:02 ColinMoulds

@ColinMoulds 'uk' = Ukranian 😂

fhemberger avatar Feb 13 '19 10:02 fhemberger

@fhemberger its the site i get redirected to both here and in sweden lol

ColinMoulds avatar Feb 13 '19 11:02 ColinMoulds

Strange, what browser are your using and what are your language settings? British English should be en_GB, so I don't know why it would redirect to uk.

(In the meantime, https://nodejs.org/en/ should help 😉)

/cc @nodejs/build

fhemberger avatar Feb 13 '19 11:02 fhemberger

@ColinMoulds:You can use Google chrome to have a play, and everything seems fine with me :)

ghost avatar Feb 14 '19 08:02 ghost

IIUC this is the magic souse:

    location / {
        rewrite ^/$ /en/ redirect;

        try_files $uri $uri/ @english_fallback;

        location ~ \.json$ {
            add_header access-control-allow-origin *;
        }
    }

    # instead of serving a 404 page when a page hasn't been translated
    location @english_fallback {
        if ($uri ~* ^/(ar|ca|de|es|fa|fr|gl|it|ja|ko|pt-br|uk|zh-cn|zh-tw)/) {
            set $lang $1;
        }
        rewrite ^/(ar|ca|de|es|fa|fr|gl|it|ja|ko|pt-br|uk|zh-cn|zh-tw)/(.*)$ /en/$2;
    }

tl;dr default to /en/ and fall back to /en/ in case translated file does not exist 🤷‍♂️

refack avatar Feb 14 '19 12:02 refack

I was using Mozilla Firefox Nightly

ColinMoulds avatar Feb 16 '19 19:02 ColinMoulds

@ColinMoulds:What about using the latest stable version of FF?Is it still happening?

ghost avatar Apr 13 '19 05:04 ghost

Should be closed

alexandrtovmach avatar Jul 01 '19 07:07 alexandrtovmach