Giter VIP home page Giter VIP logo

Comments (4)

wuyechang avatar wuyechang commented on September 24, 2024 1

重新调用一遍init(options)方法就行了吧

from react-intl-universal.

Gpia avatar Gpia commented on September 24, 2024

我使用了切换语言,将语言记录在cookie中,然后刷新页面的方式。每次页面加载会从cookie读取,然后初始化一次。也就是切换语言必然刷新页面,这样也能避免很多问题,如动态切换后,当前的所有组件需要触发一次重绘,会有多余的业务代码。反而刷新页面是最简单有效的一种方式。

from react-intl-universal.

wuzinong avatar wuzinong commented on September 24, 2024

@wuyechang 您好,我试了下init方法,是可以切换语言,但是当前页面的语言不会改变,要切到别的页面在切回来才有效果,我是在router里面做的,请问有什么好的方法吗?谢谢

from react-intl-universal.

cwtuan avatar cwtuan commented on September 24, 2024

@wuzinong forceUpdate after locale changed

from react-intl-universal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.