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: 修复在单页面应用中编辑器无法切换语言 #1100

Closed
wants to merge 1 commit into from
Closed

fix: 修复在单页面应用中编辑器无法切换语言 #1100

wants to merge 1 commit into from

Conversation

myml
Copy link
Contributor

@myml myml commented Oct 21, 2021

编辑器缓存i18n脚本时未考虑多语言切换
通过给缓存key加上语言的后缀解决

@Vanessa219
Copy link
Owner

这样的话,从 A 切换到 B,再切换到 A 可能会有问题吧?

@myml
Copy link
Contributor Author

myml commented Oct 23, 2021

这样的话,从 A 切换到 B,再切换到 A 可能会有问题吧?

来回切换过几次,粗略测试没发现问题,因为是全局切换,不会同时用多个语言,我有时间再看下源码没有全局冲突的地方

@Vanessa219
Copy link
Owner

再次切换到 A 的时候 js 也不会加载,所以可能还是 B。幸苦亲了。

编辑器缓存i18n脚本时未考虑多语言切换
通过给缓存key加上语言的后缀解决
@myml
Copy link
Contributor Author

myml commented Oct 25, 2021

@Vanessa219 嗨,从 A 切换到 B,再切换到 A确实存在问题,因为切换到B后,A的脚本还存在head中,再切换A不会重复执行加载A的脚本,全局的i18n变量却已经被B替换,我修改了提交,在切换语言时清除其他语言的脚本,在#1103 中进行了测试,麻烦进行review。

@Vanessa219
Copy link
Owner

好的,那我就先把这个关闭了,用 #1103 总的进行合并

@Vanessa219 Vanessa219 closed this Nov 1, 2021
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.

2 participants