Translatomatic について
Translatomatic (TM) フリーでオープン ソースのテキスト変換ユーティリティは、ruby で書かれました。 それは利便性と git などのコマンド ライン ツールの使いやすさと中国ガジェットの取扱説明書の翻訳の品質を兼ね備えています。
Translatomatic の主な用途は、言語の 1 つまたは複数のファイルを変換することです。 次のファイル形式がサポートされています。
次の翻訳 Api は、Translatomatic で使用できます。
設置
インストール、 translatomatic
次のコマンドで宝石します。
$ gem install translatomatic
用途
この宝石と呼ばれる実行可能ファイルを提供します。 translatomatic
. 、 translatomatic
コマンドは、いくつかのここに記載されているすべての機能を持ちます。 利用可能なコマンドとオプションに関するヘルプを実行します。
$ translatomatic help
ヘルプ コマンドが実行します。
$ translatomatic translate help
$ translatomatic translate help file
セットアップ
利用可能な翻訳サービスとオプションを確認、 services
コマンド:
$ translatomatic services
オプションは、コマンドライン、環境変数、または translatomatic の構成ファイルで指定することができます。 使用して構成ファイルを変更することができます translatomatic の内部 config
コマンドです。 すべての利用可能な構成設定を一覧表示するには、使用します。
$ translatomatic config list
$ translatomatic config describe
詳細については、後述の構成も参照してください。
翻訳ファイル
ファイルを変換するとき translatomatic
変換テキストの文章や言葉です。 ファイルが再翻訳された場合、最後の翻訳から変更されている唯一の文は翻訳者に送信され、残りの部分は、ローカル データベースから供給されます。
ドイツ語とフランス語の Google 翻訳を使用して Java のプロパティ ファイルを翻訳。
$ translatomatic translate file strings.properties de,fr --translator Google
こうした成(上書き) strings_de.properties
– strings_fr.properties
変換のプロパティを実行します。
表示文字列からリソースバンドル
読みを表示 store.description
– store.name
物件からの現地リソースファイル、英語、ドイツ、フランス語:
$ translatomatic display --locales=en,de,fr \
resources/strings.properties store.description store.name
抽出から文字列をソースファイル
いくつかのソース ファイルから文字列を抽出するを使用、 strings
コマンド例。
$ translatomatic strings file.rb
構成
Translatomatic の設定例
使用する 1 つまたは複数の翻訳サービスを設定: する
$ translatomatic config set translator Microsoft,Yandex
二次翻訳者は、最初の選択肢を使用する場合、変換エラーが発生した場合にのみ使用されます。
ターゲットのロケールの既定の一覧を設定: する
$ translatomatic config set target_locales en,de,es,fr,it
と target_locales
設定すると、ファイルはターゲットのロケールを指定することがなく翻訳が可能、 translate file
コマンドです。
$ translatomatic translate file resources/strings.properties
現在の構成を表示するには、を実行します。
$ translatomatic config list
データベースの構成
デフォルトでは、 translatomatic
を使用してsqlite3データベース $HOME/.translatomatic/translatomatic.sqlite3
店舗の翻訳の文字列です。 翻訳をデータベースに格納するようにインストールされている適切なデータベース アダプターが必要、 sqlite3
逸品です。 Translatomatic では、データベース アダプターを自動的にインストールされません。 データベースの構成を作成することによって変更できます、 database.yml
ファイル $HOME/.translatomatic/database.yml
のための production
環境、例えば
production:
adapter: mysql2
host: db.example.com
database: translatomatic
pool: 5
encoding: utf8
username: username
password: password
ライセンス
の逸品をご用意してオープンソースの条件の下での MITライセンス.
Translatomatic 0.1.2 Mon, 01 Jan 2018 21:53:11 +1030 によって作成されました。