i18n-inflector 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +412 -0
- data/Manifest.txt +3 -0
- data/README.rdoc +38 -17
- data/docs/EXAMPLES +111 -22
- data/docs/HISTORY +37 -0
- data/docs/TODO +3 -27
- data/lib/i18n-inflector/api.rb +22 -234
- data/lib/i18n-inflector/api_strict.rb +1 -1
- data/lib/i18n-inflector/backend.rb +78 -23
- data/lib/i18n-inflector/config.rb +297 -0
- data/lib/i18n-inflector/errors.rb +184 -58
- data/lib/i18n-inflector/hset.rb +28 -0
- data/lib/i18n-inflector/inflection_data.rb +3 -1
- data/lib/i18n-inflector/inflection_data_strict.rb +3 -1
- data/lib/i18n-inflector/inflector.rb +1 -39
- data/lib/i18n-inflector/interpolate.rb +404 -0
- data/lib/i18n-inflector/lazy_enum.rb +52 -6
- data/lib/i18n-inflector/long_comments.rb +463 -157
- data/lib/i18n-inflector/options.rb +116 -20
- data/lib/i18n-inflector/version.rb +1 -1
- data/lib/i18n-inflector.rb +4 -1
- data/test/inflector_test.rb +179 -22
- data.tar.gz.sig +0 -0
- metadata +7 -4
- metadata.gz.sig +0 -0
data/ChangeLog
CHANGED
@@ -1,3 +1,415 @@
|
|
1
|
+
commit a60370126b5981255aff1b6de47c98ea3e740c04
|
2
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
3
|
+
Date: Wed Feb 9 18:49:52 2011 +0100
|
4
|
+
|
5
|
+
Release 2.2.0
|
6
|
+
|
7
|
+
commit 38416442533f9c4b44f51ee13f676460ad23fbbc
|
8
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
9
|
+
Date: Wed Feb 9 18:47:22 2011 +0100
|
10
|
+
|
11
|
+
Tested with Ruby 1.8, Ruby 1.9, i18n-inflector-rails, full-stacked Rails app, I18n v0.4.1 & v0.5.0
|
12
|
+
|
13
|
+
commit 732260142ca0ce727b9690c0374c7e5043e95130
|
14
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
15
|
+
Date: Wed Feb 9 18:17:32 2011 +0100
|
16
|
+
|
17
|
+
README updated
|
18
|
+
|
19
|
+
commit ffe39ffe0a4cc26b76c720507c5a46eb7d10b57e
|
20
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
21
|
+
Date: Wed Feb 9 18:17:10 2011 +0100
|
22
|
+
|
23
|
+
Documentation updated
|
24
|
+
|
25
|
+
commit c81ed66f010b350f6db6d21d6194ceb0ba0d8167
|
26
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
27
|
+
Date: Wed Feb 9 18:16:22 2011 +0100
|
28
|
+
|
29
|
+
EXAMPLES updated
|
30
|
+
|
31
|
+
commit 4c09e2c3c5f549eca7a2024cea0e2bb5f3bc5078
|
32
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
33
|
+
Date: Wed Feb 9 03:45:10 2011 +0100
|
34
|
+
|
35
|
+
Documentation fixes, error messages fixes
|
36
|
+
|
37
|
+
commit 3917807f00ff9ec0d641557c29eee15878914b67
|
38
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
39
|
+
Date: Wed Feb 9 01:21:15 2011 +0100
|
40
|
+
|
41
|
+
Documentation updated
|
42
|
+
|
43
|
+
commit 924f84f57d19ff8d1f8a9c18764f40a2f9ccea49
|
44
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
45
|
+
Date: Tue Feb 8 23:57:57 2011 +0100
|
46
|
+
|
47
|
+
README updated
|
48
|
+
|
49
|
+
commit cec22a1422f6b8e4213d8ce435ed0c3fa5390cad
|
50
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
51
|
+
Date: Tue Feb 8 23:57:36 2011 +0100
|
52
|
+
|
53
|
+
Fixed pattern escaping when locale is not inflected
|
54
|
+
|
55
|
+
commit 9649c6b292c169a8d4f7aaa9daa929c61388b9d5
|
56
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
57
|
+
Date: Tue Feb 8 18:00:58 2011 +0100
|
58
|
+
|
59
|
+
Removed magic symbols from code and fixed regular expression generators to be Ruby 1.8 compliant
|
60
|
+
|
61
|
+
commit a41dd59db76910c5a1eb0baa2bc8c818224187bc
|
62
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
63
|
+
Date: Tue Feb 8 17:59:45 2011 +0100
|
64
|
+
|
65
|
+
Added key-based inflection and multiple patterns support and some tests
|
66
|
+
|
67
|
+
commit 3c7f5ae5acf8f0061944fab46dc020b46fa7dd32
|
68
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
69
|
+
Date: Mon Feb 7 17:16:22 2011 +0100
|
70
|
+
|
71
|
+
Documentation updated
|
72
|
+
|
73
|
+
commit aa278841eb957a6ccc858ec6cb86832f59677587
|
74
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
75
|
+
Date: Mon Feb 7 00:46:41 2011 +0100
|
76
|
+
|
77
|
+
Documentation fix.
|
78
|
+
|
79
|
+
commit 90b55fd784818b0456aec01416195b5267fba3ff
|
80
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
81
|
+
Date: Mon Feb 7 00:46:20 2011 +0100
|
82
|
+
|
83
|
+
Added some old constants in case someone uses them.
|
84
|
+
|
85
|
+
commit b083527e545701a1c5fbe39d010618e148db6904
|
86
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
87
|
+
Date: Mon Feb 7 00:24:11 2011 +0100
|
88
|
+
|
89
|
+
Added config.rb to Manifest.txt
|
90
|
+
|
91
|
+
commit 2f917d62b456abe8b54f2e82a2441b35d6b25821
|
92
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
93
|
+
Date: Mon Feb 7 00:22:41 2011 +0100
|
94
|
+
|
95
|
+
Updated TODO and HISTORY
|
96
|
+
|
97
|
+
commit 10e98a1c7fc7d426f437ed0b25ff0c969ff1b2f9
|
98
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
99
|
+
Date: Mon Feb 7 00:22:06 2011 +0100
|
100
|
+
|
101
|
+
Tests fixed according to strict specification keeping while paring inflection options
|
102
|
+
|
103
|
+
commit be4f1f6cb53949166894529ec2a8433098909f43
|
104
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
105
|
+
Date: Mon Feb 7 00:21:00 2011 +0100
|
106
|
+
|
107
|
+
Documentation updated to reflect the changes
|
108
|
+
|
109
|
+
commit 1ea80871cbb114939d8e645b33a91272e72fab78
|
110
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
111
|
+
Date: Mon Feb 7 00:20:24 2011 +0100
|
112
|
+
|
113
|
+
Interpolation method refactored; cleaned options parsing code
|
114
|
+
|
115
|
+
commit 7e4bf4e2bbb21958971c354615c2077e44e66dd9
|
116
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
117
|
+
Date: Mon Feb 7 00:17:46 2011 +0100
|
118
|
+
|
119
|
+
Removed 'sudo' from installation instruction
|
120
|
+
|
121
|
+
commit 47e3b4ee161985f0457b19e9d475f17aa87c8c1e
|
122
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
123
|
+
Date: Sat Feb 5 17:46:56 2011 +0100
|
124
|
+
|
125
|
+
Tests updated
|
126
|
+
|
127
|
+
commit f32e334d04c66a9e7e24e5d9bce3c637ab312c62
|
128
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
129
|
+
Date: Sat Feb 5 17:46:39 2011 +0100
|
130
|
+
|
131
|
+
Added validations to interpolation and tokens loading routines
|
132
|
+
|
133
|
+
commit 83020be4362c615b8191632fc8c7a4f9d03690f5
|
134
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
135
|
+
Date: Sat Feb 5 17:44:29 2011 +0100
|
136
|
+
|
137
|
+
Known options generation and keeping moved to attr_accessor and class-level instance variable
|
138
|
+
|
139
|
+
commit bb09d160ec99b41d26bb6ddcd97f667fc28c21f2
|
140
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
141
|
+
Date: Sat Feb 5 17:43:03 2011 +0100
|
142
|
+
|
143
|
+
Added new error classes: I18n::InvalidInflectionOption and I18n::InvalidInflectionKind
|
144
|
+
|
145
|
+
commit dd702ebff0a0204affd5623bce3df86a1a0f171b
|
146
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
147
|
+
Date: Sat Feb 5 17:41:58 2011 +0100
|
148
|
+
|
149
|
+
I18n::Inflector::Config updated
|
150
|
+
|
151
|
+
commit 7855e234e01be5a4e44a539a01c5730919b5f87d
|
152
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
153
|
+
Date: Sat Feb 5 17:40:48 2011 +0100
|
154
|
+
|
155
|
+
Added config proxy to API
|
156
|
+
|
157
|
+
commit e4500dbfa83371052f4f1fdeaebbb7574bb343b9
|
158
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
159
|
+
Date: Sat Feb 5 17:40:10 2011 +0100
|
160
|
+
|
161
|
+
Backend module loading moved after config module loading
|
162
|
+
|
163
|
+
commit c63d0b50f5492387eafdf6b83fb169f9c9c9feea
|
164
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
165
|
+
Date: Thu Feb 3 19:56:55 2011 +0100
|
166
|
+
|
167
|
+
I18n::Inflector::Config optimized
|
168
|
+
|
169
|
+
commit 39826057121142674a8e366d487f4f1509f03cfb
|
170
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
171
|
+
Date: Thu Feb 3 19:56:25 2011 +0100
|
172
|
+
|
173
|
+
Documentation updated
|
174
|
+
|
175
|
+
commit c2954fb3480b43953ba044ff3826b0ca909ba187
|
176
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
177
|
+
Date: Thu Feb 3 03:06:30 2011 +0100
|
178
|
+
|
179
|
+
Refactored configuration constants handling and started working on validation routines
|
180
|
+
|
181
|
+
commit aefb526f9251c48e0270615d8ae8e8eb31a7b946
|
182
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
183
|
+
Date: Wed Feb 2 03:48:50 2011 +0100
|
184
|
+
|
185
|
+
Kind validation and I18n::BadInflectionKind implemented in Backend#prepare_inflection_tokens
|
186
|
+
|
187
|
+
commit 72699c8d3b075515c7bb005ae284798044880a21
|
188
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
189
|
+
Date: Wed Feb 2 03:47:39 2011 +0100
|
190
|
+
|
191
|
+
Interpolation routine for complex kinds simplified
|
192
|
+
|
193
|
+
commit dbaf3062790c3290fbd738ba2c2176decf7f4c4f
|
194
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
195
|
+
Date: Wed Feb 2 03:47:15 2011 +0100
|
196
|
+
|
197
|
+
I18n::BadInflectionKind documented
|
198
|
+
|
199
|
+
commit 5d287872bea57aaf8ef42f82b3a00bebefebab42
|
200
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
201
|
+
Date: Wed Feb 2 03:46:53 2011 +0100
|
202
|
+
|
203
|
+
Added I18n::BadInflectionKind exception class
|
204
|
+
|
205
|
+
commit 5e887376c1de71b5100d12bac9aac3d3f56836ae
|
206
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
207
|
+
Date: Wed Feb 2 00:52:19 2011 +0100
|
208
|
+
|
209
|
+
Added some tests for complex patterns
|
210
|
+
|
211
|
+
commit d7b371087665ba02b248aa259169877aea33b9df
|
212
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
213
|
+
Date: Wed Feb 2 00:52:00 2011 +0100
|
214
|
+
|
215
|
+
Documentation updated
|
216
|
+
|
217
|
+
commit 584986b39d77fa212cafcce6c7473205f4ede6c1
|
218
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
219
|
+
Date: Wed Feb 2 00:51:39 2011 +0100
|
220
|
+
|
221
|
+
Complex pattern interpolation simplified a lot.
|
222
|
+
|
223
|
+
commit bdbeea5e539f6e690d03f4de253fbaa72f23fa32
|
224
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
225
|
+
Date: Mon Jan 31 04:55:31 2011 +0100
|
226
|
+
|
227
|
+
Workarounds in complex pattern processing method for Ruby 1.8 (symbols, erronous enumerators)
|
228
|
+
|
229
|
+
commit ff0379e4eea9cafe1d4da9cb8b5df1284b710bf0
|
230
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
231
|
+
Date: Mon Jan 31 02:21:43 2011 +0100
|
232
|
+
|
233
|
+
Interpolation method fixed and improved (now it sends all subpatterns at once)
|
234
|
+
|
235
|
+
commit fc4ece4637a00003156e1cdf3742c6b9649bc211
|
236
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
237
|
+
Date: Mon Jan 31 02:20:21 2011 +0100
|
238
|
+
|
239
|
+
Key reporting in error reporting methods fixed and improved
|
240
|
+
|
241
|
+
commit 74194159094b59e87899d3b6f231181912a2f6b0
|
242
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
243
|
+
Date: Mon Jan 31 02:19:36 2011 +0100
|
244
|
+
|
245
|
+
Reserved keys updated
|
246
|
+
|
247
|
+
commit aa374a3e84a45ac69e7c79e8d12596932a44604e
|
248
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
249
|
+
Date: Mon Jan 31 02:19:05 2011 +0100
|
250
|
+
|
251
|
+
Documentation updated, removed debugging switch from backend method
|
252
|
+
|
253
|
+
commit c133c73b5260d44bcbc2a765c5b46a82a14151e9
|
254
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
255
|
+
Date: Mon Jan 31 02:18:27 2011 +0100
|
256
|
+
|
257
|
+
Documentation fixed
|
258
|
+
|
259
|
+
commit 3eca748793ac7e1ac4adb5501ffad69d96485e2c
|
260
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
261
|
+
Date: Sun Jan 30 23:49:06 2011 +0100
|
262
|
+
|
263
|
+
Added :inflector_cache_aware switch that causes inflector to pass all options to translate call
|
264
|
+
|
265
|
+
commit 0a9efaedff51caecd1741dfe39152c9a0dbc387f
|
266
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
267
|
+
Date: Sun Jan 30 22:58:11 2011 +0100
|
268
|
+
|
269
|
+
Reading of known kinds improved a bit; one intermediate array on each call
|
270
|
+
|
271
|
+
commit 09d5358f6f829cea2eb42543270c2a0097fe9472
|
272
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
273
|
+
Date: Sun Jan 30 20:38:08 2011 +0100
|
274
|
+
|
275
|
+
Updated HISTORY and TODO
|
276
|
+
|
277
|
+
commit ac2331d4f72b7cbe9a0c2b1c1860a374210800f6
|
278
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
279
|
+
Date: Sun Jan 30 20:37:42 2011 +0100
|
280
|
+
|
281
|
+
Removed cache-related stuff. A cache should be other backend for I18n, not a class for Inflector
|
282
|
+
|
283
|
+
commit a8c48bf13f8856d48195ca40b4e4110339de2d82
|
284
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
285
|
+
Date: Sun Jan 30 20:36:18 2011 +0100
|
286
|
+
|
287
|
+
Options preparing methods moved to I18n::Inflector::InflectionOptions, @known is now a lazy hash
|
288
|
+
|
289
|
+
commit 9cce55b6dfedf0a1720dd8fd7dbe821f7a666d32
|
290
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
291
|
+
Date: Sun Jan 30 20:32:52 2011 +0100
|
292
|
+
|
293
|
+
All inflection related exceptions are now aware of translation key
|
294
|
+
|
295
|
+
commit abee72cce5f552aa0a217a2ef4ed977d7f251cd5
|
296
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
297
|
+
Date: Sun Jan 30 17:43:53 2011 +0100
|
298
|
+
|
299
|
+
Added some test for complex patterns mixed with aliased patterns and loud tokens
|
300
|
+
|
301
|
+
commit d38d9fdb5e4cea7cd2add52d94a1262d3d54cd9a
|
302
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
303
|
+
Date: Sun Jan 30 17:40:55 2011 +0100
|
304
|
+
|
305
|
+
Documentation updated
|
306
|
+
|
307
|
+
commit 67edeef3557064af60de255f2a0778aa9df5d3e6
|
308
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
309
|
+
Date: Sun Jan 30 17:40:44 2011 +0100
|
310
|
+
|
311
|
+
Typo removed
|
312
|
+
|
313
|
+
commit 0fbcc31ab7ada438dc209d49569daf5d44267b02
|
314
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
315
|
+
Date: Sun Jan 30 17:40:34 2011 +0100
|
316
|
+
|
317
|
+
Complex patterns now support loud tokens
|
318
|
+
|
319
|
+
commit d2cd5d76a457f4865c330b7d22d32e27ae903fc7
|
320
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
321
|
+
Date: Sun Jan 30 06:09:19 2011 +0100
|
322
|
+
|
323
|
+
Updated TODO, ChangeLog and HISTORY
|
324
|
+
|
325
|
+
commit 0c77a0c49f32b3a20d1ad6fd6c16ff441e12d8d3
|
326
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
327
|
+
Date: Sun Jan 30 05:56:50 2011 +0100
|
328
|
+
|
329
|
+
Added complex patterns support
|
330
|
+
|
331
|
+
commit 67c0fc2acfe950d96752094fb42d87e9154d562c
|
332
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
333
|
+
Date: Sun Jan 30 05:55:24 2011 +0100
|
334
|
+
|
335
|
+
Added lazy enumerators for arrays
|
336
|
+
|
337
|
+
commit 6e1db292b9f49570780558b1b1d5a3e9aa833e3f
|
338
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
339
|
+
Date: Sun Jan 30 04:14:52 2011 +0100
|
340
|
+
|
341
|
+
Options reading refactored: more efficient way of gathering global & local options in API methods
|
342
|
+
|
343
|
+
commit b99e4a5b02a685ec0f3c210e00428a337c99082a
|
344
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
345
|
+
Date: Sun Jan 30 04:09:42 2011 +0100
|
346
|
+
|
347
|
+
Error messages handling refactored: exceptions are more hierarchical and more DRY
|
348
|
+
|
349
|
+
commit b9c35db66702d137f21a3ef8cc64caba59b20202
|
350
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
351
|
+
Date: Sat Jan 29 23:38:01 2011 +0100
|
352
|
+
|
353
|
+
Added some constants for future features
|
354
|
+
|
355
|
+
commit d29026e54e5f0fea1f43fd5eb89b37808ed12e09
|
356
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
357
|
+
Date: Sat Jan 29 23:37:26 2011 +0100
|
358
|
+
|
359
|
+
Added abstract error reporting classes:
|
360
|
+
|
361
|
+
- I18n::InflectionException,
|
362
|
+
- I18n::InflectionPatternException,
|
363
|
+
- I18n::InclectionConfigurationException.
|
364
|
+
|
365
|
+
commit e88c43fccf877dd69ae25c2793f0da4e3103b31c
|
366
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
367
|
+
Date: Fri Jan 28 03:50:17 2011 +0100
|
368
|
+
|
369
|
+
Bugfix: filtering reserved option names enabled :>
|
370
|
+
|
371
|
+
commit 67f6a0c12cbbe4a7e6980b0b3d2f68e39b665dbf
|
372
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
373
|
+
Date: Fri Jan 28 01:50:24 2011 +0100
|
374
|
+
|
375
|
+
Manifest.txt updated
|
376
|
+
|
377
|
+
commit e624ff5e8102ad5bdd0279a428debaded911df8f
|
378
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
379
|
+
Date: Fri Jan 28 01:49:37 2011 +0100
|
380
|
+
|
381
|
+
Interpolation method moved to I18n::Inflector::Interpolate, loud tokens documented, escaping fixed
|
382
|
+
|
383
|
+
commit 25d9c41cf12c4cbfec237abe9dec7b1991df004a
|
384
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
385
|
+
Date: Thu Jan 27 18:01:20 2011 +0100
|
386
|
+
|
387
|
+
Lists of escape strings are now kind of HSet
|
388
|
+
|
389
|
+
commit 290ee7fb55aaca4dfe788f34fffb914660829cae
|
390
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
391
|
+
Date: Thu Jan 27 17:33:01 2011 +0100
|
392
|
+
|
393
|
+
Added support for loud tokens
|
394
|
+
|
395
|
+
commit 7da2fcd563bdc6c9b8bc0475c4163e16860c27e4
|
396
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
397
|
+
Date: Thu Jan 27 02:46:44 2011 +0100
|
398
|
+
|
399
|
+
Documentation fixes
|
400
|
+
|
401
|
+
commit ceb547f1cc32690ff9ee1e6d5225dfe18119164f
|
402
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
403
|
+
Date: Thu Jan 27 02:46:30 2011 +0100
|
404
|
+
|
405
|
+
Intermediate array removed when dumping hash from LazyHashEnumerator
|
406
|
+
|
407
|
+
commit 50eff6c3ce7def1dddd2f840590f17c8a38c5b61
|
408
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
409
|
+
Date: Thu Jan 27 02:26:30 2011 +0100
|
410
|
+
|
411
|
+
Fixed typo in README
|
412
|
+
|
1
413
|
commit abe5a4570b80924c323dde65e30ba30be50446ce
|
2
414
|
Author: Paweł Wilk <siefca@gnu.org>
|
3
415
|
Date: Thu Jan 27 01:30:54 2011 +0100
|
data/Manifest.txt
CHANGED
@@ -19,10 +19,13 @@ lib/i18n-inflector.rb
|
|
19
19
|
lib/i18n-inflector/api.rb
|
20
20
|
lib/i18n-inflector/api_strict.rb
|
21
21
|
lib/i18n-inflector/backend.rb
|
22
|
+
lib/i18n-inflector/config.rb
|
22
23
|
lib/i18n-inflector/errors.rb
|
24
|
+
lib/i18n-inflector/hset.rb
|
23
25
|
lib/i18n-inflector/inflection_data.rb
|
24
26
|
lib/i18n-inflector/inflection_data_strict.rb
|
25
27
|
lib/i18n-inflector/inflector.rb
|
28
|
+
lib/i18n-inflector/interpolate.rb
|
26
29
|
lib/i18n-inflector/lazy_enum.rb
|
27
30
|
lib/i18n-inflector/long_comments.rb
|
28
31
|
lib/i18n-inflector/options.rb
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Simple Inflector for I18n
|
2
2
|
|
3
|
-
<b>i18n-inflector version <tt>2.
|
3
|
+
<b>i18n-inflector version <tt>2.2</tt></b> (<b><tt>Dea</tt></b>)
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -8,6 +8,17 @@
|
|
8
8
|
* https://github.com/siefca/i18n-inflector/tree
|
9
9
|
* mailto:pw@gnu.org
|
10
10
|
|
11
|
+
|
12
|
+
== Features
|
13
|
+
|
14
|
+
* Inline inflection using patterns.
|
15
|
+
* Key-based inflection using inflection keys.
|
16
|
+
* Definable inflection kinds and tokens.
|
17
|
+
* Easy to use public API for inflection data.
|
18
|
+
* Configurable using special scope of translation data.
|
19
|
+
* Complex patterns support; inflection by more than one kind at a time.
|
20
|
+
* Negative matching, aliases, default tokens, token groups and more…
|
21
|
+
|
11
22
|
== Description
|
12
23
|
|
13
24
|
This library contains a backend module for I18n that adds some extra
|
@@ -18,13 +29,13 @@ within <tt>@{</tt> and <tt>}</tt> symbols. Configuration is stored
|
|
18
29
|
also in translation data, in a scope <tt><locale>.i18n.inflections</tt>,
|
19
30
|
where <tt>locale</tt> is a locale subtree.
|
20
31
|
|
21
|
-
You can
|
32
|
+
You can create your own inflection kinds (gender, title, person, time, author, etc.)
|
22
33
|
of tokens to group them in a meaningful, semantical sets. That means you can
|
23
34
|
apply Inflector to do simple inflection by a gender or a person, when some
|
24
35
|
language requires it.
|
25
36
|
|
26
37
|
It adds the +inflector+ object to the default backend so you can use many
|
27
|
-
methods for accessing loaded inflection data at runtime, or set up global
|
38
|
+
methods for accessing loaded inflection data at runtime, or to set up global
|
28
39
|
switches that are controlling the engine.
|
29
40
|
|
30
41
|
Example translation data:
|
@@ -41,27 +52,42 @@ Example translation data:
|
|
41
52
|
default: neuter
|
42
53
|
|
43
54
|
|
44
|
-
welcome: "Dear @{f:Lady|m:Sir|n:You|All}"
|
45
|
-
|
46
|
-
|
55
|
+
welcome: "Dear @{f:Lady|m:Sir|n:You|All}!"
|
56
|
+
|
57
|
+
@same_but_as_key:
|
58
|
+
f: "Lady"
|
59
|
+
m: "Sir"
|
60
|
+
n: "You"
|
61
|
+
@prefix: "Dear "
|
62
|
+
@suffix: "!"
|
63
|
+
@free: "All"
|
64
|
+
|
65
|
+
From version 2.1.0 the Inflector supports so called named patterns,
|
47
66
|
which can be used if there is a need to be strict and/or to
|
48
67
|
use the same token names but assigned to different kinds. Example:
|
49
68
|
|
50
69
|
welcome: "Dear @gender{f:Lady|m:Sir|n:You|All}"
|
51
70
|
|
71
|
+
From version 2.2.0 the Inflector supports complex patterns,
|
72
|
+
which can be used to inflect some sentence or a word by more
|
73
|
+
than a one kind. That might be very helpful for highly inflected
|
74
|
+
languages. An example pattern:
|
75
|
+
|
76
|
+
welcome: "Dear @gender+number{f+s:Lady|f+p:Ladies|m+s:Sir|m+p:Gentlemen|All}"
|
77
|
+
|
52
78
|
== Why?
|
53
79
|
|
54
80
|
It's intended to be used in a web projects or other projects where
|
55
81
|
translations are performed by many people, yet there is a need to
|
56
|
-
|
57
|
-
other data.
|
82
|
+
inflect sentences with some external variables.
|
58
83
|
|
59
84
|
To achieve similar functionality lambdas can be used but including
|
60
|
-
|
85
|
+
Proc objects in translations might be considered unsafe or memory
|
86
|
+
consuming.
|
61
87
|
|
62
88
|
If you have a troop of happy translators that shouldn't have the
|
63
89
|
ability to execute any code yet you need some simple inflection
|
64
|
-
then
|
90
|
+
then this module might help you.
|
65
91
|
|
66
92
|
See i18n-inflector-rails[https://rubygems.org/gems/i18n-inflector-rails] if
|
67
93
|
you need Rails integration.
|
@@ -85,7 +111,7 @@ you need Rails integration.
|
|
85
111
|
|
86
112
|
== Installation
|
87
113
|
|
88
|
-
* <tt>
|
114
|
+
* <tt>gem install i18n-inflector</tt>
|
89
115
|
|
90
116
|
== Synopsis
|
91
117
|
|
@@ -131,8 +157,8 @@ Detailed example:
|
|
131
157
|
== More information
|
132
158
|
|
133
159
|
* See {I18n::Inflector} module documentation for detailed information about the usage.
|
160
|
+
* See {I18n::Inflector::API} class documentation for detailed information about the API.
|
134
161
|
* See {I18n::Backend::Inflector} module documentation for detailed information about the internals.
|
135
|
-
* See {I18n::Backend::Inflector::API} class documentation for detailed information about the API.
|
136
162
|
* See {whole documentation}[http://rubydoc.info/gems/i18n-inflector/] to browse all documents.
|
137
163
|
|
138
164
|
== Tests
|
@@ -142,11 +168,6 @@ You can run tests both with
|
|
142
168
|
* <tt>rake test</tt> or just <tt>rake</tt>
|
143
169
|
* run a test file directly, e.g. <tt>ruby -Ilib -Itest test/inflector_test.rb</tt>
|
144
170
|
|
145
|
-
== See also
|
146
|
-
|
147
|
-
See {i18n-inflector-rails}[https://rubygems.org/gems/i18n-inflector-rails/] if you need
|
148
|
-
the Rails plug-in that integrates this module with ActionController.
|
149
|
-
|
150
171
|
== Credits
|
151
172
|
|
152
173
|
{Heise Media Polska}[http://www.heise-online.pl/] supports Free Software and has
|