存储用户所需语言的最佳方式
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。
更多相关文章
- Pubsub与Node.js和Socket.io为个人用户
- 如何使用用户名作为子域名创建子域?
- PHP语言的中回车换行
- 设计多级用户权限系统
- 使用 PHP usort() 通过用户自定义的比较函数对数组进行排序
- 跟踪PHP中的登录用户
- WordPress注册和用户注册是分开的
- PHP联系表格给用户发送随机确认号码
- 仅在LARAVEL或AJAX中提交表单时,无需用户身份验证即可将文件上载