r18n-desktop 4.0.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 584e74e2df59ef1a561667dd9536eb311c55083e88d96947ac1261c0933b4e48
4
- data.tar.gz: f88726c4f1fc8f1caed4439bd909d241fc295a4bbf3b01f402140ffc782019fb
3
+ metadata.gz: abaf977cb2ab8ee19484d8c0edaacc02adec54fd28d4b19d953a49b0c0e3545a
4
+ data.tar.gz: fa5857f3e223fae5ee18ebf5376d4adaaa282e8da6a0ec01710e1ed0588ce28e
5
5
  SHA512:
6
- metadata.gz: 9aa47b0e1c352c9ea3eb9ad92dae6102cf6113886c8965c12abb60d268f270229512db315ff41d38c15a178c5dae6f5cf670d73a8bf86d12f50dafd5949daf61
7
- data.tar.gz: fdea48d1e3dedfdf4cb288f005e9135a133d0b0f01bc5c29d7e13b862f66a83438bfb473d1beee236d1fd00d9f01ccd649be626844424ce8345656328f0e6964
6
+ metadata.gz: 2d7af09fce2a1377b99c9e36fdbfe32297c9495c0891453c00bb87506f50d031f8b979628988d621bb3e6becc8519c054c4f70d746264daad26a39cacbe437b3
7
+ data.tar.gz: 5661c3bb2bacb51216f878c03193cf5ce0574ec98be0000cc99e90a822f5cbc5187ee343c91975bffeece1f95240bd9fad3f640477db9980bfbcce2ea66327f8
data/ChangeLog.md ADDED
@@ -0,0 +1,384 @@
1
+ # Change Log
2
+
3
+ ## Unreleased
4
+
5
+ ## 5.0.1 (2021-03-04)
6
+
7
+ ## 5.0.0 (Warszawa) (2021-03-04)
8
+
9
+ * Take out `r18n-desktop` gem from mono-repository.
10
+ * Drop Ruby 2.4 support.
11
+ * Support Ruby 3.
12
+ * Avoid Ruby 4 in gem specs.
13
+ * Add metadata to gem specs.
14
+ * Add Alexander Popov as a gem author.
15
+ * Replace `rake` with `toys`.
16
+ * Add Codecov and SimpleCov.
17
+ * Update RuboCop, its configuration, and resolve new offenses.
18
+ * Add badges into README.
19
+
20
+ All core changes now check in [the `r18n-core` repository](https://github.com/r18n/r18n-core).
21
+
22
+ ## 4.0.0 (Santiago)
23
+
24
+ * Drop Ruby 2.3 support (by Alexander Popov).
25
+ * Drop `R18n::Utils.hash_map` (by Alexander Popov).
26
+ * Add Ruby 2.6 and 2.7 for CI (by Alexander Popov).
27
+ * Allow to add custom (per-project) locales (by Alexander Popov).
28
+ * Add block for `R18n.change` (change affects only code inside block)
29
+ (by Alexander Popov).
30
+ * Add `language` and `region` readers for `Locale` (by Alexander Popov).
31
+ * Allow upcased region in translation file names (like `en-US.yml`)
32
+ (by Alexander Popov).
33
+ * Load `base` translations from parent locale (by Alexander Popov).
34
+ * Downcase locales with regions for `Translated`, like `name_en_us`
35
+ instead of `name_en-US` (by Alexander Popov).
36
+ * Add Spanish Chile (`es-CL`) (by Juan Gil Miqueo).
37
+ * Add `:with_seconds` option for Time formatting (by Alexander Popov).
38
+ * Replace custom `gsub` in `R18n::Utils.escape_html` with `CGI.escapeHTML`
39
+ (by Alexander Popov).
40
+ * Improve Indonesian translation (by Mohammad Satrio).
41
+ * Improve documentation (by Alexander Popov).
42
+ * Fix issue with wildcard in `Accept-Language` header (by Alexander Popov).
43
+
44
+ ## 3.2.0 (Kawasaki)
45
+ * Support `*.yaml` files (by Alexander Popov).
46
+ * Locate processed `code` in `UnsupportedLocale`, like in `Locale` (by Alexander Popov).
47
+ * Fix `TranslatedString#to_ary`, don't return `Untranslated` (by Alexander Popov).
48
+ * Add Welsh language (`cy`) (by Mei Gwilym).
49
+ * Add support for custom classes localizing (`R18n.l`) (by Alexander Popov).
50
+ * Replace blank-padded day in date with no-padded (by Alexander Popov).
51
+ * Fix `TranslatedString#to_hash` (by Christian Höppner and Alexander Popov).
52
+
53
+ ## 3.1.2 (i)
54
+ * Call `Translation#itself` as translation key instead of `Kernel#itself` implementation (by Alexander Popov).
55
+
56
+ ## 3.1.1 (У)
57
+ * Fix errors and warnings from `gem build`
58
+
59
+ ## 3.1 (Одинцово)
60
+ * Move `named_variables` filter from `r18n-rails-api` to `r18n-core` (by Alexander Popov).
61
+ * Add possibility for `R18n::Locale` to define custom formatters (by Alexander Popov).
62
+ * Fix `R18n.set` for `r18n-desktop` (by Alexander Popov).
63
+
64
+ ## 3.0.5 (ب)
65
+ * Fix Farsi locale name (by @iriman).
66
+
67
+ ## 3.0.4 (𐤀)
68
+ * Fix `Translated` compatibility with `Hash` (by Alexander Popov).
69
+
70
+ ## 3.0.3 (〥)
71
+ * Fix missed filters in `Untranslted` initialization (by Alexander Popov).
72
+
73
+ ## 3.0.2 (Ё)
74
+ * Fix `Untranslted.to_s` (by Patrik Rak).
75
+
76
+ ## 3.0.1 (Brooklyn)
77
+ * Fix `no` locale deprecation warning.
78
+
79
+ ## 3.0 (New York)
80
+ * Deprecate `no` locale, use `nb` instead (by Alexander Popov).
81
+ * Remove unsafe `!!proc` filter.
82
+ * Reduce `eval` calls (by Alexander Popov).
83
+
84
+ ## 2.2 (La Habana)
85
+ * Change date format in `en` locale to `YYYY-MM-DD` (by Alexander Popov).
86
+ * Add `TranslatedString#as_json` for ActiveSupport compatibility (by Tim Craft).
87
+ * Fix `TranslatedString#html_safe?` behavior (by Tim Craft).
88
+ * Fix unsupported `LANG` environment (by Chris Poirier).
89
+ * Fix `Locale#localize` method for `DateTime` objects (by Alexander Popov).
90
+
91
+ ## 2.1.8 (Ѣ)
92
+ * Fix `true` and `false` keys support (by Alexander Popov).
93
+
94
+ ## 2.1.7 (Sewe)
95
+ * Add Afrikaans locale (by Llewellyn van der Merwe).
96
+
97
+ ## 2.1.6 (Berlin)
98
+ * Better `TranslatedString` → `String` converting (by Patrik Rak).
99
+ * Add Ruby on Rails 5 support.
100
+
101
+ ## 2.1.5 (මාතර)
102
+ * Fix Ruby 2.4 support (by Alexander Popov)
103
+
104
+ ## 2.1.4 (Bakı)
105
+ * Add Azerbaijani locale (by Adil Aliyev).
106
+
107
+ ## 2.1.3 (Seoul)
108
+ * Add Korean locale (by Patrick Cheng).
109
+
110
+ ## 2.1.2 (Wien)
111
+ * Fix Ruby 2.3 support.
112
+
113
+ ## 2.1.1 (Barcelona)
114
+ * Better sanity check for Accept-Language header (by Viktors Rotanovs).
115
+
116
+ ## 2.1 (Một)
117
+ * Add Vietnamese locale (by Nguyễn Văn Được).
118
+ * Add Persian locale.
119
+ * Allow to change date/time order in locales.
120
+ * Fix pluralization in locales without plural forms.
121
+ * Fix Mongolian base translations.
122
+
123
+ ## 2.0.4 (Ikkuna)
124
+ * Fix Windows support (by janahanEDH).
125
+
126
+ ## 2.0.3 (Hévíz)
127
+ * Fix Thai locale (by Kasima Tharnpipitchai).
128
+
129
+ ## 2.0.2 (Budapest)
130
+ * Fix array support in translations.
131
+ * Fix Rails support for dialect locales.
132
+
133
+ ## 2.0.1 (Amsterdam)
134
+ * Fix Dutch locale.
135
+
136
+ ## 2.0.0 (Москва)
137
+ * Remove Ruby 1.8 and 1.9 support.
138
+ * Add JRuby 9000 support.
139
+
140
+ ### 1.1.11 (São Paulo)
141
+ * Allow to set Proc as `default` option in Rails I18n back-end.
142
+
143
+ ### 1.1.10 (十)
144
+ * Fix Esperanto locale by Larry Gilbert.
145
+ * Fix Chinese locale (by 刘当一).
146
+
147
+ ### 1.1.9 (Не знайдено)
148
+ * Fix Rails 4.0.4 support. Prevent loop on `enforce_available_locales`.
149
+
150
+ ### 1.1.8 (Osam)
151
+ * Add Croatian locale (by Dino Kovač).
152
+ * Add Serbian latin locale (by Dino Kovač).
153
+
154
+ ### 1.1.7 (Tujuh)
155
+ * Return `nil` on untranslated in models with Translated.
156
+ * Add `transliterate` method to I18n back-end.
157
+ * Add Indonesian locale (by Guntur Akhmad).
158
+
159
+ ### 1.1.6 (Vitebsk)
160
+ * Return `TranslatedString` after global String filters.
161
+ * Fix path in global String filters.
162
+
163
+ ### 1.1.5 (Hilo)
164
+ * Fix Sinatra plugin under multi-threaded web-server (by Viktors Rotanovs).
165
+ * Fix `BigDecimal` localizing (by François Beausoleil).
166
+ * Add American American Spanish locale (by renemarcelo).
167
+
168
+ ### 1.1.4 (Bokmål)
169
+ * Add Norwegian `no` locale as gateway to Bokmål or Nynorsk.
170
+ * Fix Norwegian Bokmål locale code.
171
+ * Fix Hungarian time format (Kővágó Zoltán).
172
+
173
+ ### 1.1.3 (Saint Petersburg)
174
+ * Fix memory leak from cache key mismatch in Rails plugin (by silentshade).
175
+
176
+ ### 1.1.2 (Marshal)
177
+ * Fix translation and untranslated marshalizing (by silentshade).
178
+ * Allow to compare untranslated strings.
179
+ * Fix untranslated strings output in tests.
180
+
181
+ ### 1.1.1 (Dunhuang)
182
+ * Don't change YAML parser in Ruby 1.9.
183
+ * Allow to change locale by argument in R18n Rails back-end.
184
+ * Set also Rails I18n locale in Rails auto-detect filter.
185
+ * Fix caching with custom filters (by Anton Onyshchenko).
186
+ * Fix translation variables with `%1` text inside (by Taras Kunch).
187
+ * Fix Latvian locale (by Aleksandrs Ļedovskis).
188
+
189
+ ### 1.1.0 (Leipzig)
190
+ * A lot of fixes in Rails I18n compatibility (thanks for Stephan Schubert).
191
+ * Return `Untranslted`, when user try to call another translation key on
192
+ already translated string.
193
+ * Add `Translation#to_hash` to get raw translation.
194
+ * Add `Translation#inspect` to easy debug.
195
+ * Return translation, when pluralization filter did not get count.
196
+ * Set R18n back-end on Rails plugin init, to use it in console.
197
+ * Allow to use Integer in translation keys.
198
+
199
+ ### 1.0.1 (Phuket Town)
200
+ * Fix translation reloading in Rails and Sinatra.
201
+ * Use global R18n settings for Sinatra extension.
202
+ * Allow to override desktop auto-detect by LANG environment on all platforms.
203
+ * Add support for JRuby in 1.9 mode.
204
+ * Rename `R18n.reset` to `R18n.reset!` and add `R18n.clear_cache!`.
205
+ * Fix Sinatra with loaded ActiveSupport.
206
+ * Add Mongolian locale (by Elias Klughammer).
207
+
208
+ ### 1.0.0 (Bangkok)
209
+ * Add `R18n.default_places`.
210
+ * Rails `SafeBuffer` support.
211
+ * Allow in Rails app to put filters to `app/i18n` reload them in development.
212
+ * Move `R18n::I18n.available_locales` to `R18n.available_locales`.
213
+ * Rename `_keys` to `translation_keys`.
214
+ * Use Kramdown instead of Maruku for Markdown.
215
+ * Allow to use R18n for Rails without mailer.
216
+ * Allow to overwrite I18n object for models.
217
+ * Autoload R18n::Translated.
218
+ * Set default locale to R18n on Rails start to easy use in Rails console.
219
+ * Use env language in Rails console.
220
+ * Mark untranslated part as red in Rails console.
221
+ * Allow to temporary change locale by `R18n.change`.
222
+ * Add `R18n.locale` shortcut.
223
+ * Allow return from setter block locale code, instead of I18n object.
224
+ * Allow to set custom filters for I18n object.
225
+ * Add Galician locale (by Eduard Giménez).
226
+ * Add Traditional Chinese and Simplified Chinese (by Francis Chong).
227
+ * Fix Norsk locale (by Peter Haza).
228
+
229
+ ### 0.4.14 (üç)
230
+ * Fix support for Ruby 1.9.3.
231
+ * Added Turkish locale (by Ahmet Özkaya).
232
+ * Fix Swedish locale (by Pär Wieslander).
233
+
234
+ ### 0.4.13 (Sti)
235
+ * Fix `Pathname` to `String` error in `r18n-desktop`.
236
+ * Add Norwegian locale (by Oddmund Strømme).
237
+
238
+ ### 0.4.12 (Шлях)
239
+ * Fix `Pathname` to `String` conversion error.
240
+ * Fix model translation for non-ActiveRecord (by Szymon Przybył).
241
+ * Add Ukrainian locale (by Ярослав Руденок).
242
+
243
+ ### 0.4.11 (Nancy)
244
+ * Support for Sinatra 1.3.
245
+ * Fix JRuby support by Paul Walker.
246
+ * Add R18n helpers to Rails mailer by Alexey Medvedev.
247
+
248
+ ### 0.4.10 (Kvantum)
249
+ * Add R18n.set(locales, places), R18n.t and R18n.l shortcuts.
250
+ * Convert float to number on pluralization.
251
+ * Fix loading empty translation file.
252
+ * Add Portuguese locale.
253
+ * Add Dutch locale (by Sander Heilbron).
254
+ * Add Swedish locale (by Magnus Hörberg).
255
+
256
+ ### 0.4.9 (Kazan)
257
+ * Add support for Psych YAML parser (thanks for Ravil Bayramgalin).
258
+ * Fix ActiveRecord support in Translated.
259
+ * Fix Translated to return non-string values.
260
+ * Fix human time localization.
261
+ * Add Bulgarian locale (by Mitko Kostov).
262
+ * Add Australian English locale (by Dave Sag).
263
+
264
+ ### 0.4.8 (En ni to)
265
+ * Fix support for Ruby 1.9.2.
266
+ * Fix caching issue (by Viktors Rotanovs).
267
+ * Add Danish locale (by Hans Czajkowski Jørgensen)
268
+ * Fix Italian locale (by Viktors Rotanovs).
269
+ * Move untranslated filters with html highlight to `r18n-core`.
270
+
271
+ ### 0.4.7.1 (Kyū)
272
+ * Fix Japanese locale in Ruby 1.9.1.
273
+
274
+ ### 0.4.7 (Mado)
275
+ * Fix auto-detect locale in Windows and Ruby 1.9.1 (by Marvin Gülker).
276
+ * Fix auto-detect locale in JRuby (by Kővágó, Zoltán).
277
+ * Fix human time format on 60 minutes.
278
+ * Add Hungarian locale (by Kővágó, Zoltán).
279
+ * Add Japanese locale (by hryk).
280
+ * Fix Polish locale (by Piotr Szotkowski).
281
+
282
+ ### 0.4.6 (Trinity)
283
+ * Add support for new interpolation syntax in Rails 3.
284
+ * Add Catalian locale (by Jordi Romero).
285
+ * Add Finish locale (by Laura Guillén).
286
+ * Add British locale (by JP Hastings-Spital).
287
+ * Add Latvian locale (by Iļja Ketris).
288
+ * Fix Spanish (by Jordi Romero), German, French, Esperanto (by Iļja Ketris) and
289
+ Polish locales.
290
+ * Fix documentation (by Iļja Ketris and felix).
291
+ * Remove RubyGems from plugins requires.
292
+
293
+ ### 0.4.5 (Annual)
294
+ * Filters for several types.
295
+ * Global HTML escaping run before Markdown and Textile formatting.
296
+ * Fix active filters after passive filters.
297
+ * Fix human time formatting for dates with same month days.
298
+
299
+ ### 0.4.4 (Frank)
300
+ * Use before filter to lazy set I18n object in Sinatra extension.
301
+ * Set I18n object to thread (by Simon Hafner).
302
+ * Add to l Rails helper R18n syntax.
303
+ * Add common helpers.
304
+ * Clear cache in `R18n.reset`.
305
+ * Clean up code and fix bug (by Akzhan Abdulin).
306
+ * Add Thai locale (by Felix Hanley).
307
+
308
+ ### 0.4.3 (Flange)
309
+ * Add R18n style methods to Rails controllers.
310
+ * Fix for non-string translations in Rails I18n.
311
+ * Use default locale from Rails I18n config.
312
+ * Load translations recursively.
313
+ * Add Slovak locale (by Ahmed Al Hafoudh)
314
+
315
+ ### 0.4.2 (EMS)
316
+ * Fixes for Ruby 1.8.6 (by Akzhan Abdulin).
317
+ * Add method to get translation keys.
318
+
319
+ ### 0.4.1 (Lazy Boole)
320
+ * Add passive filters.
321
+ * Receive filter position as option `Hash`.
322
+ * Fix base translations (by Pavel Kunc).
323
+
324
+ ### 0.4 (D-Day)
325
+ * Rails I18n compatibility.
326
+ * Rewrite a lot of core code to fast and cleanup version.
327
+ * Custom translation loaders.
328
+ * Add reload! method to I18n.
329
+ * Add t and l helpers to Sinatra and desktop plugins.
330
+ * Syntax sugar for default values.
331
+ * Named variables.
332
+ * New locale API.
333
+ * Change API for extension translations.
334
+
335
+ ### 0.3.2 (Pidgin)
336
+ * Print path of untranslated string by filters.
337
+ * Add Italian locale (by Guido De Rosa).
338
+ * Fix Polish locale (by Adrian Pacała).
339
+ * Fix American English locale (by Max Aller).
340
+
341
+ ### 0.3.1 (Yield)
342
+ * Add Chinese locale (by Ilia Zayats).
343
+ * Add Spanish locale (by Andre O Moura).
344
+ * Add Brazilian Portuguese locale (by Andre O Moura).
345
+ * Remove RubyGems requires.
346
+
347
+ ### 0.3 (Vladivostok)
348
+ * `Translated` mixin to I18n support to model or any other class.
349
+ * New cool time formatters.
350
+ * Filters for translations.
351
+ * Add filters to escape HTML, Markdown and Textile syntax.
352
+ * Pluralization and variables is now filters and can be replaced.
353
+ * I18n#locales now contain all detected locales, used to load translations,
354
+ instead of just received from user.
355
+ * Bug-fix in locale code case.
356
+ * Add Czech locale (by Josef Pospíšil).
357
+
358
+ ### 0.2.3 (Shanghai eclipse)
359
+ * R18n will return path string if translation isn't exists.
360
+ * Add `UnsupportedLocale` class for locale without information file.
361
+ * Load absent locale information from default locale.
362
+ * Add Polish locale (by Tymon Tobolski).
363
+
364
+ ### 0.2.2 (Clone Wars)
365
+ * Localize numbers in pluralization.
366
+ * Bug-fix in translation variables.
367
+
368
+ ### 0.2.1 (Neun)
369
+ * Ruby 1.9 compatibility.
370
+ * Add German locale (by Benjamin Meichsner).
371
+
372
+ ### 0.2 (Freedom of Language)
373
+ * Locale class can be extended for special language (for example, Indian locale
374
+ may has another digits grouping).
375
+ * Load translations from several dirs.
376
+ * Add French locale.
377
+ * Add Kazakh locale.
378
+
379
+ ### 0.1.1 (Saluto)
380
+ * Loading I18n object without translations.
381
+ * Add output for standalone month name.
382
+ * Don't call procedures from translations if it isn't secure.
383
+ * Add Esperanto locale.
384
+ * English locale now contain UK date standards.
data/README.md CHANGED
@@ -1,9 +1,17 @@
1
1
  # R18n Desktop
2
2
 
3
+ [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/r18n/r18n-desktop?style=flat-square)](https://cirrus-ci.com/github/r18n/r18n-desktop)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/r18n/r18n-desktop/master.svg?style=flat-square)](https://codecov.io/gh/r18n/r18n-desktop)
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/r18n/r18n-desktop.svg?style=flat-square)](https://codeclimate.com/github/r18n/r18n-desktop)
6
+ [![Depfu](https://img.shields.io/depfu/r18n/r18n-desktop?style=flat-square)](https://depfu.com/repos/github/r18n/r18n-desktop)
7
+ [![License](https://img.shields.io/github/license/r18n/r18n-desktop.svg?style=flat-square)](LICENSE)
8
+ [![Gem](https://img.shields.io/gem/v/r18n-desktop.svg?style=flat-square)](https://rubygems.org/gems/r18n-desktop)
9
+
3
10
  A tool to translate your desktop application to several languages.
4
11
 
5
- It is just a wrapper for R18n core library. See R18n documentation for more
6
- information.
12
+ It is just a wrapper for [R18n core library](https://github.com/r18n/r18n-core).
13
+ See [R18n documentation](https://github.com/r18n/r18n-core/blob/master/README.md)
14
+ for more information.
7
15
 
8
16
  ## Features
9
17
 
@@ -18,10 +26,10 @@ See full features in [main README](https://github.com/r18n/r18n/blob/master/READ
18
26
 
19
27
  ## How To
20
28
 
21
- 1. Create translations dir. For example: `./i18n/`.
22
- 2. Add file with translation to `./i18n/` with language code in file name
23
- (for example, `en.yml` for English or `en-us.yml` USA English dialect).
24
- For example, `./i18n/en.yml`:
29
+ 1. Create translations dir. For example: `./i18n/`.
30
+ 2. Add file with translation to `./i18n/` with language code in file name
31
+ (for example, `en.yml` for English or `en-us.yml` USA English dialect).
32
+ For example, `./i18n/en.yml`:
25
33
 
26
34
  ```yaml
27
35
  file:
@@ -34,13 +42,13 @@ See full features in [main README](https://github.com/r18n/r18n/blob/master/READ
34
42
  n: '%1 files'
35
43
  ```
36
44
 
37
- 3. Add R18n to your application:
45
+ 3. Add R18n to your application:
38
46
 
39
47
  ```ruby
40
48
  require 'r18n-desktop'
41
49
  ```
42
50
 
43
- 4. Load I18n object:
51
+ 4. Load I18n object:
44
52
 
45
53
  ```ruby
46
54
  R18n.from_env('i18n/')
@@ -51,13 +59,13 @@ See full features in [main README](https://github.com/r18n/r18n/blob/master/READ
51
59
  R18n.from_env('i18n/', manual_locale)
52
60
  ```
53
61
 
54
- 5. Include mixin to use helpers:
62
+ 5. Include mixin to use helpers:
55
63
 
56
64
  ```ruby
57
65
  include R18n::Helpers
58
66
  ```
59
67
 
60
- 6. Use translation messages to user. For example:
68
+ 6. Use translation messages to user. For example:
61
69
 
62
70
  ```ruby
63
71
  t.file.add #=> "Add file"
@@ -75,7 +83,7 @@ See full features in [main README](https://github.com/r18n/r18n/blob/master/READ
75
83
  t.cancel #=> "Cancel"
76
84
  ```
77
85
 
78
- 7. You can print user locale or available locales:
86
+ 7. You can print user locale or available locales:
79
87
 
80
88
  ```ruby
81
89
  "Your locale: " + r18n.locale.title
data/lib/r18n-desktop.rb CHANGED
@@ -19,16 +19,18 @@
19
19
 
20
20
  require 'r18n-core'
21
21
 
22
- if /cygwin|mingw|win32/ =~ RUBY_PLATFORM
22
+ case RUBY_PLATFORM
23
+ when /cygwin|mingw|win32/
23
24
  require_relative 'r18n-desktop/win32'
24
- elsif /java/ =~ RUBY_PLATFORM
25
+ when /java/
25
26
  require_relative 'r18n-desktop/java'
26
- elsif /darwin/ =~ RUBY_PLATFORM
27
+ when /darwin/
27
28
  require_relative 'r18n-desktop/osx'
28
29
  else
29
30
  require_relative 'r18n-desktop/posix'
30
31
  end
31
32
 
33
+ # Root singleton helper methods
32
34
  module R18n
33
35
  class << self
34
36
  # Get user locale from system environment and load I18n object with locale
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # I18n support for JRuby.
4
- #
5
3
  # Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
6
4
  #
7
5
  # This program is free software: you can redistribute it and/or modify
@@ -18,6 +16,7 @@
18
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
17
 
20
18
  module R18n
19
+ # I18n support for JRuby.
21
20
  class I18n
22
21
  def self.system_locale
23
22
  Java.java.util.Locale.getDefault.toString
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # I18n support for Mac OS X.
4
- #
5
3
  # Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
6
4
  #
7
5
  # This program is free software: you can redistribute it and/or modify
@@ -18,6 +16,7 @@
18
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
17
 
20
18
  module R18n
19
+ # I18n support for Mac OS X.
21
20
  class I18n
22
21
  def self.system_locale
23
22
  command =
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # I18n support for UNIX-like OS.
4
- #
5
3
  # Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
6
4
  #
7
5
  # This program is free software: you can redistribute it and/or modify
@@ -18,6 +16,7 @@
18
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
17
 
20
18
  module R18n
19
+ # I18n support for UNIX-like OS.
21
20
  class I18n
22
21
  def self.system_locale
23
22
  return unless ENV['LANG']
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module R18n
4
+ module Desktop
5
+ VERSION = '5.0.1'
6
+ end
7
+ end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # I18n support for Windows.
4
- #
5
3
  # Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
6
4
  #
7
5
  # This program is free software: you can redistribute it and/or modify
@@ -20,6 +18,7 @@
20
18
  require 'fiddle/import'
21
19
 
22
20
  module R18n
21
+ # I18n support for Windows.
23
22
  class I18n
24
23
  module Kernel32
25
24
  extend Fiddle::Importer
metadata CHANGED
@@ -1,29 +1,156 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-desktop
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
- autorequire:
8
+ - Alexander Popov
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-01-30 00:00:00.000000000 Z
12
+ date: 2021-03-03 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: r18n-core
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - '='
18
+ - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: 4.0.0
20
+ version: '5.0'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - '='
25
+ - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: 4.0.0
27
+ version: '5.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: pry-byebug
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.9'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '3.9'
42
+ - !ruby/object:Gem::Dependency
43
+ name: gem_toys
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 0.7.1
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 0.7.1
56
+ - !ruby/object:Gem::Dependency
57
+ name: toys
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 0.11.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 0.11.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.6'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.6'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rubocop-performance
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '1.9'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '1.9'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rubocop-rake
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 0.5.1
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 0.5.1
112
+ - !ruby/object:Gem::Dependency
113
+ name: codecov
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: 0.5.0
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: 0.5.0
126
+ - !ruby/object:Gem::Dependency
127
+ name: rspec
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '3.10'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '3.10'
140
+ - !ruby/object:Gem::Dependency
141
+ name: simplecov
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: 0.21.0
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: 0.21.0
27
154
  description: |2
28
155
  A i18n tool to translate your desktop application in several languages.
29
156
  It is just a wrapper for R18n core library.
@@ -31,31 +158,34 @@ description: |2
31
158
  translation support for any classes, time and number localization, several
32
159
  user language support, agnostic core package with out-of-box support for
33
160
  Rails, Sinatra and desktop applications.
34
- email: andrey@sitnik.ru
161
+ email:
162
+ - andrey@sitnik.ru
163
+ - alex.wayfer@gmail.com
35
164
  executables: []
36
165
  extensions: []
37
166
  extra_rdoc_files:
38
167
  - README.md
39
168
  - LICENSE
40
169
  files:
41
- - ".rspec"
170
+ - ChangeLog.md
42
171
  - LICENSE
43
172
  - README.md
44
- - Rakefile
45
173
  - lib/r18n-desktop.rb
46
174
  - lib/r18n-desktop/java.rb
47
175
  - lib/r18n-desktop/osx.rb
48
176
  - lib/r18n-desktop/posix.rb
177
+ - lib/r18n-desktop/version.rb
49
178
  - lib/r18n-desktop/win32.rb
50
- - r18n-desktop.gemspec
51
- - spec/i18n/en.yml
52
- - spec/r18n-desktop_spec.rb
53
- - spec/spec_helper.rb
54
- homepage: https://github.com/r18n/r18n/tree/master/r18n-desktop
179
+ homepage: https://github.com/r18n/r18n-desktop
55
180
  licenses:
56
181
  - LGPL-3.0
57
- metadata: {}
58
- post_install_message:
182
+ metadata:
183
+ bug_tracker_uri: https://github.com/r18n/r18n-desktop/issues
184
+ changelog_uri: https://github.com/r18n/r18n-desktop/blob/5.0.1/ChangeLog.md
185
+ documentation_uri: http://www.rubydoc.info/gems/r18n-desktop/5.0.1
186
+ homepage_uri: https://github.com/r18n/r18n-desktop
187
+ source_code_uri: https://github.com/r18n/r18n-desktop
188
+ post_install_message:
59
189
  rdoc_options: []
60
190
  require_paths:
61
191
  - lib
@@ -63,18 +193,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
193
  requirements:
64
194
  - - ">="
65
195
  - !ruby/object:Gem::Version
66
- version: '0'
196
+ version: '2.5'
197
+ - - "<"
198
+ - !ruby/object:Gem::Version
199
+ version: '4'
67
200
  required_rubygems_version: !ruby/object:Gem::Requirement
68
201
  requirements:
69
202
  - - ">="
70
203
  - !ruby/object:Gem::Version
71
204
  version: '0'
72
205
  requirements: []
73
- rubygems_version: 3.1.2
74
- signing_key:
206
+ rubygems_version: 3.2.3
207
+ signing_key:
75
208
  specification_version: 4
76
- summary: A i18n tool to translate your Ruby desktop application.
77
- test_files:
78
- - spec/i18n/en.yml
79
- - spec/r18n-desktop_spec.rb
80
- - spec/spec_helper.rb
209
+ summary: A i18n tool to translate your Ruby desktop application
210
+ test_files: []
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --format documentation --colour --warnings --require spec_helper
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- Bundler::GemHelper.install_tasks
5
-
6
- require 'rspec/core/rake_task'
7
- RSpec::Core::RakeTask.new
8
- task default: :spec
9
-
10
- task :clobber_package do
11
- rm_rf 'pkg'
12
- end
13
- task clobber: [:clobber_package]
data/r18n-desktop.gemspec DELETED
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../r18n-core/lib/r18n-core/version'
4
-
5
- Gem::Specification.new do |s|
6
- s.platform = Gem::Platform::RUBY
7
- s.name = 'r18n-desktop'
8
- s.version = R18n::VERSION.dup
9
- s.date = Time.now.strftime('%Y-%m-%d')
10
-
11
- s.summary = 'A i18n tool to translate your Ruby desktop application.'
12
- s.description = <<-DESC
13
- A i18n tool to translate your desktop application in several languages.
14
- It is just a wrapper for R18n core library.
15
- It has nice Ruby-style syntax, filters, flexible locales, custom loaders,
16
- translation support for any classes, time and number localization, several
17
- user language support, agnostic core package with out-of-box support for
18
- Rails, Sinatra and desktop applications.
19
- DESC
20
-
21
- s.files = `git ls-files`.split("\n")
22
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
- s.extra_rdoc_files = ['README.md', 'LICENSE']
24
- s.require_path = 'lib'
25
-
26
- s.author = 'Andrey Sitnik'
27
- s.email = 'andrey@sitnik.ru'
28
- s.homepage = 'https://github.com/r18n/r18n/tree/master/r18n-desktop'
29
- s.license = 'LGPL-3.0'
30
-
31
- s.add_dependency 'r18n-core', "= #{R18n::VERSION}"
32
- end
data/spec/i18n/en.yml DELETED
@@ -1,2 +0,0 @@
1
- account:
2
- balance: Balance for account
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'r18n-desktop' do
4
- include R18n::Helpers
5
-
6
- before(:each) do
7
- R18n.reset!
8
- end
9
-
10
- it 'returns array of system locales' do
11
- locale = R18n::I18n.system_locale
12
- expect(locale.class).to eq String
13
- expect(locale).not_to be_empty
14
- end
15
-
16
- describe '.from_env' do
17
- it 'loads I18n from system environment' do
18
- R18n.from_env
19
- expect(r18n.class).to eq R18n::I18n
20
- expect(r18n.locale).not_to be_empty if String == r18n.locale.class
21
- expect(R18n.get).to eq r18n
22
- end
23
-
24
- it 'loads i18n from system environment using specified order' do
25
- R18n.from_env(nil, 'en')
26
- expect(r18n.locale).to eq R18n.locale('en')
27
- expect(R18n.get).to eq r18n
28
- end
29
-
30
- it 'allows to overide autodetect by LANG environment' do
31
- allow(R18n::I18n).to receive(:system_locale) { 'ru' }
32
- ENV['LANG'] = 'en'
33
- R18n.from_env
34
- expect(r18n.locale).to eq R18n.locale('en')
35
- end
36
-
37
- it 'works with following `R18n.set`' do
38
- R18n.from_env 'spec/i18n/'
39
- R18n.set 'en'
40
- expect(t.account.balance).to eq 'Balance for account'
41
- end
42
- end
43
- end
data/spec/spec_helper.rb DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pp'
4
-
5
- require_relative '../lib/r18n-desktop'