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

Vue sample app - set i18n initial language based on SSR language or s… #337

Merged

Conversation

kbauer-hhog
Copy link
Contributor

Description

Vue sample - Set i18n initial language based on SSR language or static config defaultLanguage to prevent re-renders in multi-lingual apps during the hydration process. (Same fix as #330, but for Vue sample app)

Motivation

To fix the flicker after initial page load issue when using the Vue sample.

How Has This Been Tested?

I have tested local Sitecore 9.3 instance with a JSS 13.0 site and debug via chrome dev tools.
My change simply initializes the language for i18ninit by pulling the SSR language from JSS_STATE, or using the config defaultLanguage setting.
The comments in code seem to support this, but I feel this could be introduced to prevent others from experiencing this issue OOTB.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the Contributing guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.

…tatic config defaultLanguage to prevent re-renders in multi-lingual apps
@sc-illiakovalenko sc-illiakovalenko merged commit 66b181d into Sitecore:dev Mar 13, 2020
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.

3 participants