#plugin #idea #directory #tran

app dd_tran_tool

idea 插件开发多语言翻译工具

3 releases

0.1.2 Apr 10, 2024
0.1.1 Mar 12, 2024
0.1.0 Mar 7, 2024

#551 in Command line utilities

Download history 107/week @ 2024-03-02 195/week @ 2024-03-09 13/week @ 2024-03-16 29/week @ 2024-03-30 157/week @ 2024-04-06

208 downloads per month

MIT/Apache

17KB
233 lines

dd_tran_tool_rust

安装

cargo install dd_tran_tool

1.初始化

在idea插件项目的根目录下执行

dd_tran_tool init

会生成一个配置文件.ddtr.json

    {
        "baiduId":"",
        "baiduKey":"",
        "propertiesFileDir": "./src/main/resources/messages",
        "filename": "pluginBundle",
        "defaultfilename":"pluginBundle",
        "defaultLang":"zh",
        "suportLangs":[
            "en",
            "hk",
            "ja",
            "ko"
        ]
    }

baiduId: 百度翻译api id

baiduKey: 百度翻译api key

propertiesFileDir: 插件的国际化配置目录,相对路径

filename: 文件名的前缀

defaultfilename: 默认的文件名

defaultLang: 翻译的文本语言

suportLangs: 要翻译的文本语言

2. 翻译

dd_tran_tool tran --tran 要翻译的文本 --key 键值对的键

例子

dd_tran_tool tran --tran 测试 --key test

会在文件/src/main/resources/messages/pluginBundle.properties末尾添加

test=测试

会在文件/src/main/resources/messages/pluginBundle_en|hk|ja|ko.properties末尾添加

test=翻译后的对应语言结果

Dependencies

~10–26MB
~386K SLoC