diff --git a/README.md b/README.md index 15ae526..41c497b 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,26 @@ This will print the detailed usage of `new` command: 6. You can mark all untranslated texts as translated ones by `mark` command: `mark {index_or_name} -l {lang}` 7. You can rename a name of translations by `rename` command: `rename {index_or_name} -l {lang} -t {new_lang}`, where `{new_lang}` is new one. 8. To merge translations from another TranslationIndex into current TranslationIndex, use `merge` command: `merge {index_or_name} -l {lang} -s {source_index}`, where `{source_index}` is the source index to merge from. This enables you to use translations of old game to that of new game when new one is released. - +9. You can use `-a` option to enable [AI translation](#use-ai-translation) and [UlionTse/translators](#使用uliontse-translators翻译) translation to load translation settings from the config file automatically. It reduces some args to enter for these commands. + + Auto [UlionTse/translators](#使用uliontse-translators翻译) translation: `t {index_or_name} -t ts -l {lang} -a`. Default args in [config.yaml](config.yaml): + ```yaml + translators: + api_name: 'bing' + # Language code can be found at: resources/translation/translators_langcode.txt + from_language: 'auto' + to_language: 'zh-Hans' + ``` + Auto [AI translation](#use-uliontse-translators): `t {index_or_name} -t ai -l {lang} -a`. Default args in [config.yaml](config.yaml): + ```yaml + ai: + # available models: 'm2m100', 'mbart50', 'nllb200' + model_name: 'mbart50' + batch_size: 2 + # Language code can be found at: resources/translation/dl-translate_langcode.txt + from_language: 'English' + to_language: 'Chinese' + ``` --- ## ⚡Fast translating⚡ with `saveexcel` and `loadexcel` By saving translations to an Excel file, use translation website to translate. diff --git a/README_zh.md b/README_zh.md index 51895bd..651d3e9 100644 --- a/README_zh.md +++ b/README_zh.md @@ -78,6 +78,26 @@ translate chinese scene_01_5f0ee2360: 5. [0.4.1] 打开RenPy游戏、保存文件的所在位置(仅限Windows平台):新命令`open`可以打开与TranslationIndex关联的游戏可执行文件所在位置:`o {peoject}`。一些保存文件的命令(如`savehtml`、`saveexcel`、`dumpexcel`等)在保存文件后会自动打开文件所在位置,如果要阻止这种行为请在相应命令后面添加`-nw`选项。 6. [0.4.1] [UlionTse/translators](#使用uliontse-translators翻译)翻译:`translate {index_or_name} -t ts -n bing -l {lang}` 7. [0.4.2] 使用`new_file`创建来自单个文件的FileTranslationIndex:`nf {file_path} -s {type}`,其中`{type}`指定了生成该文件的工具类型,可选的值有`mt`(MTool生成的ManualTransFile.json文件),`xu`(XUnity Auto Translator生成的_AutoGeneratedTranslations.txt),`tp`(Translator++生成的xls/xlsx文件)。之后像往常一样使用其他命令进行操作FileTranslationIndex。FileTranslationIndex不支持以下命令:`inject`,`count`。您可以使用`nf -l`和`nf -h`查看详细说明。 +8. 对于[AI翻译](#使用AI翻译)和[UlionTse/translators](#使用uliontse-translators翻译)翻译,通过`-a`选项来从配置文件加载默认的翻译设置,这样就可以减少部分命令参数的手动设置。 + + 简化的[UlionTse/translators](#使用uliontse-translators翻译)翻译:`t {index_or_name} -t ts -l {lang} -a`。需要在[config.yaml](config.yaml)需要配置的项目有: + ```yaml + translators: + api_name: 'bing' + # Language code can be found at: resources/translation/translators_langcode.txt + from_language: 'auto' + to_language: 'zh-Hans' + ``` + 简化的[AI翻译](#使用AI翻译)翻译:`t {index_or_name} -t ai -l {lang} -a`。需要在[config.yaml](config.yaml)需要配置的项目有: + ```yaml + ai: + # available models: 'm2m100', 'mbart50', 'nllb200' + model_name: 'mbart50' + batch_size: 2 + # Language code can be found at: resources/translation/dl-translate_langcode.txt + from_language: 'English' + to_language: 'Chinese' + ``` # 🛫快速开始