translatomatic 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.translatomatic/config.yml +18 -0
- data/.travis.yml +33 -33
- data/Gemfile +6 -4
- data/README.de.md +53 -18
- data/README.es.md +55 -20
- data/README.fr.md +54 -19
- data/README.it.md +58 -23
- data/README.ja.md +54 -19
- data/README.ko.md +58 -23
- data/README.md +167 -141
- data/README.ms.md +51 -16
- data/README.pt.md +58 -23
- data/README.ru.md +53 -18
- data/README.sv.md +53 -18
- data/README.zh.md +53 -18
- data/bin/translatomatic +6 -6
- data/bin/travis +24 -26
- data/config/locales/translatomatic/de.yml +22 -11
- data/config/locales/translatomatic/en.yml +21 -12
- data/config/locales/translatomatic/es.yml +22 -11
- data/config/locales/translatomatic/fr.yml +22 -12
- data/config/locales/translatomatic/it.yml +22 -11
- data/config/locales/translatomatic/ja.yml +22 -11
- data/config/locales/translatomatic/ko.yml +22 -11
- data/config/locales/translatomatic/ms.yml +22 -11
- data/config/locales/translatomatic/pt.yml +22 -11
- data/config/locales/translatomatic/ru.yml +22 -11
- data/config/locales/translatomatic/sv.yml +22 -11
- data/config/locales/translatomatic/zh.yml +22 -11
- data/db/migrate/201712170000_initial.rb +25 -25
- data/lib/translatomatic/cli/base.rb +81 -73
- data/lib/translatomatic/cli/config.rb +110 -81
- data/lib/translatomatic/cli/main.rb +85 -72
- data/lib/translatomatic/cli/translate.rb +141 -106
- data/lib/translatomatic/cli.rb +8 -8
- data/lib/translatomatic/config.rb +302 -155
- data/lib/translatomatic/converter.rb +28 -260
- data/lib/translatomatic/database.rb +134 -134
- data/lib/translatomatic/define_options.rb +22 -0
- data/lib/translatomatic/escaped_unicode.rb +0 -0
- data/lib/translatomatic/extractor/base.rb +16 -16
- data/lib/translatomatic/extractor/ruby.rb +6 -6
- data/lib/translatomatic/extractor.rb +5 -5
- data/lib/translatomatic/file_translator.rb +269 -0
- data/lib/translatomatic/http_request.rb +162 -162
- data/lib/translatomatic/locale.rb +76 -76
- data/lib/translatomatic/logger.rb +23 -23
- data/lib/translatomatic/model/locale.rb +25 -25
- data/lib/translatomatic/model/text.rb +19 -19
- data/lib/translatomatic/model.rb +1 -1
- data/lib/translatomatic/option.rb +37 -41
- data/lib/translatomatic/progress_updater.rb +13 -13
- data/lib/translatomatic/resource_file/base.rb +269 -192
- data/lib/translatomatic/resource_file/csv.rb +37 -0
- data/lib/translatomatic/resource_file/html.rb +54 -47
- data/lib/translatomatic/resource_file/markdown.rb +50 -55
- data/lib/translatomatic/resource_file/plist.rb +153 -19
- data/lib/translatomatic/resource_file/po.rb +107 -0
- data/lib/translatomatic/resource_file/properties.rb +91 -90
- data/lib/translatomatic/resource_file/resw.rb +50 -30
- data/lib/translatomatic/resource_file/subtitle.rb +75 -0
- data/lib/translatomatic/resource_file/text.rb +24 -30
- data/lib/translatomatic/resource_file/xcode_strings.rb +75 -80
- data/lib/translatomatic/resource_file/xml.rb +98 -91
- data/lib/translatomatic/resource_file/yaml.rb +94 -116
- data/lib/translatomatic/resource_file.rb +87 -78
- data/lib/translatomatic/string.rb +188 -188
- data/lib/translatomatic/tmx/document.rb +99 -99
- data/lib/translatomatic/translation_result.rb +63 -63
- data/lib/translatomatic/{converter_stats.rb → translation_stats.rb} +17 -17
- data/lib/translatomatic/translator/base.rb +1 -1
- data/lib/translatomatic/translator/google.rb +2 -0
- data/lib/translatomatic/translator.rb +10 -2
- data/lib/translatomatic/util.rb +45 -45
- data/lib/translatomatic/version.rb +7 -7
- data/lib/translatomatic.rb +52 -49
- data/translatomatic.gemspec +3 -2
- metadata +25 -5
data/README.md
CHANGED
@@ -1,141 +1,167 @@
|
|
1
|
-
[![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/translatomatic)
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/translatomatic.svg)](https://badge.fury.io/rb/translatomatic)
|
3
|
-
[![Build Status](https://travis-ci.org/smugglys/translatomatic.svg?branch=master)](https://travis-ci.org/smugglys/translatomatic)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/smugglys/translatomatic.svg)](https://codeclimate.com/github/smugglys/translatomatic)
|
5
|
-
|
6
|
-
# Translatomatic
|
7
|
-
|
8
|
-
Translates text files from one language to another. The following file formats
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
* [
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
$ translatomatic
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
To
|
84
|
-
|
85
|
-
$ translatomatic
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
###
|
97
|
-
|
98
|
-
To
|
99
|
-
|
100
|
-
$ translatomatic
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
1
|
+
[![Documentation](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/translatomatic)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/translatomatic.svg)](https://badge.fury.io/rb/translatomatic)
|
3
|
+
[![Build Status](https://travis-ci.org/smugglys/translatomatic.svg?branch=master)](https://travis-ci.org/smugglys/translatomatic)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/smugglys/translatomatic.svg)](https://codeclimate.com/github/smugglys/translatomatic)
|
5
|
+
|
6
|
+
# Translatomatic
|
7
|
+
|
8
|
+
Translates text files from one language to another, or from one format to another. The following file formats are currently supported:
|
9
|
+
|
10
|
+
| File format | Extensions |
|
11
|
+
|---|---|
|
12
|
+
| [Properties](https://en.wikipedia.org/wiki/.properties)| `.properties`|
|
13
|
+
| Windows resource files | `.resw, .resx` |
|
14
|
+
| [Property lists](https://en.wikipedia.org/wiki/Property_list) (OSX plist) | `.plist` |
|
15
|
+
| [PO files](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
16
|
+
| [XCode strings](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
17
|
+
| [YAML](http://yaml.org/) | `.yaml` |
|
18
|
+
| Subtitles | `.srt, .ass, .ssa` |
|
19
|
+
| HTML | `.html, .htm, .shtml` |
|
20
|
+
| XML | `.xml` |
|
21
|
+
| [Markdown](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
22
|
+
| Text files | `.txt` |
|
23
|
+
| CSV files | `.csv` |
|
24
|
+
|
25
|
+
The following translation APIs can be used with Translatomatic:
|
26
|
+
|
27
|
+
* [Google](https://cloud.google.com/translate/)
|
28
|
+
* [Microsoft](https://www.microsoft.com/en-us/translator/translatorapi.aspx)
|
29
|
+
* [Yandex](https://tech.yandex.com/translate/)
|
30
|
+
* [MyMemory](https://mymemory.translated.net/doc/)
|
31
|
+
* [Frengly](http://www.frengly.com/api)
|
32
|
+
|
33
|
+
Translated strings are saved in a database and reused.
|
34
|
+
|
35
|
+
---
|
36
|
+
## Installation
|
37
|
+
|
38
|
+
Add this line to your application's `Gemfile`:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
gem 'translatomatic'
|
42
|
+
```
|
43
|
+
|
44
|
+
And then execute:
|
45
|
+
|
46
|
+
$ bundle
|
47
|
+
|
48
|
+
Or install it yourself as:
|
49
|
+
|
50
|
+
$ gem install translatomatic
|
51
|
+
|
52
|
+
---
|
53
|
+
## Usage
|
54
|
+
|
55
|
+
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:
|
56
|
+
|
57
|
+
$ translatomatic help
|
58
|
+
|
59
|
+
And for help on a command, execute:
|
60
|
+
|
61
|
+
$ translatomatic translate help
|
62
|
+
$ translatomatic translate help file
|
63
|
+
|
64
|
+
---
|
65
|
+
## Setup
|
66
|
+
|
67
|
+
Check for available translation services and options with the `services` command:
|
68
|
+
|
69
|
+
$ translatomatic services
|
70
|
+
|
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
|
+
|
73
|
+
$ translatomatic config list
|
74
|
+
$ translatomatic config describe
|
75
|
+
|
76
|
+
Options can be set at the user level or the project level. See also the Configuration section below for more information.
|
77
|
+
|
78
|
+
---
|
79
|
+
## Translating files
|
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 translator, and the rest are sourced from the local database.
|
82
|
+
|
83
|
+
To translate a Java properties file to German and French using the Google translator:
|
84
|
+
|
85
|
+
$ translatomatic translate file --translator Google strings.properties de,fr
|
86
|
+
|
87
|
+
This would create (or overwrite) `strings_de.properties` and `strings_fr.properties` with translated properties.
|
88
|
+
|
89
|
+
### Displaying strings from a resource bundle
|
90
|
+
|
91
|
+
To read and display the `store.description` and `store.name` properties from local resource files in English, German, and French:
|
92
|
+
|
93
|
+
$ translatomatic display --locales=en,de,fr \
|
94
|
+
resources/strings.properties store.description store.name
|
95
|
+
|
96
|
+
### Extracting strings from source files
|
97
|
+
|
98
|
+
To extract strings from source files, use the `strings` command, e.g.
|
99
|
+
|
100
|
+
$ translatomatic strings file.rb
|
101
|
+
|
102
|
+
---
|
103
|
+
## Converting files
|
104
|
+
|
105
|
+
Translatomatic can be used to convert files from one format to another.
|
106
|
+
For example, to convert a Java properties file to an XCode strings file:
|
107
|
+
|
108
|
+
$ translatomatic convert strings.properties Localization.strings
|
109
|
+
|
110
|
+
---
|
111
|
+
## Configuration
|
112
|
+
|
113
|
+
Translatomatic has a per-user configuration file at `$HOME/.translatomatic/config.yml`, and optionally a per project configuration file `$PROJECT_DIR/.translatomatic/config.yml`. The `translatomatic config set` command operates on the project level configuration when executed within a project containing a translatomatic configuration file. Otherwise the user level configuration file is changed. The `--context` option can be used to specify `user` or `project` level configuration. The effective value of a configuration option is determined by reading from the environment, the user level configuration file, the project level configuration file (if present), and from the command line. The last value found takes precedence over values read earlier.
|
114
|
+
|
115
|
+
### Translatomatic configuration examples
|
116
|
+
|
117
|
+
To set `google_api_key` within the user configuration file, use:
|
118
|
+
|
119
|
+
$ translatomatic config set google_api_key value --context user
|
120
|
+
|
121
|
+
To set one or more translation services to use:
|
122
|
+
|
123
|
+
$ translatomatic config set translator Microsoft,Yandex
|
124
|
+
|
125
|
+
Secondary translators will only be used if a translation error occurs when using the first choice.
|
126
|
+
|
127
|
+
To set a default list of target locales:
|
128
|
+
|
129
|
+
$ translatomatic config set target_locales en,de,es,fr,it
|
130
|
+
|
131
|
+
With `target_locales` set, files can be translated without specifying target locales in the `translate file` command.
|
132
|
+
|
133
|
+
$ translatomatic translate file resources/strings.properties
|
134
|
+
|
135
|
+
To display the current configuration, execute
|
136
|
+
|
137
|
+
$ translatomatic config list
|
138
|
+
|
139
|
+
### Database configuration
|
140
|
+
|
141
|
+
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
|
+
The database configuration can be changed by creating a `database.yml` file under `$HOME/.translatomatic/database.yml` for the `production` environment, e.g.
|
144
|
+
|
145
|
+
production:
|
146
|
+
adapter: mysql2
|
147
|
+
host: db.example.com
|
148
|
+
database: translatomatic
|
149
|
+
pool: 5
|
150
|
+
encoding: utf8
|
151
|
+
username: username
|
152
|
+
password: password
|
153
|
+
|
154
|
+
---
|
155
|
+
## Contributing
|
156
|
+
|
157
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/smugglys/translatomatic. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
158
|
+
|
159
|
+
---
|
160
|
+
## License
|
161
|
+
|
162
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
163
|
+
|
164
|
+
---
|
165
|
+
## Code of Conduct
|
166
|
+
|
167
|
+
Everyone interacting with the Translatomatic project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/smugglys/translatomatic/blob/master/CODE_OF_CONDUCT.md).
|
data/README.ms.md
CHANGED
@@ -2,17 +2,22 @@
|
|
2
2
|
|
3
3
|
# Translatomatic
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
Menterjemahkan teks fail dari satu bahasa yang lain, atau dari satu format yang lain. Format fail berikut disokong buat masa ini:
|
6
|
+
|
7
|
+
| Format fail | Sambungan |
|
8
|
+
| --- | --- |
|
9
|
+
| [Sifat](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
|
+
| Fail sumber Windows | `.resw, .resx` |
|
11
|
+
| [Harta senarai](https://en.wikipedia.org/wiki/Property_list) (SELEPAS plist) | `.plist` |
|
12
|
+
| [Fail PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
13
|
+
| [Dan diganti dengan tali](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
14
|
+
| [YAML](http://yaml.org/) | `.yaml` |
|
15
|
+
| Sari kata | `.srt, .ass, .ssa` |
|
16
|
+
| HTML | `.html, .htm, .shtml` |
|
17
|
+
| FAIL | `.xml` |
|
18
|
+
| [Markdown](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
19
|
+
| Fail teks | `.txt` |
|
20
|
+
| Fail CSV | `.csv` |
|
16
21
|
|
17
22
|
Terjemahan berikut api boleh digunakan dengan Translatomatic:
|
18
23
|
|
@@ -24,6 +29,8 @@ Terjemahan berikut api boleh digunakan dengan Translatomatic:
|
|
24
29
|
|
25
30
|
Diterjemahkan tali disimpan dalam pengkalan data dan semula.
|
26
31
|
|
32
|
+
* * *
|
33
|
+
|
27
34
|
## Pemasangan
|
28
35
|
|
29
36
|
Masukkan baris ini untuk anda permohonan `Gemfile`:
|
@@ -40,6 +47,8 @@ Atau memasang sendiri sebagai:
|
|
40
47
|
|
41
48
|
$ gem install translatomatic
|
42
49
|
|
50
|
+
* * *
|
51
|
+
|
43
52
|
## Penggunaan
|
44
53
|
|
45
54
|
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:
|
@@ -51,18 +60,22 @@ Dan untuk bantuan tentang arahan, melaksanakan:
|
|
51
60
|
$ translatomatic translate help
|
52
61
|
$ translatomatic translate help file
|
53
62
|
|
63
|
+
* * *
|
64
|
+
|
54
65
|
## Persediaan
|
55
66
|
|
56
67
|
Menyemak Perkhidmatan penterjemahan tersedia dan dengan itu `services` perintah:
|
57
68
|
|
58
69
|
$ translatomatic services
|
59
70
|
|
60
|
-
Pilihan boleh ditetapkan pada baris arahan, dalam pembolehubah persekitaran, atau dalam fail konfigurasi di translatomatic.
|
71
|
+
Pilihan boleh ditetapkan pada baris arahan, dalam pembolehubah persekitaran, atau dalam fail konfigurasi di translatomatic. Konfigurasi fail boleh diubahsuai menggunakan translatomatic di Dalaman `config` perintah. Untuk menyenaraikan semua tetapan tatarajah tersedia, gunakan:
|
61
72
|
|
62
73
|
$ translatomatic config list
|
63
74
|
$ translatomatic config describe
|
64
75
|
|
65
|
-
Lihat juga Seksyen konfigurasi di bawah untuk maklumat lanjut.
|
76
|
+
Pilihan boleh ditetapkan pada paras pengguna atau peringkat projek. Lihat juga Seksyen konfigurasi di bawah untuk maklumat lanjut.
|
77
|
+
|
78
|
+
* * *
|
66
79
|
|
67
80
|
## Menterjemahkan fail
|
68
81
|
|
@@ -83,14 +96,30 @@ Untuk membaca dan memaparkan `store.description` dan `store.name` sifat dari sum
|
|
83
96
|
|
84
97
|
### Mengekstrak tali dari sumber fail
|
85
98
|
|
86
|
-
Untuk mengekstrak rentetan
|
99
|
+
Untuk mengekstrak rentetan daripada fail sumber, gunakan dalam `strings` arahan, misalnya
|
87
100
|
|
88
101
|
$ translatomatic strings file.rb
|
89
102
|
|
103
|
+
* * *
|
104
|
+
|
105
|
+
## Menukar fail
|
106
|
+
|
107
|
+
Translatomatic boleh digunakan untuk menukar fail dari satu format yang lain. Contohnya, untuk menukar Java yang sifat fail untuk XCode satu tali fail:
|
108
|
+
|
109
|
+
$ translatomatic convert strings.properties Localization.strings
|
110
|
+
|
111
|
+
* * *
|
112
|
+
|
90
113
|
## Konfigurasi
|
91
114
|
|
115
|
+
Translatomatic mempunyai fail konfigurasi setiap pengguna di `$HOME/.translatomatic/config.yml`, dan yang satu fail konfigurasi projek `$PROJECT_DIR/.translatomatic/config.yml`. Dalame `translatomatic config set` Perintah beroperasi pada projek peringkat konfigurasi apabila dilaksanakan dalam sebuah projek yang mengandungi fail tatarajah translatomatic.e. Jika tidak fail tatarajah peringkat pengguna ditukar. The `--context` pilihan boleh digunakan untuk menentukan `user` atau `project` peringkat konfigurasi. Nilai berkesan opsyen konfigurasi ditentukan melalui pembacaan dari alam sekitar, pengguna peringkat Konfigurasi fail, fail konfigurasi tahap projek (jika ada), dan dari baris perintah. Nilai lepas yang mendapati keutamaan berbanding nilai membaca lebih awal.
|
116
|
+
|
92
117
|
### Contoh-contoh tatarajah Translatomatic
|
93
118
|
|
119
|
+
Untuk menetapkan `google_api_key` dalam fail konfigurasi pengguna, gunakan:
|
120
|
+
|
121
|
+
$ translatomatic config set google_api_key value --context user
|
122
|
+
|
94
123
|
Untuk menetapkan satu atau lebih perkhidmatan penterjemahan untuk digunakan:
|
95
124
|
|
96
125
|
$ translatomatic config set translator Microsoft,Yandex
|
@@ -122,16 +151,22 @@ Oleh lalai, `translatomatic` menggunakan sqlite3 dalam `$HOME/.translatomatic/tr
|
|
122
151
|
username: username
|
123
152
|
password: password
|
124
153
|
|
154
|
+
* * *
|
155
|
+
|
125
156
|
## Menyumbang
|
126
157
|
|
127
158
|
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
159
|
|
160
|
+
* * *
|
161
|
+
|
129
162
|
## Lesen
|
130
163
|
|
131
164
|
Permata yang ada sebagai sumber terbuka di bawah segi [MIT Lesen](https://opensource.org/licenses/MIT).
|
132
165
|
|
133
|
-
|
166
|
+
* * *
|
167
|
+
|
168
|
+
## Tatakelakuan
|
134
169
|
|
135
170
|
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
171
|
|
137
|
-
_Dicipta oleh Translatomatic 0.1.
|
172
|
+
_Dicipta oleh Translatomatic 0.1.2 Sat, 06 Jan 2018 22:56:25 +1030_
|
data/README.pt.md
CHANGED
@@ -2,17 +2,22 @@
|
|
2
2
|
|
3
3
|
# Translatomatic
|
4
4
|
|
5
|
-
Converte arquivos de texto de um idioma para outro.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
Converte arquivos de texto de um idioma para outro, ou de um formato para outro. São suportados os seguintes formatos de arquivo:
|
6
|
+
|
7
|
+
| Formato de arquivo | Extensões |
|
8
|
+
| --- | --- |
|
9
|
+
| [Propriedades](https://en.wikipedia.org/wiki/.properties) | `.properties` |
|
10
|
+
| Arquivos de recurso do Windows | `.resw, .resx` |
|
11
|
+
| [Listas de propriedades](https://en.wikipedia.org/wiki/Property_list) (OSX plist) | `.plist` |
|
12
|
+
| [Arquivos PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) | `.po, .pot` |
|
13
|
+
| [XCode cadeias de caracteres](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) | `.strings` |
|
14
|
+
| [YAML](http://yaml.org/) | `.yaml` |
|
15
|
+
| Legendas | `.srt, .ass, .ssa` |
|
16
|
+
| HTML | `.html, .htm, .shtml` |
|
17
|
+
| XML | `.xml` |
|
18
|
+
| [Markdown](https://en.wikipedia.org/wiki/Markdown) | `.md` |
|
19
|
+
| Arquivos de texto | `.txt` |
|
20
|
+
| Arquivos CSV | `.csv` |
|
16
21
|
|
17
22
|
A tradução seguinte APIs pode ser usada com Translatomatic:
|
18
23
|
|
@@ -24,7 +29,9 @@ A tradução seguinte APIs pode ser usada com Translatomatic:
|
|
24
29
|
|
25
30
|
Traduzido seqüências de caracteres são salvos em um banco de dados e reutilizados.
|
26
31
|
|
27
|
-
|
32
|
+
* * *
|
33
|
+
|
34
|
+
# # Instalação
|
28
35
|
|
29
36
|
Adicione esta linha ao seu aplicativo `Gemfile`:
|
30
37
|
|
@@ -40,7 +47,9 @@ Ou instalá-lo a si mesmo como:
|
|
40
47
|
|
41
48
|
$ gem install translatomatic
|
42
49
|
|
43
|
-
|
50
|
+
* * *
|
51
|
+
|
52
|
+
# # Uso
|
44
53
|
|
45
54
|
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
55
|
|
@@ -51,20 +60,24 @@ E para obter ajuda sobre um comando, execute:
|
|
51
60
|
$ translatomatic translate help
|
52
61
|
$ translatomatic translate help file
|
53
62
|
|
54
|
-
|
63
|
+
* * *
|
64
|
+
|
65
|
+
# # Configuração
|
55
66
|
|
56
67
|
Verificar se há serviços de tradução disponíveis e opções com a `services` comando:
|
57
68
|
|
58
69
|
$ translatomatic services
|
59
70
|
|
60
|
-
Opções podem ser especificadas na linha de comando, em variáveis de ambiente, ou
|
71
|
+
Opções podem ser especificadas na linha de comando, em variáveis de ambiente, ou em arquivos de configuração do translatomatic. A configuração de arquivos podem ser modificados usando translatomatic é interna `config` comando. Para listar todas as configurações disponíveis, use:
|
61
72
|
|
62
73
|
$ translatomatic config list
|
63
74
|
$ translatomatic config describe
|
64
75
|
|
65
|
-
Veja também a seção de configuração abaixo para obter mais informações.
|
76
|
+
Opções podem ser definidas no nível do usuário ou o nível de projeto. Veja também a seção de configuração abaixo para obter mais informações.
|
77
|
+
|
78
|
+
* * *
|
66
79
|
|
67
|
-
|
80
|
+
# # Tradução de arquivos
|
68
81
|
|
69
82
|
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
83
|
|
@@ -83,14 +96,30 @@ Para ler e exibir o `store.description` e `store.name` propriedades de arquivos
|
|
83
96
|
|
84
97
|
### A extração de seqüências de caracteres a partir de arquivos de origem
|
85
98
|
|
86
|
-
Para extrair sequências de
|
99
|
+
Para extrair sequências de caracteres de arquivos de origem, use o `strings` comando, por exemplo
|
87
100
|
|
88
101
|
$ translatomatic strings file.rb
|
89
102
|
|
90
|
-
|
103
|
+
* * *
|
104
|
+
|
105
|
+
# # Convertendo arquivos
|
106
|
+
|
107
|
+
Translatomatic pode ser usado para converter arquivos de um formato para outro. Por exemplo, para converter um Java arquivo de propriedades para um XCode cadeias de arquivo:
|
108
|
+
|
109
|
+
$ translatomatic convert strings.properties Localization.strings
|
110
|
+
|
111
|
+
* * *
|
112
|
+
|
113
|
+
# # Configuração
|
114
|
+
|
115
|
+
Translatomatic tem um arquivo de configuração por usuário no `$HOME/.translatomatic/config.yml`e, opcionalmente, um por arquivo de configuração do projeto `$PROJECT_DIR/.translatomatic/config.yml`. Oe `translatomatic config set` comando funciona com a configuração de nível de projeto quando executada dentro de um projeto que contém um arquivo de configuração translatomatic.aso contrário, o arquivo de configuração de nível de usuário é alterado. The `--context` opção pode ser usada para especificar `user` ou `project` configuração de nível. O valor efetivo de uma opção de configuração é determinado pela leitura do ambiente, o arquivo de configuração de nível de usuário, o arquivo de configuração de nível de projeto (se houver) e na linha de comando. O último valor encontrado tem precedência sobre valores lidos anteriormente.
|
91
116
|
|
92
117
|
### Translatomatic exemplos de configuração
|
93
118
|
|
119
|
+
Para definir `google_api_key` dentro do arquivo de configuração de usuário, use:
|
120
|
+
|
121
|
+
$ translatomatic config set google_api_key value --context user
|
122
|
+
|
94
123
|
Para definir um ou mais serviços de tradução para usar:
|
95
124
|
|
96
125
|
$ translatomatic config set translator Microsoft,Yandex
|
@@ -122,16 +151,22 @@ Por padrão, `translatomatic` usa um banco de dados sqlite3 no `$HOME/.translato
|
|
122
151
|
username: username
|
123
152
|
password: password
|
124
153
|
|
125
|
-
|
154
|
+
* * *
|
155
|
+
|
156
|
+
# # Contribuindo
|
126
157
|
|
127
158
|
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
159
|
|
129
|
-
|
160
|
+
* * *
|
161
|
+
|
162
|
+
# # Licença
|
130
163
|
|
131
164
|
A jóia está disponível como código aberto sob os termos da [Licença MIT](https://opensource.org/licenses/MIT).
|
132
165
|
|
133
|
-
|
166
|
+
* * *
|
167
|
+
|
168
|
+
# # Código de conduta
|
134
169
|
|
135
170
|
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
171
|
|
137
|
-
_Criado por Translatomatic 0.1.
|
172
|
+
_Criado por Translatomatic 0.1.2 Sat, 06 Jan 2018 22:56:26 +1030_
|