translatomatic 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.translatomatic/config.yml +18 -0
  3. data/.travis.yml +33 -33
  4. data/Gemfile +6 -4
  5. data/README.de.md +53 -18
  6. data/README.es.md +55 -20
  7. data/README.fr.md +54 -19
  8. data/README.it.md +58 -23
  9. data/README.ja.md +54 -19
  10. data/README.ko.md +58 -23
  11. data/README.md +167 -141
  12. data/README.ms.md +51 -16
  13. data/README.pt.md +58 -23
  14. data/README.ru.md +53 -18
  15. data/README.sv.md +53 -18
  16. data/README.zh.md +53 -18
  17. data/bin/translatomatic +6 -6
  18. data/bin/travis +24 -26
  19. data/config/locales/translatomatic/de.yml +22 -11
  20. data/config/locales/translatomatic/en.yml +21 -12
  21. data/config/locales/translatomatic/es.yml +22 -11
  22. data/config/locales/translatomatic/fr.yml +22 -12
  23. data/config/locales/translatomatic/it.yml +22 -11
  24. data/config/locales/translatomatic/ja.yml +22 -11
  25. data/config/locales/translatomatic/ko.yml +22 -11
  26. data/config/locales/translatomatic/ms.yml +22 -11
  27. data/config/locales/translatomatic/pt.yml +22 -11
  28. data/config/locales/translatomatic/ru.yml +22 -11
  29. data/config/locales/translatomatic/sv.yml +22 -11
  30. data/config/locales/translatomatic/zh.yml +22 -11
  31. data/db/migrate/201712170000_initial.rb +25 -25
  32. data/lib/translatomatic/cli/base.rb +81 -73
  33. data/lib/translatomatic/cli/config.rb +110 -81
  34. data/lib/translatomatic/cli/main.rb +85 -72
  35. data/lib/translatomatic/cli/translate.rb +141 -106
  36. data/lib/translatomatic/cli.rb +8 -8
  37. data/lib/translatomatic/config.rb +302 -155
  38. data/lib/translatomatic/converter.rb +28 -260
  39. data/lib/translatomatic/database.rb +134 -134
  40. data/lib/translatomatic/define_options.rb +22 -0
  41. data/lib/translatomatic/escaped_unicode.rb +0 -0
  42. data/lib/translatomatic/extractor/base.rb +16 -16
  43. data/lib/translatomatic/extractor/ruby.rb +6 -6
  44. data/lib/translatomatic/extractor.rb +5 -5
  45. data/lib/translatomatic/file_translator.rb +269 -0
  46. data/lib/translatomatic/http_request.rb +162 -162
  47. data/lib/translatomatic/locale.rb +76 -76
  48. data/lib/translatomatic/logger.rb +23 -23
  49. data/lib/translatomatic/model/locale.rb +25 -25
  50. data/lib/translatomatic/model/text.rb +19 -19
  51. data/lib/translatomatic/model.rb +1 -1
  52. data/lib/translatomatic/option.rb +37 -41
  53. data/lib/translatomatic/progress_updater.rb +13 -13
  54. data/lib/translatomatic/resource_file/base.rb +269 -192
  55. data/lib/translatomatic/resource_file/csv.rb +37 -0
  56. data/lib/translatomatic/resource_file/html.rb +54 -47
  57. data/lib/translatomatic/resource_file/markdown.rb +50 -55
  58. data/lib/translatomatic/resource_file/plist.rb +153 -19
  59. data/lib/translatomatic/resource_file/po.rb +107 -0
  60. data/lib/translatomatic/resource_file/properties.rb +91 -90
  61. data/lib/translatomatic/resource_file/resw.rb +50 -30
  62. data/lib/translatomatic/resource_file/subtitle.rb +75 -0
  63. data/lib/translatomatic/resource_file/text.rb +24 -30
  64. data/lib/translatomatic/resource_file/xcode_strings.rb +75 -80
  65. data/lib/translatomatic/resource_file/xml.rb +98 -91
  66. data/lib/translatomatic/resource_file/yaml.rb +94 -116
  67. data/lib/translatomatic/resource_file.rb +87 -78
  68. data/lib/translatomatic/string.rb +188 -188
  69. data/lib/translatomatic/tmx/document.rb +99 -99
  70. data/lib/translatomatic/translation_result.rb +63 -63
  71. data/lib/translatomatic/{converter_stats.rb → translation_stats.rb} +17 -17
  72. data/lib/translatomatic/translator/base.rb +1 -1
  73. data/lib/translatomatic/translator/google.rb +2 -0
  74. data/lib/translatomatic/translator.rb +10 -2
  75. data/lib/translatomatic/util.rb +45 -45
  76. data/lib/translatomatic/version.rb +7 -7
  77. data/lib/translatomatic.rb +52 -49
  78. data/translatomatic.gemspec +3 -2
  79. 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
- are currently supported:
10
-
11
- * [Properties](https://en.wikipedia.org/wiki/.properties)
12
- * RESW (Windows resources file)
13
- * [Property lists](https://en.wikipedia.org/wiki/Property_list) (OSX plist)
14
- * HTML
15
- * XML
16
- * [Markdown](https://en.wikipedia.org/wiki/Markdown)
17
- * [XCode strings](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)
18
- * [YAML](http://yaml.org/)
19
- * Text files
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
-
29
- Translated strings are saved in a database and reused.
30
-
31
- ## Installation
32
-
33
- Add this line to your application's `Gemfile`:
34
-
35
- ```ruby
36
- gem 'translatomatic'
37
- ```
38
-
39
- And then execute:
40
-
41
- $ bundle
42
-
43
- Or install it yourself as:
44
-
45
- $ gem install translatomatic
46
-
47
- ## Usage
48
-
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:
50
-
51
- $ translatomatic help
52
-
53
- And for help on a command, execute:
54
-
55
- $ translatomatic translate help
56
- $ translatomatic translate help file
57
-
58
- ## Setup
59
-
60
- Check for available translation services and options with the `services` command:
61
-
62
- $ translatomatic services
63
-
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:
65
-
66
- $ translatomatic config list
67
- $ translatomatic config describe
68
-
69
- See also the Configuration section below for more information.
70
-
71
- ## Translating files
72
-
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.
80
-
81
- ### Displaying strings from a resource bundle
82
-
83
- To read and display the `store.description` and `store.name` properties from local resource files in English, German, and French:
84
-
85
- $ translatomatic display --locales=en,de,fr \
86
- resources/strings.properties store.description store.name
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
-
94
- ## Configuration
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
-
118
- By default, `translatomatic` uses an sqlite3 database in `$HOME/.translatomatic/translatomatic.sqlite3` to store translated strings.
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.
121
-
122
- production:
123
- adapter: mysql2
124
- host: db.example.com
125
- database: translatomatic
126
- pool: 5
127
- encoding: utf8
128
- username: username
129
- password: password
130
-
131
- ## Contributing
132
-
133
- 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.
134
-
135
- ## License
136
-
137
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
138
-
139
- ## Code of Conduct
140
-
141
- 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).
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
- 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
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. Fail konfigurasi boleh diubahsuai menggunakan translatomatic di Dalaman `config` perintah. Untuk menyenaraikan semua tetapan tatarajah tersedia, gunakan:
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 dari sesetengah fail sumber, gunakan dalam `strings` arahan, misalnya
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
- ## Kod Amalan
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.1 Mon, 01 Jan 2018 21:36:22 +1030_
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. 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
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
- ## Instalação
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
- ## Utilização
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
- ## Instalação
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 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:
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
- ## Conversão de arquivos
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 alguns arquivos de fonte, use o `strings` comando, por exemplo
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
- ## Configuração
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
- ## Contribuir
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
- ## Licença
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
- ## código de conduta
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.1 Mon, 01 Jan 2018 21:36:23 +1030_
172
+ _Criado por Translatomatic 0.1.2 Sat, 06 Jan 2018 22:56:26 +1030_