I am currently developing a multi-language site using Zend Framework.

我目前正在使用Zend Framework开发一个多语言站点。

The system will pick a language for the user when he enters our site. If he doesn't like the language chosen by our system, he can choose another language.

系统将在用户进入我们的网站时为其选择一种语言。如果他不喜欢我们系统选择的语言,他可以选择另一种语言。

What is the best way to remember which language the user is chosen?

记住用户选择哪种语言的最佳方法是什么?

2 个解决方案

#1


As stated below; use sessions and cookies first then revert back to guessing the users preferred language. If the user has a login, store the information in the database attached to the user. A language Id maybe.

如下所述;首先使用会话和cookie然后再回到猜测用户首选语言。如果用户具有登录名,请将信息存储在附加到用户的数据库中。也许是一种语言。

Add language checking code that checks settings in this order:

添加按此顺序检查设置的语言检查代码:

user profile(DB) session cookies approximate

用户配置文件(DB)会话cookie近似

On manual change, update all levels e.g. db, session and cookies.

在手动更改时,更新所有级别,例如数据库,会话和cookie。

更多相关文章

  1. Pubsub与Node.js和Socket.io为个人用户
  2. 如何使用用户名作为子域名创建子域?
  3. PHP语言的中回车换行
  4. 设计多级用户权限系统
  5. 使用 PHP usort() 通过用户自定义的比较函数对数组进行排序
  6. 跟踪PHP中的登录用户
  7. WordPress注册和用户注册是分开的
  8. PHP联系表格给用户发送随机确认号码
  9. 仅在LARAVEL或AJAX中提交表单时,无需用户身份验证即可将文件上载

随机推荐

  1. 死磕18个Java8日期处理,工作必用!赶紧收藏
  2. 为你的网页添加深色模式[每日前端夜话0x4
  3. TypeScript 3.4 正式发布!
  4. Python数据可视化:浅谈数据挖掘岗
  5. Python数据可视化:网易云音乐歌单
  6. Python数据可视化:啥是佩奇
  7. 用Python自动化生成倒计时图片
  8. 一网打尽 JavaScript 的作用域[每日前端
  9. Python数据科学:线性回归
  10. 【学习】考完PMP后 继续学软考!