This is a tool for translation and file format converting.
For file format, we currently support json
, yaml
, properties
and typescript
.
For translation client, we currently use Aliyun machine translation.
go get -u github.com/hyperjiang/translate
translate file -i "input-file" -o "output-file"
For translation, we only support simple single-layer key-value format, e.g.
{
"key1": "value1",
"key2": "value2",
}
or
key1: value1
key2: value2
or
key1=value1
key2=value2
Setup environment variables:
export ALI_REGION_ID="cn-hangzhou"
export ALI_ACCESS_KEY_ID="your-key"
export ALI_ACCESS_SECRET="your-secret"
translate aliyun -i "input-file" -o "output-file" -s source-language -t target-language