hyperf / hyperf/translation

最新的hyperf3.1中使用setLocale仅第一次被正确设置上下文

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Description

`
setlocale( LC_ALL,'zh_CN');
`
在跟踪这个方法的使用上 发现仅第一次成功设置了上下文语言,后面就都是默认语言了,不知道是不是接口原因
参考在中间件中手动设置上下文的默认语言 替代 setlocale 可用
`Context::set($this->getLocaleContextKey(), $locale);`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.