translatomatic 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +19 -0
  3. data/.gitignore +0 -0
  4. data/.travis.yml +7 -7
  5. data/.yardopts +9 -0
  6. data/Gemfile +4 -4
  7. data/Guardfile +0 -0
  8. data/README.de.md +61 -16
  9. data/README.es.md +60 -15
  10. data/README.fr.md +61 -16
  11. data/README.it.md +60 -15
  12. data/README.ja.md +59 -14
  13. data/README.ko.md +137 -0
  14. data/README.md +58 -13
  15. data/README.ms.md +137 -0
  16. data/README.pt.md +137 -0
  17. data/README.ru.md +137 -0
  18. data/README.sv.md +137 -0
  19. data/README.zh.md +137 -0
  20. data/bin/setup +8 -8
  21. data/bin/translatomatic +6 -6
  22. data/bin/travis +1 -1
  23. data/config/locales/translatomatic/de.yml +104 -0
  24. data/config/locales/translatomatic/en.yml +101 -0
  25. data/config/locales/translatomatic/es.yml +105 -0
  26. data/config/locales/translatomatic/fr.yml +105 -0
  27. data/config/locales/translatomatic/it.yml +103 -0
  28. data/config/locales/translatomatic/ja.yml +102 -0
  29. data/config/locales/translatomatic/ko.yml +101 -0
  30. data/config/locales/translatomatic/ms.yml +103 -0
  31. data/config/locales/translatomatic/pt.yml +105 -0
  32. data/config/locales/translatomatic/ru.yml +103 -0
  33. data/config/locales/translatomatic/sv.yml +103 -0
  34. data/config/locales/translatomatic/zh.yml +102 -0
  35. data/db/migrate/201712170000_initial.rb +2 -1
  36. data/lib/translatomatic/cli/base.rb +73 -0
  37. data/lib/translatomatic/cli/common_options.rb +14 -0
  38. data/lib/translatomatic/cli/config.rb +81 -0
  39. data/lib/translatomatic/cli/database.rb +29 -0
  40. data/lib/translatomatic/cli/main.rb +112 -0
  41. data/lib/translatomatic/cli/translate.rb +146 -0
  42. data/lib/translatomatic/cli.rb +8 -216
  43. data/lib/translatomatic/config.rb +143 -0
  44. data/lib/translatomatic/converter.rb +196 -149
  45. data/lib/translatomatic/converter_stats.rb +18 -14
  46. data/lib/translatomatic/database.rb +35 -37
  47. data/lib/translatomatic/escaped_unicode.rb +1 -1
  48. data/lib/translatomatic/extractor/base.rb +2 -0
  49. data/lib/translatomatic/extractor/ruby.rb +1 -0
  50. data/lib/translatomatic/extractor.rb +1 -0
  51. data/lib/translatomatic/http_request.rb +43 -14
  52. data/lib/translatomatic/locale.rb +28 -4
  53. data/lib/translatomatic/logger.rb +21 -13
  54. data/lib/translatomatic/model/locale.rb +5 -1
  55. data/lib/translatomatic/model/text.rb +2 -0
  56. data/lib/translatomatic/model.rb +1 -0
  57. data/lib/translatomatic/option.rb +75 -10
  58. data/lib/translatomatic/progress_updater.rb +7 -3
  59. data/lib/translatomatic/resource_file/base.rb +41 -18
  60. data/lib/translatomatic/resource_file/html.rb +11 -14
  61. data/lib/translatomatic/resource_file/markdown.rb +13 -12
  62. data/lib/translatomatic/resource_file/plist.rb +3 -14
  63. data/lib/translatomatic/resource_file/properties.rb +21 -3
  64. data/lib/translatomatic/resource_file/resw.rb +1 -0
  65. data/lib/translatomatic/resource_file/text.rb +1 -0
  66. data/lib/translatomatic/resource_file/xcode_strings.rb +23 -14
  67. data/lib/translatomatic/resource_file/xml.rb +34 -22
  68. data/lib/translatomatic/resource_file/yaml.rb +39 -5
  69. data/lib/translatomatic/resource_file.rb +7 -5
  70. data/lib/translatomatic/string.rb +40 -12
  71. data/lib/translatomatic/tmx/document.rb +11 -12
  72. data/lib/translatomatic/tmx/translation_unit.rb +5 -1
  73. data/lib/translatomatic/tmx.rb +2 -0
  74. data/lib/translatomatic/translation.rb +30 -0
  75. data/lib/translatomatic/translation_result.rb +45 -45
  76. data/lib/translatomatic/translator/base.rb +128 -83
  77. data/lib/translatomatic/translator/frengly.rb +62 -57
  78. data/lib/translatomatic/translator/google.rb +35 -31
  79. data/lib/translatomatic/translator/microsoft.rb +41 -33
  80. data/lib/translatomatic/translator/my_memory.rb +68 -64
  81. data/lib/translatomatic/translator/yandex.rb +56 -39
  82. data/lib/translatomatic/translator.rb +99 -63
  83. data/lib/translatomatic/util.rb +31 -1
  84. data/lib/translatomatic/version.rb +4 -1
  85. data/lib/translatomatic.rb +17 -0
  86. data/translatomatic.gemspec +5 -4
  87. metadata +56 -16
data/README.ja.md CHANGED
@@ -2,17 +2,26 @@
2
2
 
3
3
  # Translatomatic
4
4
 
5
- 変換テキストファイルから一言語ます。 以下のファイル形式は現在サポートされているのは、:
5
+ 変換テキストファイルから一言語ます。 以下のファイル形式 は現在サポートされているのは、
6
6
 
7
7
  - [特性](https://en.wikipedia.org/wiki/.properties)
8
8
  - RESW(Windows資源ファイル)
9
9
  - [物件リスト](https://en.wikipedia.org/wiki/Property_list) (OSX plist)
10
10
  - HTML
11
11
  - XML
12
+ - [値下げ](https://en.wikipedia.org/wiki/Markdown)
12
13
  - [XCodeの文字列](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
13
14
  - [YAML](http://yaml.org/)
14
15
  - テキストファイル
15
16
 
17
+ 次の翻訳 Api は、Translatomatic で使用できます。
18
+
19
+ - [Google](https://cloud.google.com/translate/)
20
+ - [マイクロソフト](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
21
+ - [Yandex](https://tech.yandex.com/translate/)
22
+ - [MyMemory](https://mymemory.translated.net/doc/)
23
+ - [Frengly](http://www.frengly.com/api)
24
+
16
25
  翻訳文字列に保存されたデータベースの再利用されます。
17
26
 
18
27
  ## 設置
@@ -33,29 +42,37 @@ gem 'translatomatic'
33
42
 
34
43
  ## 用途
35
44
 
36
- のコマンドラインインターフェース翻訳のための機能を `translatomatic`ます。 めに利用可能なオプションは、実行す:
45
+ この宝石と呼ばれる実行可能ファイルを提供します。 `translatomatic`ます。 、 `translatomatic` コマンドは、いくつかのここに記載されているすべての機能を持ちます。 利用可能なコマンドとオプションに関するヘルプを実行します。
37
46
 
38
47
  $ translatomatic help
39
48
 
40
- ### 翻訳ファイル
49
+ ヘルプ コマンドが実行します。
41
50
 
42
- `translatomatic` 変換テキストの文章や言葉です。 場合はファイルを再翻訳の文言変更への翻訳に対しても、それぞれの地域からデータベースです。
51
+ $ translatomatic translate help
52
+ $ translatomatic translate help file
43
53
 
44
- るシリコーンコーティング翻訳サービス-オプション:
54
+ ## セットアップ
45
55
 
46
- $ translatomatic translators
56
+ 利用可能な翻訳サービスとオプションを確認、 `services` コマンド:
47
57
 
48
- するJavaプロパティファイルをドイツ語、フランス語:
58
+ $ translatomatic services
49
59
 
50
- $ translatomatic translate resources/strings.properties de fr
60
+ オプションは、コマンドライン、環境変数、または translatomatic の構成ファイルで指定することができます。 使用して構成ファイルを変更することができます translatomatic の内部 `config` コマンドです。 すべての利用可能な構成設定を一覧表示するには、使用します。
51
61
 
52
- こうした成(上書き) `strings_de.properties` - `strings_fr.properties`ます。
62
+ $ translatomatic config list
63
+ $ translatomatic config describe
53
64
 
54
- ### 抽出から文字列をソースファイル
65
+ 詳細については、後述の構成も参照してください。
55
66
 
56
- 抽出から文字列の一部のソースファイルを抽出すコマンドなどの
67
+ ## 翻訳ファイル
57
68
 
58
- $ translatomatic strings file.rb
69
+ ファイルを変換するとき `translatomatic` 変換テキストの文章や言葉です。 ファイルが再翻訳された場合、最後の翻訳から変更されている唯一の文は翻訳者に送信され、残りの部分は、ローカル データベースから供給されます。
70
+
71
+ ドイツ語とフランス語の Google 翻訳を使用して Java のプロパティ ファイルを翻訳。
72
+
73
+ $ translatomatic translate file --translator Google strings.properties de,fr
74
+
75
+ こうした成(上書き) `strings_de.properties` - `strings_fr.properties` 変換のプロパティを実行します。
59
76
 
60
77
  ### 表示文字列からリソースバンドル
61
78
 
@@ -64,9 +81,37 @@ gem 'translatomatic'
64
81
  $ translatomatic display --locales=en,de,fr \
65
82
  resources/strings.properties store.description store.name
66
83
 
84
+ ### 抽出から文字列をソースファイル
85
+
86
+ いくつかのソース ファイルから文字列を抽出するを使用、 `strings` コマンド例。
87
+
88
+ $ translatomatic strings file.rb
89
+
67
90
  ## 構成
68
91
 
69
- デフォルトでは、 `translatomatic` を使用してsqlite3データベース `$HOME/.translatomatic/translatomatic.sqlite3` 店舗の翻訳の文字列です。 データベースの変更により作成 `database.yml` ファイル `$HOME/.translatomatic/database.yml` のための `production` 環境、例えば
92
+ ### Translatomatic の設定例
93
+
94
+ 使用する 1 つまたは複数の翻訳サービスを設定: する
95
+
96
+ $ translatomatic config set translator Microsoft,Yandex
97
+
98
+ 二次翻訳者は、最初の選択肢を使用する場合、変換エラーが発生した場合にのみ使用されます。
99
+
100
+ ターゲットのロケールの既定の一覧を設定: する
101
+
102
+ $ translatomatic config set target_locales en,de,es,fr,it
103
+
104
+ と `target_locales` 設定すると、ファイルはターゲットのロケールを指定することがなく翻訳が可能、 `translate file` コマンドです。
105
+
106
+ $ translatomatic translate file resources/strings.properties
107
+
108
+ 現在の構成を表示するには、を実行します。
109
+
110
+ $ translatomatic config list
111
+
112
+ ### データベースの構成
113
+
114
+ デフォルトでは、 `translatomatic` を使用してsqlite3データベース `$HOME/.translatomatic/translatomatic.sqlite3` 店舗の翻訳の文字列です。 翻訳をデータベースに格納するようにインストールされている適切なデータベース アダプターが必要、 `sqlite3` 逸品です。 Translatomatic では、データベース アダプターを自動的にインストールされません。 データベースの構成を作成することによって変更できます、 `database.yml` ファイル `$HOME/.translatomatic/database.yml` のための `production` 環境、例えば
70
115
 
71
116
  production:
72
117
  adapter: mysql2
@@ -89,4 +134,4 @@ gem 'translatomatic'
89
134
 
90
135
  皆様との交流のTranslatomaticプロジェクトのcodebases、ラッカー、チャットルームやメーリングリストで入力してください [行動規範](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md)ます。
91
136
 
92
- _Created by Translatomatic 0.1.0 2017-12-29 00:38_
137
+ _Translatomatic 0.1.1 Mon, 01 Jan 2018 21:36:20 +1030 によって作成されました。_
data/README.ko.md ADDED
@@ -0,0 +1,137 @@
1
+ [![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/translatomatic)[![Gem Version](https://badge.fury.io/rb/translatomatic.svg)](https://badge.fury.io/rb/translatomatic)[![Build Status](https://travis-ci.org/smugglys/translatomatic.svg?branch=master)](https://travis-ci.org/smugglys/translatomatic)[![Code Climate](https://codeclimate.com/github/smugglys/translatomatic.svg)](https://codeclimate.com/github/smugglys/translatomatic)
2
+
3
+ # Translatomatic
4
+
5
+ 번역 텍스트 파일로서 다른 하나의 언어입니다. 다음 파일 형식 현재 지원되:
6
+
7
+ - [성](https://en.wikipedia.org/wiki/.properties)
8
+ - RESW(Windows resources 파일)
9
+ - [객실 목록](https://en.wikipedia.org/wiki/Property_list) (OSX plist)
10
+ - HTML
11
+ - XML
12
+ - [Markdown](https://en.wikipedia.org/wiki/Markdown)
13
+ - [XCode 문자열](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
14
+ - [YAML](http://yaml.org/)
15
+ - 텍스트 파일
16
+
17
+ 다음 번역 Api Translatomatic와 함께 사용할 수 있습니다.
18
+
19
+ - [구글](https://cloud.google.com/translate/)
20
+ - [마이크로 소프트](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
21
+ - [Yandex](https://tech.yandex.com/translate/)
22
+ - [MyMemory](https://mymemory.translated.net/doc/)
23
+ - [Frengly](http://www.frengly.com/api)
24
+
25
+ 번역된 문자열 데이터베이스에서 저장 및 재사용 가능합니다.
26
+
27
+ ## 설치
28
+
29
+ 이 줄을 추가하는 응용 프로그램 `Gemfile`:
30
+
31
+ `ruby
32
+ gem 'translatomatic'
33
+ `
34
+
35
+ 한 후 실행하기:
36
+
37
+ $ bundle
38
+
39
+ 거나 설치로서 자신을:
40
+
41
+ $ gem install translatomatic
42
+
43
+ ## 사용법
44
+
45
+ 라는 실행 파일을 제공 하는이 보석 `translatomatic`니다. 는 `translatomatic` 명령 기능, 모두는 여기에 설명 되어 있다. 에 대 한 도움말 사용 가능한 명령 및 옵션을 실행 합니다.
46
+
47
+ $ translatomatic help
48
+
49
+ 그리고에 대 한 도움말을 명령, 실행:
50
+
51
+ $ translatomatic translate help
52
+ $ translatomatic translate help file
53
+
54
+ ## 설치
55
+
56
+ 사용 가능한 번역 서비스와 옵션에 대 한 확인은 `services` 명령:
57
+
58
+ $ translatomatic services
59
+
60
+ 옵션은 명령줄, 환경 변수, 또는 translatomatic의 구성 파일에 지정할 수 있습니다. 구성 파일을 사용 하 여 수정할 수 있습니다 translatomatic의 내부 `config` 명령입니다. 모든 사용 가능한 구성 설정, 사용:
61
+
62
+ $ translatomatic config list
63
+ $ translatomatic config describe
64
+
65
+ 또한 자세한 내용은 아래의 구성 섹션을 참조.
66
+
67
+ ## 번역 파일
68
+
69
+ 파일을 변환할 때 `translatomatic` 번역 텍스트나 문장이나 문구를 시간이다. 파일은 다시 번역 하는 경우 마지막 번역 이후 변경 된 유일한 문장 번역기, 전송 됩니다 그리고 나머지는 로컬 데이터베이스에서 공급.
70
+
71
+ 자바 속성 파일을 독일어와 프랑스어 구글 번역기를 사용 하 여 번역:
72
+
73
+ $ translatomatic translate file --translator Google strings.properties de,fr
74
+
75
+ 이들(또는 덮어쓰기) `strings_de.properties` 고 `strings_fr.properties` 와 속성을 변환.
76
+
77
+ ### 문자열을 표시하는 리소스에 번들
78
+
79
+ 를 읽고 표시 `store.description` 고 `store.name` 속성에서 지역 자원에서 파일을 영어,독일어,프랑스:
80
+
81
+ $ translatomatic display --locales=en,de,fr \
82
+ resources/strings.properties store.description store.name
83
+
84
+ ### 추출 문서는 원본 파일
85
+
86
+ 사용 하는 일부 소스 파일에서 문자열을 추출 하는 `strings` 예를 들어, 명령
87
+
88
+ $ translatomatic strings file.rb
89
+
90
+ ## 구성
91
+
92
+ ### Translatomatic 구성 예
93
+
94
+ 설정 하려면 하나 이상의 번역 서비스를 사용 하 여:
95
+
96
+ $ translatomatic config set translator Microsoft,Yandex
97
+
98
+ 2 차 번역 번역 오류가 발생 하는 첫 번째 선택을 사용 하는 경우 경우에 사용 됩니다.
99
+
100
+ 설정 하려면 대상 로케일의 기본 목록:
101
+
102
+ $ translatomatic config set target_locales en,de,es,fr,it
103
+
104
+ 와 함께 `target_locales` 설정, 파일 번역 될 수 있는 대상 로케일을 지정 하지 않고는 `translate file` 명령입니다.
105
+
106
+ $ translatomatic translate file resources/strings.properties
107
+
108
+ 현재 구성을 표시 하려면 실행
109
+
110
+ $ translatomatic config list
111
+
112
+ ### 데이터베이스 구성
113
+
114
+ 기본적으로, `translatomatic` 사용 sqlite3 데이터베이스에 `$HOME/.translatomatic/translatomatic.sqlite3` 를 저장하는 번역된 문자열이다. 번역 데이터베이스에 저장 하기와 같은 설치 적절 한 데이터베이스 어댑터 있어야 합니다 `sqlite3` 보석입니다. Translatomatic는 데이터베이스 어댑터를 자동으로 설치 되지 않습니다. 데이터베이스 구성을 생성 하 여 변경 수는 `database.yml` 에서 파일 `$HOME/.translatomatic/database.yml` 대 `production` 환경,예를 들어,
115
+
116
+ production:
117
+ adapter: mysql2
118
+ host: db.example.com
119
+ database: translatomatic
120
+ pool: 5
121
+ encoding: utf8
122
+ username: username
123
+ password: password
124
+
125
+ ## 에 기여
126
+
127
+ 버그 보고 및 풀 요청에 오신 것을 환영 합니다 GitHub 에 https://github.com/smugglys/translatomatic 니다. 이 프로젝트 수입한 것이 안전하고,공간에 대한 협력,그리고 참가자는 예상을 준수하 [기여자가 언약](http://contributor-covenant.org) 의 코드를 실시하고 있습니다.
128
+
129
+ ## 라이선스
130
+
131
+ 보석으로 사용할 수 있는 오픈 소스에서의 약관 [MIT 라이센스](https://opensource.org/licenses/MIT)니다.
132
+
133
+ ## 윤리 강령
134
+
135
+ 모든 사람과 상호 작용 Translatomatic 프로젝트의 지원,문제 trackers,대화방 및 메일링 리스트를 수행 할 것으로 예상된 [윤리 강령](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md)니다.
136
+
137
+ _Translatomatic 0.1.1 Mon, 01 Jan 2018 21:36:21 +1030에 의해 만들어진_
data/README.md CHANGED
@@ -13,10 +13,19 @@ are currently supported:
13
13
  * [Property lists](https://en.wikipedia.org/wiki/Property_list) (OSX plist)
14
14
  * HTML
15
15
  * XML
16
+ * [Markdown](https://en.wikipedia.org/wiki/Markdown)
16
17
  * [XCode strings](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
17
18
  * [YAML](http://yaml.org/)
18
19
  * Text files
19
20
 
21
+ The following translation APIs can be used with Translatomatic:
22
+
23
+ * [Google](https://cloud.google.com/translate/)
24
+ * [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
25
+ * [Yandex](https://tech.yandex.com/translate/)
26
+ * [MyMemory](https://mymemory.translated.net/doc/)
27
+ * [Frengly](http://www.frengly.com/api)
28
+
20
29
  Translated strings are saved in a database and reused.
21
30
 
22
31
  ## Installation
@@ -37,30 +46,37 @@ Or install it yourself as:
37
46
 
38
47
  ## Usage
39
48
 
40
- The command line interface for translation functionality is `translatomatic`. For help on available options, execute:
49
+ This gem provides an executable called `translatomatic`. The `translatomatic` command has a number of functions, not all of which are documented here. For help on available commands and options, execute:
41
50
 
42
51
  $ translatomatic help
43
52
 
44
- ### Translating files
53
+ And for help on a command, execute:
45
54
 
46
- `translatomatic` translates text one sentence or phrase at a time.
47
- If a file is re-translated, only sentences that have changed are sent to the translator, and the rest are sourced from the local database.
55
+ $ translatomatic translate help
56
+ $ translatomatic translate help file
48
57
 
49
- To list available translation services and options:
58
+ ## Setup
50
59
 
51
- $ translatomatic translators
60
+ Check for available translation services and options with the `services` command:
52
61
 
53
- To translate a Java properties file to German and French:
62
+ $ translatomatic services
54
63
 
55
- $ translatomatic translate resources/strings.properties de fr
64
+ Options can be specified on the command line, in environment variables, or in translatomatic's configuration file. The configuration file can be modified using translatomatic's internal `config` command. To list all available configuration settings, use:
56
65
 
57
- This would create (or overwrite) `strings_de.properties` and `strings_fr.properties`.
66
+ $ translatomatic config list
67
+ $ translatomatic config describe
58
68
 
59
- ### Extracting strings from source files
69
+ See also the Configuration section below for more information.
60
70
 
61
- To extract strings from some source files, use the extract command, e.g.
71
+ ## Translating files
62
72
 
63
- $ translatomatic strings file.rb
73
+ When translating files, `translatomatic` translates text one sentence or phrase at a time. If a file is re-translated, only sentences that have changed since the last translation are sent to the translator, and the rest are sourced from the local database.
74
+
75
+ To translate a Java properties file to German and French using the Google translator:
76
+
77
+ $ translatomatic translate file --translator Google strings.properties de,fr
78
+
79
+ This would create (or overwrite) `strings_de.properties` and `strings_fr.properties` with translated properties.
64
80
 
65
81
  ### Displaying strings from a resource bundle
66
82
 
@@ -69,10 +85,39 @@ To read and display the `store.description` and `store.name` properties from loc
69
85
  $ translatomatic display --locales=en,de,fr \
70
86
  resources/strings.properties store.description store.name
71
87
 
88
+ ### Extracting strings from source files
89
+
90
+ To extract strings from some source files, use the `strings` command, e.g.
91
+
92
+ $ translatomatic strings file.rb
93
+
72
94
  ## Configuration
73
95
 
96
+ ### Translatomatic configuration examples
97
+
98
+ To set one or more translation services to use:
99
+
100
+ $ translatomatic config set translator Microsoft,Yandex
101
+
102
+ Secondary translators will only be used if a translation error occurs when using the first choice.
103
+
104
+ To set a default list of target locales:
105
+
106
+ $ translatomatic config set target_locales en,de,es,fr,it
107
+
108
+ With `target_locales` set, files can be translated without specifying target locales in the `translate file` command.
109
+
110
+ $ translatomatic translate file resources/strings.properties
111
+
112
+ To display the current configuration, execute
113
+
114
+ $ translatomatic config list
115
+
116
+ ### Database configuration
117
+
74
118
  By default, `translatomatic` uses an sqlite3 database in `$HOME/.translatomatic/translatomatic.sqlite3` to store translated strings.
75
- The database can be changed by creating a `database.yml` file under `$HOME/.translatomatic/database.yml` for the `production` environment, e.g.
119
+ To store translations in a database, you should have an appropriate database adapter installed, such as the `sqlite3` gem. Translatomatic does not install database adapters automatically.
120
+ The database configuration can be changed by creating a `database.yml` file under `$HOME/.translatomatic/database.yml` for the `production` environment, e.g.
76
121
 
77
122
  production:
78
123
  adapter: mysql2
data/README.ms.md ADDED
@@ -0,0 +1,137 @@
1
+ [![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/translatomatic)[![Gem Version](https://badge.fury.io/rb/translatomatic.svg)](https://badge.fury.io/rb/translatomatic)[![Build Status](https://travis-ci.org/smugglys/translatomatic.svg?branch=master)](https://travis-ci.org/smugglys/translatomatic)[![Code Climate](https://codeclimate.com/github/smugglys/translatomatic.svg)](https://codeclimate.com/github/smugglys/translatomatic)
2
+
3
+ # Translatomatic
4
+
5
+ Diterjemahkan teks fail-fail dari satu bahasa yang lain. Berikut file format disokong:
6
+
7
+ - [Sifat](https://en.wikipedia.org/wiki/.properties)
8
+ - RESW (Tingkap sumber file)
9
+ - [Harta senarai](https://en.wikipedia.org/wiki/Property_list) (SELEPAS plist)
10
+ - HTML
11
+ - FAIL
12
+ - [Markdown](https://en.wikipedia.org/wiki/Markdown)
13
+ - [Dan diganti dengan tali](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
14
+ - [YAML](http://yaml.org/)
15
+ - Fail teks
16
+
17
+ Terjemahan berikut api boleh digunakan dengan Translatomatic:
18
+
19
+ - [Google](https://cloud.google.com/translate/)
20
+ - [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
21
+ - [Yandex](https://tech.yandex.com/translate/)
22
+ - [MyMemory](https://mymemory.translated.net/doc/)
23
+ - [Frengly](http://www.frengly.com/api)
24
+
25
+ Diterjemahkan tali disimpan dalam pengkalan data dan semula.
26
+
27
+ ## Pemasangan
28
+
29
+ Masukkan baris ini untuk anda permohonan `Gemfile`:
30
+
31
+ `ruby
32
+ gem 'translatomatic'
33
+ `
34
+
35
+ Dan kemudian melaksanakan:
36
+
37
+ $ bundle
38
+
39
+ Atau memasang sendiri sebagai:
40
+
41
+ $ gem install translatomatic
42
+
43
+ ## Penggunaan
44
+
45
+ Permata ini menyediakan boleh laku yang dipanggil `translatomatic`. Dalam `translatomatic` arahan mempunyai beberapa fungsi, tidak semua yang dihuraikan di sini. Untuk bantuan tentang perintah tersedia dan opsyen, melaksanakan:
46
+
47
+ $ translatomatic help
48
+
49
+ Dan untuk bantuan tentang arahan, melaksanakan:
50
+
51
+ $ translatomatic translate help
52
+ $ translatomatic translate help file
53
+
54
+ ## Persediaan
55
+
56
+ Menyemak Perkhidmatan penterjemahan tersedia dan dengan itu `services` perintah:
57
+
58
+ $ translatomatic services
59
+
60
+ Pilihan boleh ditetapkan pada baris arahan, dalam pembolehubah persekitaran, atau dalam fail konfigurasi di translatomatic. Fail konfigurasi boleh diubahsuai menggunakan translatomatic di Dalaman `config` perintah. Untuk menyenaraikan semua tetapan tatarajah tersedia, gunakan:
61
+
62
+ $ translatomatic config list
63
+ $ translatomatic config describe
64
+
65
+ Lihat juga Seksyen konfigurasi di bawah untuk maklumat lanjut.
66
+
67
+ ## Menterjemahkan fail
68
+
69
+ Apabila menterjemahkan fail, `translatomatic` diterjemahkan teks satu ayat atau frasa pada suatu waktu. Jika fail terjemahan semula, ayat sahaja yang telah berubah sejak lepas terjemahan dihantar kepada penterjemah, dan selebihnya diperolehi dari pangkalan data tempatan.
70
+
71
+ Untuk menterjemahkan fail sifat Java untuk Jerman dan Perancis yang menggunakan Google penterjemah:
72
+
73
+ $ translatomatic translate file --translator Google strings.properties de,fr
74
+
75
+ Ini akan membuat (atau tindih) `strings_de.properties` dan `strings_fr.properties` dengan sifat-sifat yang diterjemahkan.
76
+
77
+ ### Memaparkan tali dari sumber ikatan
78
+
79
+ Untuk membaca dan memaparkan `store.description` dan `store.name` sifat dari sumber lokal fail dalam bahasa inggris, bahasa jerman, dan perancis:
80
+
81
+ $ translatomatic display --locales=en,de,fr \
82
+ resources/strings.properties store.description store.name
83
+
84
+ ### Mengekstrak tali dari sumber fail
85
+
86
+ Untuk mengekstrak rentetan dari sesetengah fail sumber, gunakan dalam `strings` arahan, misalnya
87
+
88
+ $ translatomatic strings file.rb
89
+
90
+ ## Konfigurasi
91
+
92
+ ### Contoh-contoh tatarajah Translatomatic
93
+
94
+ Untuk menetapkan satu atau lebih perkhidmatan penterjemahan untuk digunakan:
95
+
96
+ $ translatomatic config set translator Microsoft,Yandex
97
+
98
+ Penterjemah menengah hanya boleh digunakan jika satu ralat penterjemahan berlaku bila menggunakan pilihan pertama.
99
+
100
+ Untuk menetapkan senarai sasaran locales lalai:
101
+
102
+ $ translatomatic config set target_locales en,de,es,fr,it
103
+
104
+ Dengan `target_locales` ditetapkan, fail boleh diterjemahkan tanpa menentukan sasaran locales di dalam `translate file` perintah.
105
+
106
+ $ translatomatic translate file resources/strings.properties
107
+
108
+ Untuk memaparkan konfigurasi semasa, melaksanakan
109
+
110
+ $ translatomatic config list
111
+
112
+ ### Pangkalan data konfigurasi
113
+
114
+ Oleh lalai, `translatomatic` menggunakan sqlite3 dalam `$HOME/.translatomatic/translatomatic.sqlite3` untuk menyimpan tali diterjemahkan. Untuk menyimpan terjemahan dalam pangkalan data, anda harus mempunyai penyesuai pangkalan data yang sesuai dipasang, seperti yang `sqlite3` permata. Translatomatic memasang penyesuai pangkalan data secara automatik ini. Pangkalan data konfigurasi boleh ditukar dengan mencipta satu `database.yml` file yang di bawah `$HOME/.translatomatic/database.yml` untuk itu `production` persekitaran, contohnya.
115
+
116
+ production:
117
+ adapter: mysql2
118
+ host: db.example.com
119
+ database: translatomatic
120
+ pool: 5
121
+ encoding: utf8
122
+ username: username
123
+ password: password
124
+
125
+ ## Menyumbang
126
+
127
+ Laporan Bug dan tarik permintaan selamat datang pada Orang yang di https://github.com/smugglys/translatomatic. Projek ini dimaksudkan untuk menjadi aman, menyambut ruang untuk kerjasama, dan penyumbang diharapkan untuk mematuhi [Penyumbang Perjanjian](http://contributor-covenant.org) code of conduct.
128
+
129
+ ## Lesen
130
+
131
+ Permata yang ada sebagai sumber terbuka di bawah segi [MIT Lesen](https://opensource.org/licenses/MIT).
132
+
133
+ ## Kod Amalan
134
+
135
+ Semua orang berinteraksi dengan Translatomatic projek codebases, isu trackers, chat bilik dan senarai mel adalah diharapkan untuk mengikuti [Kod Amalan](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
136
+
137
+ _Dicipta oleh Translatomatic 0.1.1 Mon, 01 Jan 2018 21:36:22 +1030_
data/README.pt.md ADDED
@@ -0,0 +1,137 @@
1
+ [![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/translatomatic)[![Gem Version](https://badge.fury.io/rb/translatomatic.svg)](https://badge.fury.io/rb/translatomatic)[![Build Status](https://travis-ci.org/smugglys/translatomatic.svg?branch=master)](https://travis-ci.org/smugglys/translatomatic)[![Code Climate](https://codeclimate.com/github/smugglys/translatomatic.svg)](https://codeclimate.com/github/smugglys/translatomatic)
2
+
3
+ # Translatomatic
4
+
5
+ Converte arquivos de texto de um idioma para outro. Os seguintes formatos de arquivo são atualmente suportados:
6
+
7
+ - [Propriedades](https://en.wikipedia.org/wiki/.properties)
8
+ - RESW (recursos do Windows ficheiro)
9
+ - [Listas de propriedades](https://en.wikipedia.org/wiki/Property_list) (OSX plist)
10
+ - HTML
11
+ - XML
12
+ - [Markdown](https://en.wikipedia.org/wiki/Markdown)
13
+ - [XCode cadeias de caracteres](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
14
+ - [YAML](http://yaml.org/)
15
+ - Arquivos de texto
16
+
17
+ A tradução seguinte APIs pode ser usada com Translatomatic:
18
+
19
+ - [Google](https://cloud.google.com/translate/)
20
+ - [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
21
+ - [Yandex](https://tech.yandex.com/translate/)
22
+ - [MyMemory](https://mymemory.translated.net/doc/)
23
+ - [Frengly](http://www.frengly.com/api)
24
+
25
+ Traduzido seqüências de caracteres são salvos em um banco de dados e reutilizados.
26
+
27
+ ## Instalação
28
+
29
+ Adicione esta linha ao seu aplicativo `Gemfile`:
30
+
31
+ `ruby
32
+ gem 'translatomatic'
33
+ `
34
+
35
+ E, em seguida, execute:
36
+
37
+ $ bundle
38
+
39
+ Ou instalá-lo a si mesmo como:
40
+
41
+ $ gem install translatomatic
42
+
43
+ ## Utilização
44
+
45
+ Esta gema fornece um arquivo executável chamado `translatomatic`. O `translatomatic` comando tem um número de funções, nem todos que estão documentados aqui. Para obter ajuda sobre os comandos disponíveis e opções, execute:
46
+
47
+ $ translatomatic help
48
+
49
+ E para obter ajuda sobre um comando, execute:
50
+
51
+ $ translatomatic translate help
52
+ $ translatomatic translate help file
53
+
54
+ ## Instalação
55
+
56
+ Verificar se há serviços de tradução disponíveis e opções com a `services` comando:
57
+
58
+ $ translatomatic services
59
+
60
+ Opções podem ser especificadas na linha de comando, em variáveis de ambiente, ou no arquivo de configuração do translatomatic. O arquivo de configuração pode ser modificado usando translatomatic do (a) interno `config` comando. Para listar todas as configurações disponíveis, use:
61
+
62
+ $ translatomatic config list
63
+ $ translatomatic config describe
64
+
65
+ Veja também a seção de configuração abaixo para obter mais informações.
66
+
67
+ ## Conversão de arquivos
68
+
69
+ Quando a tradução de arquivos, `translatomatic` traduz texto de uma sentença ou frase de cada vez. Se um arquivo é re-traduzido, apenas as frases que foram alterados desde a última tradução são enviadas para o tradutor, e o resto são provenientes de banco de dados local.
70
+
71
+ Para traduzir um arquivo de propriedades Java para alemão e francês, usando o Google Tradutor:
72
+
73
+ $ translatomatic translate file --translator Google strings.properties de,fr
74
+
75
+ Isso poderia criar (ou substituir) `strings_de.properties` e `strings_fr.properties` com propriedades traduzidas.
76
+
77
+ ### Exibindo seqüências de caracteres a partir de um pacote de recursos
78
+
79
+ Para ler e exibir o `store.description` e `store.name` propriedades de arquivos de recursos locais em inglês, alemão e francês:
80
+
81
+ $ translatomatic display --locales=en,de,fr \
82
+ resources/strings.properties store.description store.name
83
+
84
+ ### A extração de seqüências de caracteres a partir de arquivos de origem
85
+
86
+ Para extrair sequências de alguns arquivos de fonte, use o `strings` comando, por exemplo
87
+
88
+ $ translatomatic strings file.rb
89
+
90
+ ## Configuração
91
+
92
+ ### Translatomatic exemplos de configuração
93
+
94
+ Para definir um ou mais serviços de tradução para usar:
95
+
96
+ $ translatomatic config set translator Microsoft,Yandex
97
+
98
+ Tradutores secundários serão usados apenas se ocorrer um erro de tradução, ao usar a primeira escolha.
99
+
100
+ Para definir uma lista padrão de localidades de destino:
101
+
102
+ $ translatomatic config set target_locales en,de,es,fr,it
103
+
104
+ Com `target_locales` conjunto, os arquivos podem ser traduzidos sem especificar locais de destino na `translate file` comando.
105
+
106
+ $ translatomatic translate file resources/strings.properties
107
+
108
+ Para exibir a configuração atual, execute
109
+
110
+ $ translatomatic config list
111
+
112
+ ### Configuração de banco de dados
113
+
114
+ Por padrão, `translatomatic` usa um banco de dados sqlite3 no `$HOME/.translatomatic/translatomatic.sqlite3` para armazenar as mensagens traduzidas. Para armazenar as traduções em um banco de dados, você deve ter um adaptador de banco de dados apropriado instalado, tais como o `sqlite3` Gem. Translatomatic não instala automaticamente os adaptadores de banco de dados. A configuração de banco de dados pode ser alterada através da criação de um `database.yml` em ficheiro `$HOME/.translatomatic/database.yml` para o `production` ambiente, e.g.
115
+
116
+ production:
117
+ adapter: mysql2
118
+ host: db.example.com
119
+ database: translatomatic
120
+ pool: 5
121
+ encoding: utf8
122
+ username: username
123
+ password: password
124
+
125
+ ## Contribuir
126
+
127
+ Relatórios de bugs e puxe pedidos são bem-vindos no GitHub em https://github.com/smugglys/translatomatic. Este projeto destina-se a ser um seguro, acolhedor espaço para a colaboração e colaboradores devem cumprir o [Contribuinte Convênio](http://contributor-covenant.org) código de conduta.
128
+
129
+ ## Licença
130
+
131
+ A jóia está disponível como código aberto sob os termos da [Licença MIT](https://opensource.org/licenses/MIT).
132
+
133
+ ## código de conduta
134
+
135
+ Todos interagindo com o Translatomatic projeto antigo, issue trackers, salas de bate-papo e listas de discussão é esperado para seguir o [código de conduta](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
136
+
137
+ _Criado por Translatomatic 0.1.1 Mon, 01 Jan 2018 21:36:23 +1030_