Skip to content

Commit

Permalink
仕様変更に従いreadme更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorayan-sub committed Aug 17, 2021
1 parent f865219 commit c025a27
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
# yaml-translater
Google Cloud Translation APIを使ったYamlファイル翻訳するPythonスクリプト
## Setup
サービスアカウントキーの設定(windows)
```
setx GOOGLE_APPLICATION_CREDENTIALS <json_key_path> -m
```
[公式ドキュメント](https://cloud.google.com/translate/docs/setup)
## Requirements
* Python 3.9
* pyyaml 5.4.1
* google-cloud-translate 2.0.1
## Example
before
クォーテーションで囲まれている部分だけ翻訳されます
* before
```
a: Hello
a: false
b:
a: Good Night
b: I am Fine
a: 'Good Night'
b: "I am Fine"
c:
- What are you doing?
- a: Hey Guys!
b: We have a gift for you
```
after
* after
```
a: こんにちは
a: false
b:
a: おやすみ
b: 私は元気です
a: 'おやすみ'
b: "私は元気です"
c:
- 何してるの?
- a: やあみんな!
b: 私たちはあなたへの贈り物を持っています
- What are you doing?
- a: Hey Guys!
b: We have a gift for you
```
## Setup
サービスアカウントキーの設定(windows)
```
setx GOOGLE_APPLICATION_CREDENTIALS <json_key_path> -m
```
[公式ドキュメント](https://cloud.google.com/translate/docs/setup)
## Requirements
* Python 3.9
* pyyaml 5.4.1
* google-cloud-translate 2.0.1
## Usage
```
python main.py <target_file>
```
同じディレクトリに対象ファイル名_translated.ymlが生成されます

0 comments on commit c025a27

Please sign in to comment.