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

feat: Always redirect to language that was saved in cookie #283

Merged
merged 1 commit into from
May 5, 2019
Merged

feat: Always redirect to language that was saved in cookie #283

merged 1 commit into from
May 5, 2019

Commits on Apr 28, 2019

  1. Always redirect to browser's language that was saved in cookie

    Make sure that after first visit, when we detect browser language and
    store locale cookie, we reuse that cookie and re-set language during
    navigation. Before this change, even with `alwaysRedirect` enabled, we
    have only redirected on first visit and on next visits user got default
    language again.
    
    Changes:
      - Don't base ability to set client-side cookies on the `isSpa` flag.
        That flag signified whether app was in 'spa' mode (another possible
        mode is 'universal') and it only allowed setting client-side cookies
        in that mode. That's wrong as it should also be possible to set
        client-side cookies when running on client side in 'universal' mode.
        Use `process.client` and `process.server` instead, which are more
        appropriate flags to check for that purpose.
      - Expose setLocaleCookie on `app.i18n` (`this.$i18n` in components)
        as we need to be able to call it manually after changing locale
        in custom language selector.
    rchl committed Apr 28, 2019
    Configuration menu
    Copy the full SHA
    eaad725 View commit details
    Browse the repository at this point in the history