修改thinkphp6获取当前语言机制
muke
每日精进
muke
2022-05-27 15:45:22
909
{{single.collect_count}}

在vendor\topthink\framework\src\think\Lang.php中修改detect()的代码

/**
     * 自动侦测设置获取语言选择
     * @access public
     * @param Request $request
     * @return string
     */
    public function detect(Request $request): string
    {
        $this->range = $request->lang ? $request->lang : $this->config['default_lang'];
        return $this->range;
    }

 

 

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}