Skip to content

Conversation

malfdev
Copy link
Contributor

@malfdev malfdev commented Sep 25, 2025

What type of PR is this?

cn:在中文模式下的授权面板中,选择secret key 的超时时间为永久时,依然是英文显示。
en:In the authorization panel in Chinese mode, when you select the secret key timeout period as permanent, the display is still in English.

这是我们在扩展开发API授权时,发现的一个问题。切换中文模式时,过期时间永久的选项,仍是英文Permanent显示。

分析了一下,可能是以下问题导致的。
词库里这行本身是中文翻译。不过问题在于 permanent 这个通用 key 在别的模块(common中)里也被用到,最终打包进来的顺序会把它覆盖回英文,所以 PAT 面板里通过 I18n.t('permanent') 拿到的还是 “Permanent”。我们给永久有效选项加了一个专用 key permanent_duration,并让代码改用这个 key,就不会再被其它地方的同名词条覆盖了。

因为不知道common 中的permanent是否可以删除,我们新增了一个permanent_duration。

麻烦大佬看一下。

…t the secret key timeout period as permanent, the display is still in English.
@mocayo
Copy link
Collaborator

mocayo commented Sep 25, 2025

thank you @malfdev 👍 how about use I18n.t('permanent') instead ofI18n.t('permanent_duration'),

@mocayo
Copy link
Collaborator

mocayo commented Sep 25, 2025

and it would be nice to change pr title to "[fix] [frontend] permanent i18n key in auth pages"

@malfdev malfdev changed the title fix(i18n): In the authorization panel in Chinese mode, when you selec… [fix] [frontend] permanent i18n key in auth pages Sep 25, 2025
@mocayo
Copy link
Collaborator

mocayo commented Sep 25, 2025

thank you @malfdev 👍 how about use I18n.t('permanent') instead ofI18n.t('permanent_duration'),

use 'permanent',it's safe

@malfdev
Copy link
Contributor Author

malfdev commented Sep 25, 2025

thank you @malfdev 👍 how about use I18n.t('permanent') instead ofI18n.t('permanent_duration'),

use 'permanent',it's safe

好的,因为当时看到common 中已经有permanent,所以就使用了permanent_duration。

@mocayo mocayo merged commit 8d3a74a into coze-dev:main Sep 26, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants