translatomatic 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitattributes +20 -20
- data/.gitignore +19 -15
- data/.rspec +3 -3
- data/.rubocop.yml +28 -0
- data/.translatomatic/config.yml +4 -0
- data/.travis.yml +4 -6
- data/.yardopts +9 -9
- data/Gemfile +8 -4
- data/Guardfile +4 -5
- data/README.de.md +55 -50
- data/README.en.md +177 -0
- data/README.es.md +53 -48
- data/README.fr.md +53 -48
- data/README.it.md +54 -49
- data/README.ja.md +63 -58
- data/README.ko.md +59 -54
- data/README.md +17 -13
- data/README.ms.md +50 -45
- data/README.pt.md +54 -49
- data/README.ru.md +57 -52
- data/README.sv.md +51 -46
- data/README.zh.md +60 -55
- data/Rakefile +3 -3
- data/TODO.txt +6 -0
- data/bin/console +3 -3
- data/bin/translatomatic +4 -2
- data/config/i18n-tasks.yml +130 -0
- data/config/locales/translatomatic/de.yml +141 -99
- data/config/locales/translatomatic/en.yml +129 -89
- data/config/locales/translatomatic/es.yml +136 -99
- data/config/locales/translatomatic/fr.yml +139 -100
- data/config/locales/translatomatic/it.yml +135 -97
- data/config/locales/translatomatic/ja.yml +137 -98
- data/config/locales/translatomatic/ko.yml +138 -98
- data/config/locales/translatomatic/ms.yml +138 -100
- data/config/locales/translatomatic/pt.yml +137 -101
- data/config/locales/translatomatic/ru.yml +136 -98
- data/config/locales/translatomatic/sv.yml +134 -96
- data/config/locales/translatomatic/zh.yml +136 -97
- data/db/migrate/201712170000_initial.rb +2 -3
- data/lib/translatomatic.rb +40 -25
- data/lib/translatomatic/cli.rb +5 -1
- data/lib/translatomatic/cli/base.rb +61 -58
- data/lib/translatomatic/cli/common_options.rb +14 -11
- data/lib/translatomatic/cli/config.rb +96 -91
- data/lib/translatomatic/cli/database.rb +85 -23
- data/lib/translatomatic/cli/main.rb +158 -104
- data/lib/translatomatic/cli/thor.rb +29 -0
- data/lib/translatomatic/cli/translate.rb +134 -157
- data/lib/translatomatic/config.rb +10 -301
- data/lib/translatomatic/config/display.rb +78 -0
- data/lib/translatomatic/config/files.rb +60 -0
- data/lib/translatomatic/config/location_settings.rb +133 -0
- data/lib/translatomatic/config/options.rb +68 -0
- data/lib/translatomatic/config/selector.rb +127 -0
- data/lib/translatomatic/config/settings.rb +148 -0
- data/lib/translatomatic/converter.rb +40 -28
- data/lib/translatomatic/database.rb +127 -110
- data/lib/translatomatic/define_options.rb +4 -5
- data/lib/translatomatic/escaped_unicode.rb +86 -76
- data/lib/translatomatic/extractor.rb +5 -2
- data/lib/translatomatic/extractor/base.rb +12 -12
- data/lib/translatomatic/extractor/ruby.rb +7 -6
- data/lib/translatomatic/file_translator.rb +101 -244
- data/lib/translatomatic/flattenation.rb +39 -0
- data/lib/translatomatic/http.rb +13 -0
- data/lib/translatomatic/http/client.rb +144 -0
- data/lib/translatomatic/http/exception.rb +43 -0
- data/lib/translatomatic/http/file_param.rb +27 -0
- data/lib/translatomatic/http/param.rb +37 -0
- data/lib/translatomatic/http/request.rb +91 -0
- data/lib/translatomatic/i18n.rb +43 -0
- data/lib/translatomatic/locale.rb +71 -59
- data/lib/translatomatic/logger.rb +43 -28
- data/lib/translatomatic/metadata.rb +58 -0
- data/lib/translatomatic/model.rb +4 -2
- data/lib/translatomatic/model/locale.rb +5 -5
- data/lib/translatomatic/model/text.rb +5 -5
- data/lib/translatomatic/option.rb +57 -34
- data/lib/translatomatic/path_utils.rb +126 -0
- data/lib/translatomatic/progress_updater.rb +13 -16
- data/lib/translatomatic/provider.rb +101 -0
- data/lib/translatomatic/provider/base.rb +136 -0
- data/lib/translatomatic/provider/frengly.rb +55 -0
- data/lib/translatomatic/provider/google.rb +78 -0
- data/lib/translatomatic/provider/google_web.rb +50 -0
- data/lib/translatomatic/provider/microsoft.rb +144 -0
- data/lib/translatomatic/provider/my_memory.rb +75 -0
- data/lib/translatomatic/provider/yandex.rb +61 -0
- data/lib/translatomatic/resource_file.rb +59 -53
- data/lib/translatomatic/resource_file/base.rb +171 -237
- data/lib/translatomatic/resource_file/csv.rb +176 -24
- data/lib/translatomatic/resource_file/html.rb +21 -42
- data/lib/translatomatic/resource_file/key_value_support.rb +117 -0
- data/lib/translatomatic/resource_file/markdown.rb +36 -38
- data/lib/translatomatic/resource_file/plist.rb +121 -126
- data/lib/translatomatic/resource_file/po.rb +104 -82
- data/lib/translatomatic/resource_file/properties.rb +48 -77
- data/lib/translatomatic/resource_file/properties.treetop +87 -0
- data/lib/translatomatic/resource_file/resw.rb +56 -41
- data/lib/translatomatic/resource_file/subtitle.rb +86 -54
- data/lib/translatomatic/resource_file/text.rb +18 -18
- data/lib/translatomatic/resource_file/xcode_strings.rb +32 -63
- data/lib/translatomatic/resource_file/xcode_strings.treetop +85 -0
- data/lib/translatomatic/resource_file/xml.rb +94 -81
- data/lib/translatomatic/resource_file/yaml.rb +54 -68
- data/lib/translatomatic/retry_executor.rb +37 -0
- data/lib/translatomatic/slurp.rb +32 -0
- data/lib/translatomatic/string_batcher.rb +50 -0
- data/lib/translatomatic/string_escaping.rb +61 -0
- data/lib/translatomatic/text.rb +263 -0
- data/lib/translatomatic/text_collection.rb +66 -0
- data/lib/translatomatic/tmx.rb +5 -3
- data/lib/translatomatic/tmx/document.rb +107 -82
- data/lib/translatomatic/tmx/translation_unit.rb +19 -18
- data/lib/translatomatic/translation.rb +8 -28
- data/lib/translatomatic/translation/collection.rb +199 -0
- data/lib/translatomatic/translation/fetcher.rb +123 -0
- data/lib/translatomatic/translation/munging.rb +112 -0
- data/lib/translatomatic/translation/result.rb +50 -0
- data/lib/translatomatic/translation/sharer.rb +32 -0
- data/lib/translatomatic/translation/stats.rb +44 -0
- data/lib/translatomatic/translator.rb +91 -88
- data/lib/translatomatic/type_cast.rb +63 -0
- data/lib/translatomatic/util.rb +37 -33
- data/lib/translatomatic/version.rb +2 -2
- data/translatomatic.gemspec +57 -46
- metadata +136 -59
- data/lib/translatomatic/http_request.rb +0 -162
- data/lib/translatomatic/string.rb +0 -188
- data/lib/translatomatic/translation_result.rb +0 -86
- data/lib/translatomatic/translation_stats.rb +0 -31
- data/lib/translatomatic/translator/base.rb +0 -128
- data/lib/translatomatic/translator/frengly.rb +0 -62
- data/lib/translatomatic/translator/google.rb +0 -37
- data/lib/translatomatic/translator/microsoft.rb +0 -41
- data/lib/translatomatic/translator/my_memory.rb +0 -68
- data/lib/translatomatic/translator/yandex.rb +0 -56
data/README.ko.md
CHANGED
@@ -1,146 +1,150 @@
|
|
1
1
|
[](http://www.rubydoc.info/gems/translatomatic)[](https://badge.fury.io/rb/translatomatic)[](https://travis-ci.org/smugglys/translatomatic)[](https://codeclimate.com/github/smugglys/translatomatic)
|
2
2
|
|
3
|
-
#
|
3
|
+
# 해설자
|
4
4
|
|
5
|
-
다른 한 형식에서 다른
|
5
|
+
한 언어에서 다른 언어로 또는 한 형식에서 다른 형식으로 텍스트 파일을 변환합니다. 현재 지원되는 파일 형식은 다음과 같습니다.
|
6
6
|
|
7
|
-
| 파일 형식 | 확장 |
|
7
|
+
| 파일 형식 | 확장 프로그램 |
|
8
8
|
| --- | --- |
|
9
|
-
| [
|
9
|
+
| [속성](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
10
|
| Windows 리소스 파일 | `.resw, .resx` |
|
11
|
-
| [
|
11
|
+
| [속성 목록](https://en.wikipedia.org/wiki/Property_list) (OSX plist) | `.plist` |
|
12
12
|
| [PO 파일](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
13
13
|
| [XCode 문자열](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
14
14
|
| [YAML](http://yaml.org/) | `.yaml` |
|
15
15
|
| 자막 | `.srt, .ass, .ssa` |
|
16
16
|
| HTML | `.html, .htm, .shtml` |
|
17
17
|
| XML | `.xml` |
|
18
|
-
| [
|
18
|
+
| [가격 인하](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
19
19
|
| 텍스트 파일 | `.txt` |
|
20
20
|
| CSV 파일 | `.csv` |
|
21
21
|
|
22
|
-
다음 번역
|
22
|
+
Translatomatic에서는 다음 번역 업체를 사용할 수 있습니다.
|
23
23
|
|
24
|
-
- [
|
24
|
+
- [Google](https://cloud.google.com/translate/)
|
25
25
|
- [마이크로 소프트](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
|
26
|
-
- [
|
27
|
-
- [
|
28
|
-
- [
|
26
|
+
- [얀덱스](https://tech.yandex.com/translate/)
|
27
|
+
- [내 기억](https://mymemory.translated.net/doc/)
|
28
|
+
- [열렬히](http://www.frengly.com/api)
|
29
29
|
|
30
|
-
|
30
|
+
번역 된 문자열은 데이터베이스에 저장되어 재사용됩니다.
|
31
31
|
|
32
32
|
* * *
|
33
33
|
|
34
|
-
|
34
|
+
## 설치
|
35
35
|
|
36
|
-
이 줄을
|
36
|
+
이 줄을 응용 프로그램에 추가하십시오. `Gemfile`:
|
37
37
|
|
38
38
|
`ruby
|
39
39
|
gem 'translatomatic'
|
40
40
|
`
|
41
41
|
|
42
|
-
|
42
|
+
그런 다음 실행 :
|
43
43
|
|
44
44
|
$ bundle
|
45
45
|
|
46
|
-
|
46
|
+
또는 다음과 같이 직접 설치하십시오.
|
47
47
|
|
48
48
|
$ gem install translatomatic
|
49
49
|
|
50
50
|
* * *
|
51
51
|
|
52
|
-
|
52
|
+
## 사용법
|
53
53
|
|
54
|
-
|
54
|
+
이 젬은 다음과 같은 실행 파일을 제공합니다. `translatomatic`. 그만큼 `translatomatic` 명령에는 여러 가지 기능이 있지만 여기에 모두 설명 된 것은 아닙니다. 사용 가능한 명령 및 옵션에 대한 도움말은 다음을 실행하십시오.
|
55
55
|
|
56
56
|
$ translatomatic help
|
57
57
|
|
58
|
-
|
58
|
+
명령에 대한 도움말을 보려면 다음을 실행하십시오.
|
59
59
|
|
60
60
|
$ translatomatic translate help
|
61
61
|
$ translatomatic translate help file
|
62
62
|
|
63
63
|
* * *
|
64
64
|
|
65
|
-
|
65
|
+
## 설정
|
66
66
|
|
67
|
-
사용 가능한 번역
|
67
|
+
사용 가능한 번역 업체 및 옵션이 있는지 확인하십시오. `providers` 명령:
|
68
68
|
|
69
|
-
$ translatomatic
|
69
|
+
$ translatomatic providers
|
70
70
|
|
71
|
-
환경
|
71
|
+
옵션은 명령 행, 환경 변수 또는 변환의 구성 파일에 지정할 수 있습니다. 구성 파일은 translatomatic의 내부를 사용하여 수정할 수 있습니다 `config` 명령. 사용 가능한 모든 구성 설정을 나열하려면 다음을 사용하십시오.
|
72
72
|
|
73
73
|
$ translatomatic config list
|
74
74
|
$ translatomatic config describe
|
75
75
|
|
76
|
-
옵션은 사용자 수준 또는 프로젝트 수준에서 설정할 수 있습니다.
|
76
|
+
옵션은 사용자 수준 또는 프로젝트 수준에서 설정할 수 있습니다. 자세한 내용은 아래의 구성 섹션을 참조하십시오.
|
77
77
|
|
78
78
|
* * *
|
79
79
|
|
80
|
-
|
80
|
+
## 파일 번역
|
81
81
|
|
82
|
-
파일을
|
82
|
+
파일을 번역 할 때, `translatomatic` 한 번에 한 문장 또는 한 문장의 텍스트를 번역합니다. 파일을 다시 번역하면 마지막 번역 이후 변경된 문장 만 번역 공급자에게 보내지고 나머지는 로컬 데이터베이스에서 제공됩니다.
|
83
83
|
|
84
|
-
자바 속성 파일을 독일어와
|
84
|
+
Google 공급자를 사용하여 자바 속성 파일을 독일어와 프랑스어로 번역하려면 다음을 수행하십시오.
|
85
85
|
|
86
|
-
$ translatomatic translate file --
|
86
|
+
$ translatomatic translate file --provider Google strings.properties de,fr
|
87
87
|
|
88
|
-
|
88
|
+
이것은 (또는 덮어 쓰기) `strings_de.properties` 과 `strings_fr.properties` 번역 된 속성.
|
89
89
|
|
90
|
-
###
|
90
|
+
### 자원 번들에서 문자열 표시
|
91
91
|
|
92
|
-
|
92
|
+
해당 내용을 읽고 표시하려면 `store.description` 과 `store.name` 영어, 독일어 및 프랑스어로 된 로컬 리소스 파일의 등록 정보 :
|
93
93
|
|
94
94
|
$ translatomatic display --locales=en,de,fr \
|
95
95
|
resources/strings.properties store.description store.name
|
96
96
|
|
97
|
-
###
|
97
|
+
### 소스 파일에서 문자열 추출하기
|
98
98
|
|
99
|
-
|
99
|
+
소스 파일에서 문자열을 추출하려면 `strings` 명령, 예.
|
100
100
|
|
101
101
|
$ translatomatic strings file.rb
|
102
102
|
|
103
103
|
* * *
|
104
104
|
|
105
|
-
|
105
|
+
## 파일 변환하기
|
106
106
|
|
107
|
-
Translatomatic
|
107
|
+
Translatomatic은 한 형식에서 다른 형식으로 파일을 변환하는 데 사용할 수 있습니다. 예를 들어, Java 특성 파일을 XCode 문자열 파일로 변환하려면 다음을 수행하십시오.
|
108
108
|
|
109
109
|
$ translatomatic convert strings.properties Localization.strings
|
110
110
|
|
111
111
|
* * *
|
112
112
|
|
113
|
-
|
113
|
+
## 설정
|
114
114
|
|
115
|
-
|
115
|
+
구성 설정은 다음을 사용하여 읽고 쓸 수 있습니다. `config get` 과 `config set` 명령. Translatomatic은에서 사용자 구성 파일을 사용합니다. `$HOME/.translatomatic/config.yml`, 그리고 선택적으로 프로젝트 당 설정 파일 `$PROJECT_DIR/.translatomatic/config.yml`.
|
116
116
|
|
117
|
-
|
117
|
+
그만큼 `--user` 과 `--project` 옵션을 사용하여 명령에 명령을 읽거나 쓰도록 지시 할 수 있습니다. `user` 또는 `project` 구성.
|
118
118
|
|
119
|
-
|
119
|
+
구성 설정은 환경 변수, 사용자 구성 파일, 프로젝트 구성 파일 (있는 경우) 및 명령 행에서 읽습니다. 발견 된 마지막 값은 이전에 읽은 값보다 우선합니다.
|
120
120
|
|
121
|
-
|
121
|
+
구성을 사용하여 `config set` 명령을 사용하면 새 값은 변환 구성 파일을 포함하는 프로젝트 내에서 실행될 때 프로젝트 구성 파일에 기록되거나 프로젝트 구성 파일이없는 경우 사용자 구성 파일에 기록됩니다.
|
122
122
|
|
123
|
-
|
123
|
+
### 역변환 구성 예제
|
124
124
|
|
125
|
-
|
125
|
+
설정 `google_api_key` 사용자 구성 파일 내에서 다음을 사용하십시오.
|
126
126
|
|
127
|
-
|
127
|
+
$ translatomatic config set google_api_key value --user
|
128
128
|
|
129
|
-
|
129
|
+
사용할 하나 이상의 번역 서비스를 설정하려면 다음을 수행하십시오.
|
130
|
+
|
131
|
+
$ translatomatic config set provider Microsoft,Yandex
|
132
|
+
|
133
|
+
대상 로케일의 기본 목록을 설정하려면 다음을 수행하십시오.
|
130
134
|
|
131
135
|
$ translatomatic config set target_locales en,de,es,fr,it
|
132
136
|
|
133
|
-
와
|
137
|
+
와 `target_locales` 설정하면 대상 로케일을 지정하지 않고도 파일을 번역 할 수 있습니다. `translate file` 명령.
|
134
138
|
|
135
139
|
$ translatomatic translate file resources/strings.properties
|
136
140
|
|
137
|
-
현재 구성을
|
141
|
+
현재 구성을 표시하려면 다음을 실행하십시오.
|
138
142
|
|
139
143
|
$ translatomatic config list
|
140
144
|
|
141
145
|
### 데이터베이스 구성
|
142
146
|
|
143
|
-
기본적으로, `translatomatic`
|
147
|
+
기본적으로, `translatomatic` 에서 sqlite3 데이터베이스 사용 `$HOME/.translatomatic/translatomatic.sqlite3` 번역 된 문자열을 저장합니다. 데이터베이스 구성은 다음을 작성하여 변경할 수 있습니다. `database.yml` 밑에있는 파일 `$HOME/.translatomatic/database.yml` 그 `production` 환경, 예.
|
144
148
|
|
145
149
|
production:
|
146
150
|
adapter: mysql2
|
@@ -148,25 +152,26 @@ Translatomatic는 사용자 구성 파일에 `$HOME/.translatomatic/config.yml`
|
|
148
152
|
database: translatomatic
|
149
153
|
pool: 5
|
150
154
|
encoding: utf8
|
155
|
+
collation: utf8_bin
|
151
156
|
username: username
|
152
157
|
password: password
|
153
158
|
|
154
159
|
* * *
|
155
160
|
|
156
|
-
|
161
|
+
## 기여
|
157
162
|
|
158
|
-
|
163
|
+
GitHub (https://github.com/smugglys/translatomatic)에서 버그보고 및 요청을 환영합니다. 이 프로젝트는 공동 작업을위한 안전하고 환영할만한 공간으로 만들어졌으며 참여자는 [기여자 규약](http://contributor-covenant.org) 행동 규범.
|
159
164
|
|
160
165
|
* * *
|
161
166
|
|
162
|
-
|
167
|
+
## 라이센스
|
163
168
|
|
164
|
-
|
169
|
+
이 젬은 오픈 소스로 이용 가능합니다. [MIT 라이센스](https://opensource.org/licenses/MIT).
|
165
170
|
|
166
171
|
* * *
|
167
172
|
|
168
|
-
|
173
|
+
## 윤리 강령
|
169
174
|
|
170
|
-
|
175
|
+
Translatomatic 프로젝트의 코드베이스, 이슈 트래커, 대화방 및 메일 링리스트와 상호 작용하는 모든 사람들은 [행동 강령](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
|
171
176
|
|
172
|
-
_Translatomatic 0.1.
|
177
|
+
_Translatomatic 0.1.3 Tue, 06 Feb 2018 22:18:22 +1030 https://github.com/smugglys/translatomatic_
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Translates text files from one language to another, or from one format to anothe
|
|
22
22
|
| Text files | `.txt` |
|
23
23
|
| CSV files | `.csv` |
|
24
24
|
|
25
|
-
The following translation
|
25
|
+
The following translation providers can be used with Translatomatic:
|
26
26
|
|
27
27
|
* [Google](https://cloud.google.com/translate/)
|
28
28
|
* [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
|
@@ -64,9 +64,9 @@ And for help on a command, execute:
|
|
64
64
|
---
|
65
65
|
## Setup
|
66
66
|
|
67
|
-
Check for available translation
|
67
|
+
Check for available translation providers and options with the `providers` command:
|
68
68
|
|
69
|
-
$ translatomatic
|
69
|
+
$ translatomatic providers
|
70
70
|
|
71
71
|
Options can be specified on the command line, in environment variables, or in translatomatic's configuration files. The configuration files can be modified using translatomatic's internal `config` command. To list all available configuration settings, use:
|
72
72
|
|
@@ -78,11 +78,11 @@ Options can be set at the user level or the project level. See also the Configur
|
|
78
78
|
---
|
79
79
|
## Translating files
|
80
80
|
|
81
|
-
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
|
81
|
+
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 translation provider, and the rest are sourced from the local database.
|
82
82
|
|
83
|
-
To translate a Java properties file to German and French using the Google
|
83
|
+
To translate a Java properties file to German and French using the Google provider:
|
84
84
|
|
85
|
-
$ translatomatic translate file --
|
85
|
+
$ translatomatic translate file --provider Google strings.properties de,fr
|
86
86
|
|
87
87
|
This would create (or overwrite) `strings_de.properties` and `strings_fr.properties` with translated properties.
|
88
88
|
|
@@ -110,19 +110,23 @@ For example, to convert a Java properties file to an XCode strings file:
|
|
110
110
|
---
|
111
111
|
## Configuration
|
112
112
|
|
113
|
-
Translatomatic
|
113
|
+
Configuration settings can be read and written using the `config get` and `config set` commands. Translatomatic uses a user configuration file at `$HOME/.translatomatic/config.yml`, and optionally a per project configuration file `$PROJECT_DIR/.translatomatic/config.yml`.
|
114
|
+
|
115
|
+
The `--user` and `--project` options can be used to tell the command to read or write to the `user` or `project` configuration.
|
116
|
+
|
117
|
+
Configuration settings are read from environment variables, the user configuration file, the project configuration file (if present), and from the command line. The last value found takes precedence over values read earlier.
|
118
|
+
|
119
|
+
When writing to the configuration with the `config set` command, the new value is written to the project configuration file when executed within a project containing a translatomatic configuration file, or the user configuration file if there is no project configuration file.
|
114
120
|
|
115
121
|
### Translatomatic configuration examples
|
116
122
|
|
117
123
|
To set `google_api_key` within the user configuration file, use:
|
118
124
|
|
119
|
-
$ translatomatic config set google_api_key value --
|
125
|
+
$ translatomatic config set google_api_key value --user
|
120
126
|
|
121
127
|
To set one or more translation services to use:
|
122
128
|
|
123
|
-
$ translatomatic config set
|
124
|
-
|
125
|
-
Secondary translators will only be used if a translation error occurs when using the first choice.
|
129
|
+
$ translatomatic config set provider Microsoft,Yandex
|
126
130
|
|
127
131
|
To set a default list of target locales:
|
128
132
|
|
@@ -132,14 +136,13 @@ With `target_locales` set, files can be translated without specifying target loc
|
|
132
136
|
|
133
137
|
$ translatomatic translate file resources/strings.properties
|
134
138
|
|
135
|
-
To display the current configuration, execute
|
139
|
+
To display the current configuration, execute:
|
136
140
|
|
137
141
|
$ translatomatic config list
|
138
142
|
|
139
143
|
### Database configuration
|
140
144
|
|
141
145
|
By default, `translatomatic` uses an sqlite3 database in `$HOME/.translatomatic/translatomatic.sqlite3` to store translated strings.
|
142
|
-
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.
|
143
146
|
The database configuration can be changed by creating a `database.yml` file under `$HOME/.translatomatic/database.yml` for the `production` environment, e.g.
|
144
147
|
|
145
148
|
production:
|
@@ -148,6 +151,7 @@ The database configuration can be changed by creating a `database.yml` file unde
|
|
148
151
|
database: translatomatic
|
149
152
|
pool: 5
|
150
153
|
encoding: utf8
|
154
|
+
collation: utf8_bin
|
151
155
|
username: username
|
152
156
|
password: password
|
153
157
|
|
data/README.ms.md
CHANGED
@@ -2,48 +2,48 @@
|
|
2
2
|
|
3
3
|
# Translatomatic
|
4
4
|
|
5
|
-
|
5
|
+
Menterjemah fail teks dari satu bahasa ke bahasa yang lain, atau dari satu format ke yang lain. Format fail berikut kini disokong:
|
6
6
|
|
7
7
|
| Format fail | Sambungan |
|
8
8
|
| --- | --- |
|
9
|
-
| [
|
9
|
+
| [Hartanah](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
10
|
| Fail sumber Windows | `.resw, .resx` |
|
11
|
-
| [
|
11
|
+
| [Senarai harta tanah](https://en.wikipedia.org/wiki/Property_list) (OSX plist) | `.plist` |
|
12
12
|
| [Fail PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
13
|
-
| [
|
13
|
+
| [Tali XCode](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
14
14
|
| [YAML](http://yaml.org/) | `.yaml` |
|
15
|
-
|
|
15
|
+
| Sarikata | `.srt, .ass, .ssa` |
|
16
16
|
| HTML | `.html, .htm, .shtml` |
|
17
|
-
|
|
18
|
-
| [
|
17
|
+
| XML | `.xml` |
|
18
|
+
| [Kemerosotan](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
19
19
|
| Fail teks | `.txt` |
|
20
20
|
| Fail CSV | `.csv` |
|
21
21
|
|
22
|
-
|
22
|
+
Penyedia penterjemahan berikut boleh digunakan dengan Translatomatic:
|
23
23
|
|
24
24
|
- [Google](https://cloud.google.com/translate/)
|
25
25
|
- [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
|
26
26
|
- [Yandex](https://tech.yandex.com/translate/)
|
27
|
-
- [
|
27
|
+
- [Ingatan saya](https://mymemory.translated.net/doc/)
|
28
28
|
- [Frengly](http://www.frengly.com/api)
|
29
29
|
|
30
|
-
|
30
|
+
Rentetan diterjemahkan disimpan dalam pangkalan data dan digunakan semula.
|
31
31
|
|
32
32
|
* * *
|
33
33
|
|
34
34
|
## Pemasangan
|
35
35
|
|
36
|
-
|
36
|
+
Tambahkan baris ini ke aplikasi anda `Gemfile`:
|
37
37
|
|
38
38
|
`ruby
|
39
39
|
gem 'translatomatic'
|
40
40
|
`
|
41
41
|
|
42
|
-
Dan kemudian
|
42
|
+
Dan kemudian laksanakan:
|
43
43
|
|
44
44
|
$ bundle
|
45
45
|
|
46
|
-
Atau
|
46
|
+
Atau pasang sendiri sebagai:
|
47
47
|
|
48
48
|
$ gem install translatomatic
|
49
49
|
|
@@ -51,11 +51,11 @@ Atau memasang sendiri sebagai:
|
|
51
51
|
|
52
52
|
## Penggunaan
|
53
53
|
|
54
|
-
Permata ini menyediakan
|
54
|
+
Permata ini menyediakan panggilan yang boleh dipanggil `translatomatic`. The `translatomatic` Perintah mempunyai beberapa fungsi, tidak semua didokumentasikan di sini. Untuk bantuan arahan dan pilihan yang ada, laksanakan:
|
55
55
|
|
56
56
|
$ translatomatic help
|
57
57
|
|
58
|
-
Dan untuk
|
58
|
+
Dan untuk membantu arahan, jalankan:
|
59
59
|
|
60
60
|
$ translatomatic translate help
|
61
61
|
$ translatomatic translate help file
|
@@ -64,39 +64,39 @@ Dan untuk bantuan tentang arahan, melaksanakan:
|
|
64
64
|
|
65
65
|
## Persediaan
|
66
66
|
|
67
|
-
|
67
|
+
Semak penyedia dan opsyen terjemahan yang tersedia dengan `providers` arahan:
|
68
68
|
|
69
|
-
$ translatomatic
|
69
|
+
$ translatomatic providers
|
70
70
|
|
71
|
-
Pilihan boleh
|
71
|
+
Pilihan boleh ditentukan pada baris perintah, dalam pembolehubah persekitaran, atau dalam fail konfigurasi translatomatik. Fail konfigurasi boleh diubah suai menggunakan dalaman translatomatik `config` perintah. Untuk menyenaraikan semua tetapan konfigurasi yang ada, gunakan:
|
72
72
|
|
73
73
|
$ translatomatic config list
|
74
74
|
$ translatomatic config describe
|
75
75
|
|
76
|
-
Pilihan boleh ditetapkan pada
|
76
|
+
Pilihan boleh ditetapkan pada tahap pengguna atau tahap projek. Lihat juga bahagian Konfigurasi di bawah untuk maklumat lanjut.
|
77
77
|
|
78
78
|
* * *
|
79
79
|
|
80
|
-
##
|
80
|
+
## Menterjemah fail
|
81
81
|
|
82
|
-
|
82
|
+
Semasa menterjemah fail, `translatomatic` menterjemahkan teks satu kalimat atau frasa pada satu masa. Sekiranya fail diterjemahkan semula, hanya kalimat yang telah berubah sejak penterjemahan terakhir dihantar kepada penyedia terjemahan, dan selebihnya diperoleh daripada pangkalan data setempat.
|
83
83
|
|
84
|
-
Untuk
|
84
|
+
Untuk menterjemah fail sifat Java ke bahasa Jerman dan Perancis menggunakan pembekal Google:
|
85
85
|
|
86
|
-
$ translatomatic translate file --
|
86
|
+
$ translatomatic translate file --provider Google strings.properties de,fr
|
87
87
|
|
88
|
-
Ini akan
|
88
|
+
Ini akan mencipta (atau menulis semula) `strings_de.properties` dan `strings_fr.properties` dengan sifat yang diterjemahkan.
|
89
89
|
|
90
|
-
### Memaparkan
|
90
|
+
### Memaparkan rentetan daripada sekumpulan sumber
|
91
91
|
|
92
|
-
Untuk membaca dan memaparkan `store.description` dan `store.name` sifat dari sumber
|
92
|
+
Untuk membaca dan memaparkan `store.description` dan `store.name` sifat dari fail sumber tempatan dalam bahasa Inggeris, Jerman, dan Perancis:
|
93
93
|
|
94
94
|
$ translatomatic display --locales=en,de,fr \
|
95
95
|
resources/strings.properties store.description store.name
|
96
96
|
|
97
|
-
###
|
97
|
+
### Mengeluarkan tali daripada fail sumber
|
98
98
|
|
99
|
-
Untuk mengekstrak rentetan daripada fail sumber, gunakan
|
99
|
+
Untuk mengekstrak rentetan daripada fail sumber, gunakan `strings` perintah, contohnya
|
100
100
|
|
101
101
|
$ translatomatic strings file.rb
|
102
102
|
|
@@ -104,7 +104,7 @@ Untuk mengekstrak rentetan daripada fail sumber, gunakan dalam `strings` arahan,
|
|
104
104
|
|
105
105
|
## Menukar fail
|
106
106
|
|
107
|
-
Translatomatic boleh digunakan untuk menukar fail dari satu format
|
107
|
+
Translatomatic boleh digunakan untuk menukar fail dari satu format ke format lain. Sebagai contoh, untuk menukar fail sifat Java ke fail rentetan XCode:
|
108
108
|
|
109
109
|
$ translatomatic convert strings.properties Localization.strings
|
110
110
|
|
@@ -112,35 +112,39 @@ Translatomatic boleh digunakan untuk menukar fail dari satu format yang lain. Co
|
|
112
112
|
|
113
113
|
## Konfigurasi
|
114
114
|
|
115
|
-
|
115
|
+
Tetapan tatarajah boleh dibaca dan ditulis dengan menggunakan `config get` dan `config set` arahan. Translatomatic menggunakan fail konfigurasi pengguna pada `$HOME/.translatomatic/config.yml`, dan secara pilihan satu fail konfigurasi projek `$PROJECT_DIR/.translatomatic/config.yml`.
|
116
116
|
|
117
|
-
|
117
|
+
The `--user` dan `--project` pilihan boleh digunakan untuk memberitahu arahan untuk membaca atau menulis kepada `user` atau `project` konfigurasi.
|
118
118
|
|
119
|
-
|
119
|
+
Pengaturan konfigurasi dibaca dari pembolehubah persekitaran, fail konfigurasi pengguna, fail konfigurasi projek (jika ada), dan dari baris arahan. Nilai terakhir yang dijumpai lebih tinggi daripada nilai yang dibaca sebelum ini.
|
120
|
+
|
121
|
+
Apabila menulis kepada konfigurasi dengan `config set` Perintah, nilai baru ditulis pada fail konfigurasi projek apabila dilaksanakan dalam projek yang mengandungi fail konfigurasi translatomatic, atau fail konfigurasi pengguna jika tidak ada fail konfigurasi projek.
|
120
122
|
|
121
|
-
|
123
|
+
### Contoh konfigurasi translatomatik
|
124
|
+
|
125
|
+
Untuk menetapkan `google_api_key` dalam fail konfigurasi pengguna, gunakan:
|
122
126
|
|
123
|
-
|
127
|
+
$ translatomatic config set google_api_key value --user
|
124
128
|
|
125
|
-
|
129
|
+
Untuk menetapkan satu atau lebih banyak perkhidmatan penterjemahan untuk digunakan:
|
126
130
|
|
127
|
-
|
131
|
+
$ translatomatic config set provider Microsoft,Yandex
|
128
132
|
|
129
|
-
Untuk menetapkan senarai
|
133
|
+
Untuk menetapkan senarai lalai bagi sasaran:
|
130
134
|
|
131
135
|
$ translatomatic config set target_locales en,de,es,fr,it
|
132
136
|
|
133
|
-
Dengan `target_locales`
|
137
|
+
Dengan `target_locales` tetapkan, fail boleh diterjemahkan tanpa menentukan sasaran lokasi dalam `translate file` perintah.
|
134
138
|
|
135
139
|
$ translatomatic translate file resources/strings.properties
|
136
140
|
|
137
|
-
Untuk memaparkan konfigurasi semasa,
|
141
|
+
Untuk memaparkan konfigurasi semasa, jalankan:
|
138
142
|
|
139
143
|
$ translatomatic config list
|
140
144
|
|
141
|
-
###
|
145
|
+
### Konfigurasi pangkalan data
|
142
146
|
|
143
|
-
|
147
|
+
Secara lalai, `translatomatic` menggunakan pangkalan data sqlite3 dalam `$HOME/.translatomatic/translatomatic.sqlite3` untuk menyimpan tali yang diterjemahkan. Konfigurasi pangkalan data boleh diubah dengan membuat a `database.yml` fail di bawah `$HOME/.translatomatic/database.yml` untuk `production` persekitaran, contohnya
|
144
148
|
|
145
149
|
production:
|
146
150
|
adapter: mysql2
|
@@ -148,6 +152,7 @@ Oleh lalai, `translatomatic` menggunakan sqlite3 dalam `$HOME/.translatomatic/tr
|
|
148
152
|
database: translatomatic
|
149
153
|
pool: 5
|
150
154
|
encoding: utf8
|
155
|
+
collation: utf8_bin
|
151
156
|
username: username
|
152
157
|
password: password
|
153
158
|
|
@@ -155,18 +160,18 @@ Oleh lalai, `translatomatic` menggunakan sqlite3 dalam `$HOME/.translatomatic/tr
|
|
155
160
|
|
156
161
|
## Menyumbang
|
157
162
|
|
158
|
-
Laporan
|
163
|
+
Laporan pepijat dan permintaan tarik dialu-alukan di GitHub di https://github.com/smugglys/translatomatic. Projek ini bertujuan untuk menjadi ruang yang selamat, mesra untuk kerjasama, dan penyumbang dijangka mematuhi [Perjanjian Penyumbang](http://contributor-covenant.org) kod tatalaku.
|
159
164
|
|
160
165
|
* * *
|
161
166
|
|
162
167
|
## Lesen
|
163
168
|
|
164
|
-
Permata
|
169
|
+
Permata ini tersedia sebagai sumber terbuka di bawah terma [Lesen MIT](https://opensource.org/licenses/MIT).
|
165
170
|
|
166
171
|
* * *
|
167
172
|
|
168
173
|
## Tatakelakuan
|
169
174
|
|
170
|
-
Semua orang berinteraksi dengan
|
175
|
+
Semua orang yang berinteraksi dengan kod bahasa projek Translatomatic, mengeluarkan pelacak, bilik sembang dan senarai mel diharapkan akan mengikuti [kod tatalaku](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
|
171
176
|
|
172
|
-
|
177
|
+
_Dibuat oleh Translatomatic 0.1.3 Tue, 06 Feb 2018 22:18:25 +1030 https://github.com/smugglys/translatomatic_
|