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

弱耦合格式的i18n字符串 #1509

Open
OasisAkari opened this issue Dec 25, 2024 · 2 comments
Open

弱耦合格式的i18n字符串 #1509

OasisAkari opened this issue Dec 25, 2024 · 2 comments

Comments

@OasisAkari
Copy link
Member

OasisAkari commented Dec 25, 2024

现在提出来是不是有点晚了.webp

大概想法如下:

<i18n:i18nkey|k1=v1,k2=v2}>

主要用于解决进行模块i18n时必须要导入MessageSession参数,导致可移植性降低的问题

此类模板字符串应在最后发送时才进行语言转换,使用特定工具函数提取参数

若存在需要根据语言而变化的参数,则value应传入所有可能的语言以便转换

@DoroWolf
Copy link
Member

DoroWolf commented Jan 2, 2025

可以用Kecode(直球)

DoroWolf added a commit that referenced this issue Jan 12, 2025
@DoroWolf
Copy link
Member

DoroWolf commented Jan 15, 2025

实际环境中发现使用Kecode会将其作为消息链的一部分,从而导致不必要的换行。
需要一个单独格式的行内i18n语句占位符。

@DoroWolf DoroWolf reopened this Jan 15, 2025
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