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

telegram 国际化问题 #286

Open
s749312025 opened this issue Jun 26, 2024 · 1 comment
Open

telegram 国际化问题 #286

s749312025 opened this issue Jun 26, 2024 · 1 comment

Comments

@s749312025
Copy link

const code = message?.from?.language_code
if (code) {
if (code === 'zh-hans') {
session.locales = ['zh-CN']
} else if (code === 'zh-hant') {
session.locales = ['zh-TW']
} else {
session.locales = [code.slice(0, 2)]
}
}

这里根据设备定义了session的locales字段,当我去设置user.locale 的值的时候,user.locale不会再起作用

@shigma
Copy link
Contributor

shigma commented Jul 16, 2024

嗯……目前 session.locale 优先级高于 user.local。可能需要调整一下优先级,或者使用 session.locale 初始化 user.locale。

可能需要修改 koishi 侧的逻辑。

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

No branches or pull requests

2 participants