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.it.md
CHANGED
@@ -2,38 +2,38 @@
|
|
2
2
|
|
3
3
|
# Translatomatic
|
4
4
|
|
5
|
-
|
5
|
+
Traduce i file di testo da una lingua all'altra o da un formato all'altro. I seguenti formati di file sono attualmente supportati:
|
6
6
|
|
7
|
-
| Formato
|
7
|
+
| Formato del file | estensioni |
|
8
8
|
| --- | --- |
|
9
9
|
| [Proprietà](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
10
|
| File di risorse di Windows | `.resw, .resx` |
|
11
|
-
| [Elenchi di proprietà](https://en.wikipedia.org/wiki/Property_list) (OSX
|
11
|
+
| [Elenchi di proprietà](https://en.wikipedia.org/wiki/Property_list) (Pliste di OSX) | `.plist` |
|
12
12
|
| [File PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
13
|
-
| [XCode
|
13
|
+
| [Stringhe XCode](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
14
14
|
| [YAML](http://yaml.org/) | `.yaml` |
|
15
15
|
| Sottotitoli | `.srt, .ass, .ssa` |
|
16
16
|
| HTML | `.html, .htm, .shtml` |
|
17
17
|
| XML | `.xml` |
|
18
|
-
| [
|
19
|
-
|
|
18
|
+
| [riduione di prezzo](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
19
|
+
| File di testo | `.txt` |
|
20
20
|
| File CSV | `.csv` |
|
21
21
|
|
22
|
-
|
22
|
+
I seguenti provider di traduzione possono essere utilizzati con 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
|
+
- [La mia memoria](https://mymemory.translated.net/doc/)
|
28
28
|
- [Frengly](http://www.frengly.com/api)
|
29
29
|
|
30
|
-
|
30
|
+
Le stringhe tradotte vengono salvate in un database e riutilizzate.
|
31
31
|
|
32
32
|
* * *
|
33
33
|
|
34
|
-
|
34
|
+
## Installazione
|
35
35
|
|
36
|
-
|
36
|
+
Aggiungi questa linea alle tue applicazioni `Gemfile`:
|
37
37
|
|
38
38
|
`ruby
|
39
39
|
gem 'translatomatic'
|
@@ -43,104 +43,108 @@ E poi eseguire:
|
|
43
43
|
|
44
44
|
$ bundle
|
45
45
|
|
46
|
-
|
46
|
+
Oppure installalo tu stesso come:
|
47
47
|
|
48
48
|
$ gem install translatomatic
|
49
49
|
|
50
50
|
* * *
|
51
51
|
|
52
|
-
|
52
|
+
## Utilizzo
|
53
53
|
|
54
|
-
|
54
|
+
Questa gemma fornisce un eseguibile chiamato `translatomatic`. Il `translatomatic` il comando ha un numero di funzioni, non tutte documentate qui. Per assistenza su comandi e opzioni disponibili, eseguire:
|
55
55
|
|
56
56
|
$ translatomatic help
|
57
57
|
|
58
|
-
E per
|
58
|
+
E per aiuto su un comando, esegui:
|
59
59
|
|
60
60
|
$ translatomatic translate help
|
61
61
|
$ translatomatic translate help file
|
62
62
|
|
63
63
|
* * *
|
64
64
|
|
65
|
-
|
65
|
+
## Impostare
|
66
66
|
|
67
|
-
|
67
|
+
Controlla i fornitori di servizi di traduzione disponibili e le opzioni con `providers` comando:
|
68
68
|
|
69
|
-
$ translatomatic
|
69
|
+
$ translatomatic providers
|
70
70
|
|
71
|
-
|
71
|
+
Le opzioni possono essere specificate sulla riga di comando, nelle variabili di ambiente o nei file di configurazione di translatomatic. I file di configurazione possono essere modificati usando l'interno di translatomatic `config` comando. Per elencare tutte le impostazioni di configurazione disponibili, utilizzare:
|
72
72
|
|
73
73
|
$ translatomatic config list
|
74
74
|
$ translatomatic config describe
|
75
75
|
|
76
|
-
|
76
|
+
Le opzioni possono essere impostate a livello di utente o di progetto. Vedi anche la sezione Configurazione di seguito per maggiori informazioni.
|
77
77
|
|
78
78
|
* * *
|
79
79
|
|
80
|
-
|
80
|
+
## Tradurre i file
|
81
81
|
|
82
|
-
Quando si
|
82
|
+
Quando si traducono i file, `translatomatic` traduce il testo una frase o frase alla volta. Se un file viene tradotto nuovamente, solo le frasi che sono state modificate dall'ultima traduzione vengono inviate al fornitore di traduzioni e il resto viene estratto dal database locale.
|
83
83
|
|
84
|
-
Per tradurre un file di proprietà Java in tedesco e francese utilizzando il
|
84
|
+
Per tradurre un file di proprietà Java in tedesco e francese utilizzando il fornitore di Google:
|
85
85
|
|
86
|
-
$ translatomatic translate file --
|
86
|
+
$ translatomatic translate file --provider Google strings.properties de,fr
|
87
87
|
|
88
|
-
Questo
|
88
|
+
Questo creerebbe (o sovrascriverà) `strings_de.properties` e `strings_fr.properties` con proprietà tradotte.
|
89
89
|
|
90
90
|
### Visualizzazione di stringhe da un pacchetto di risorse
|
91
91
|
|
92
|
-
Per leggere e visualizzare il `store.description` e `store.name` proprietà
|
92
|
+
Per leggere e visualizzare il `store.description` e `store.name` proprietà da file di risorse locali in inglese, tedesco e francese:
|
93
93
|
|
94
94
|
$ translatomatic display --locales=en,de,fr \
|
95
95
|
resources/strings.properties store.description store.name
|
96
96
|
|
97
|
-
###
|
97
|
+
### Estrazione di stringhe dai file di origine
|
98
98
|
|
99
|
-
Per estrarre le stringhe
|
99
|
+
Per estrarre le stringhe dai file di origine, utilizzare il `strings` comando, ad es
|
100
100
|
|
101
101
|
$ translatomatic strings file.rb
|
102
102
|
|
103
103
|
* * *
|
104
104
|
|
105
|
-
|
105
|
+
## Conversione di file
|
106
106
|
|
107
|
-
Translatomatic può essere utilizzato per convertire file da un formato
|
107
|
+
Translatomatic può essere utilizzato per convertire file da un formato all'altro. Ad esempio, per convertire un file di proprietà Java in un file di stringhe XCode:
|
108
108
|
|
109
109
|
$ translatomatic convert strings.properties Localization.strings
|
110
110
|
|
111
111
|
* * *
|
112
112
|
|
113
|
-
|
113
|
+
## Configurazione
|
114
114
|
|
115
|
-
|
115
|
+
Le impostazioni di configurazione possono essere lette e scritte usando il `config get` e `config set` comandi. Translatomatic utilizza un file di configurazione utente su `$HOME/.translatomatic/config.yml`e facoltativamente un file di configurazione per progetto `$PROJECT_DIR/.translatomatic/config.yml`.
|
116
116
|
|
117
|
-
|
117
|
+
Il `--user` e `--project` le opzioni possono essere utilizzate per dire al comando di leggere o scrivere su `user` o `project` configurazione.
|
118
118
|
|
119
|
-
|
119
|
+
Le impostazioni di configurazione vengono lette dalle variabili di ambiente, dal file di configurazione utente, dal file di configurazione del progetto (se presente) e dalla riga di comando. L'ultimo valore trovato ha la precedenza sui valori letti in precedenza.
|
120
120
|
|
121
|
-
|
121
|
+
Quando si scrive sulla configurazione con `config set` comando, il nuovo valore viene scritto nel file di configurazione del progetto quando viene eseguito all'interno di un progetto contenente un file di configurazione translatomatico o il file di configurazione utente se non esiste un file di configurazione del progetto.
|
122
122
|
|
123
|
-
|
123
|
+
### Esempi di configurazione traslatomica
|
124
|
+
|
125
|
+
Impostare `google_api_key` all'interno del file di configurazione utente, utilizzare:
|
124
126
|
|
125
|
-
$ translatomatic config set
|
127
|
+
$ translatomatic config set google_api_key value --user
|
128
|
+
|
129
|
+
Per impostare uno o più servizi di traduzione da utilizzare:
|
126
130
|
|
127
|
-
|
131
|
+
$ translatomatic config set provider Microsoft,Yandex
|
128
132
|
|
129
|
-
Per impostare un elenco predefinito
|
133
|
+
Per impostare un elenco predefinito di impostazioni locali di destinazione:
|
130
134
|
|
131
135
|
$ translatomatic config set target_locales en,de,es,fr,it
|
132
136
|
|
133
|
-
Con `target_locales`
|
137
|
+
Con `target_locales` set, i file possono essere tradotti senza specificare localizzazioni di destinazione nel file `translate file` comando.
|
134
138
|
|
135
139
|
$ translatomatic translate file resources/strings.properties
|
136
140
|
|
137
|
-
Per visualizzare la configurazione corrente, eseguire
|
141
|
+
Per visualizzare la configurazione corrente, eseguire:
|
138
142
|
|
139
143
|
$ translatomatic config list
|
140
144
|
|
141
145
|
### Configurazione del database
|
142
146
|
|
143
|
-
|
147
|
+
Di default, `translatomatic` utilizza un database sqlite3 in `$HOME/.translatomatic/translatomatic.sqlite3` per memorizzare stringhe tradotte. La configurazione del database può essere modificata creando un `database.yml` file sotto `$HOME/.translatomatic/database.yml` per il `production` ambiente, ad es
|
144
148
|
|
145
149
|
production:
|
146
150
|
adapter: mysql2
|
@@ -148,25 +152,26 @@ Per impostazione predefinita, `translatomatic` utilizza un database sqlite3 in `
|
|
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
|
+
## Contribuire
|
157
162
|
|
158
|
-
|
163
|
+
Segnalazioni di bug e richieste di pull sono benvenute su GitHub all'indirizzo https://github.com/smugglys/translatomatic. Questo progetto vuole essere uno spazio sicuro e accogliente per la collaborazione e ci si aspetta che i contributori aderiscano al [Patto del collaboratore](http://contributor-covenant.org) codice di condotta.
|
159
164
|
|
160
165
|
* * *
|
161
166
|
|
162
|
-
|
167
|
+
## Licenza
|
163
168
|
|
164
|
-
|
169
|
+
La gemma è disponibile come open source secondo i termini di [Licenza MIT](https://opensource.org/licenses/MIT).
|
165
170
|
|
166
171
|
* * *
|
167
172
|
|
168
|
-
|
173
|
+
## Codice di condotta
|
169
174
|
|
170
|
-
|
175
|
+
Si prevede che tutti coloro che interagiscono con le basi di codice del progetto Translatomatic, gli inseguitori di problemi, le chat room e le mailing list seguano il [codice di condotta](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
|
171
176
|
|
172
|
-
_Creato da Translatomatic 0.1.
|
177
|
+
_Creato da Translatomatic 0.1.3 Tue, 06 Feb 2018 22:18:17 +1030 https://github.com/smugglys/translatomatic_
|
data/README.ja.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
|
-
| [
|
10
|
-
| Windows
|
11
|
-
| [
|
12
|
-
| [PO
|
13
|
-
| [XCode
|
9
|
+
| [プロパティ](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
|
+
| Windowsリソースファイル | `.resw, .resx` |
|
11
|
+
| [プロパティリスト](https://en.wikipedia.org/wiki/Property_list) (OSX plist) | `.plist` |
|
12
|
+
| [POファイル](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
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
|
-
| CSV
|
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` 一度に1つの文または句を翻訳します。 ファイルが再翻訳されると、最後の翻訳後に変更された文のみが翻訳プロバイダに送信され、残りはローカルデータベースから供給されます。
|
83
83
|
|
84
|
-
|
84
|
+
Googleプロバイダを使用してJavaプロパティファイルをドイツ語とフランス語に翻訳するには:
|
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
|
-
Translatomatic
|
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
|
+
使用する翻訳サービスを1つ以上設定するには:
|
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
|
-
と `target_locales`
|
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/.translatoma
|
|
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
|
-
|
177
|
+
_作成された Translatomatic 0.1.3 Tue, 06 Feb 2018 22:18:20 +1030 https://github.com/smugglys/translatomatic_
|