Rewrite I18n Scan#1294
Merged
Merged
Conversation
Owner
|
话说之前locale_diff是干啥用的,没见有地方调用到,也是手工扫描吗? |
Contributor
Author
原本需要先执行 就是需要按顺序手动执行这两个文件,所以干脆合并了,改成只需要手动执行一次。 |
Contributor
Author
|
@RVC-Boss 我才发现一个尴尬的事情,就是 GPT_SoVITS 文件夹外有一个 i18n/locale 文件夹,tools 文件夹下也有一个 i18n/locale。 这个要怎么安排呢? 看了一下是 I18nAuto() 读取的时候就是直接读的 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
合并并修改 i18n 的扫描和更新函数, 方便开发者及时更新相应文本.
原有文件存在一些读写问题, 且分为两个文件, 为了方便使用进行了修改.
具体细节:
先使用
scan_i18n_strings()对整个项目扫描得到现有的 i18n 键code_keys;后遍历
i18n/locale文件夹下的json文件使用update_i18n_json()进行更新:zh_CN则直接将键作为值;其他语言则添加#!开头以标识未被翻译;注1: 文件开头使用
SHOW_KEYS用于控制是否在终端显示具体的键,默认为False不显示;注2: 现有文件基本为原文件 133 + 缺失 138 - 多余 116 = 155 条 (KR 除外)
Warning
<br>进行换行,应考虑拆分成多句?在 PR 1344 中完成.
终端示例图片