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

l10n bug #52

Open
DannyDevPro opened this issue Dec 4, 2022 · 2 comments
Open

l10n bug #52

DannyDevPro opened this issue Dec 4, 2022 · 2 comments

Comments

@DannyDevPro
Copy link
Contributor

就是所有 string类型的 参数,会尝试发到待翻译池中,然后使用命令生成翻译时会将池中的 key 全部写入。然后读取的时候,如果是 string类型的 参数会走翻译读取。

所以用了默认值当 key ,也用了默认值当 value,这样的话对开发者使用就无感知的,并且还能实现参数默认值在不语言环境下可翻译。
就是没有处理特殊符号。。。
if (param.type === ArgumentType.STRING && value && typeof value === 'string') {
param.defaultValue = this.localizeText(value);
}
所以只要默认值不特殊符号应该都没有问题。
LUX{IC)` 3H2@B6A$ULFY

使用特殊符号这个特例的方式,就是写代码的时候先写正常的 字符串用来做 符号参数的默认值,这样生成翻译的时候 key 就是正确的。在sc里会报错
修复方式事这个 参数结构体做提供一个 set key 的 api。有你这种需求的时候有可以使用 set key 单独设置一个key。
BY HCN fromQQ

@FurryR
Copy link
Contributor

FurryR commented Feb 11, 2023

或许,对 value 进行 hash,也可以实现效果。
当然,我无法确定这样做的可行性,因为你的表述太不清了。

@FurryR
Copy link
Contributor

FurryR commented Oct 15, 2023

过了几个月来看你的 issue,还是没看懂。

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