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

Switch language on the front end #189

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

laijinhang
Copy link
Contributor

@laijinhang laijinhang commented Mar 13, 2020

代码变更说明:前端页面可以设置语言模块

已实现

  1. 每个用户可以设置自己想要的展示语言,如果未设置,则使用默认的语言
  2. 后端提供了设置页面语言的POST接口
  3. 提供写入sql的扩展的地方,如果需要将用户设置的展示语言存储到SQL中,直接加sql语句代码就行,不需要改其他代码

关于实现

  1. 因为这个是后端管理,所以登录的用户不会太多,我是考虑将 登录用户的配置信息存储到切片里,会比存放到map中加锁操作的效率更高点
  2. 如果用户没有设置语言,则使用默认启动时的语言
  3. 目前实现是将用户语言配置信息存到内存中,因为考虑存sql,需要改表,影响的内容比较大,所以未存储到sql中,只要不重启服务,之前设置都一直有效,如果后面需要将数据写入到sql的话,只要加sql语句就好了

@laijinhang laijinhang changed the title Switch language on the front end, implement the back end code Switch language on the front end Mar 14, 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.

1 participant