r18n-rails-api 3.0.5 → 5.0.0

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