Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 444 lines (304 sloc) 18.817 kB
7553f83 Merging in changes suggested by KL-7 to integrate Travis
Cameron Dutro authored
1 ## twitter-cldr-rb [![Build Status](https://secure.travis-ci.org/twitter/twitter-cldr-rb.png?branch=master)](http://travis-ci.org/twitter/twitter-cldr-rb)
5fc211e @camertron Beginning the cldr gem
camertron authored
2
4c751ac @caniszczyk Update README.md
caniszczyk authored
3 TwitterCldr uses Unicode's Common Locale Data Repository (CLDR) to format certain types of text into their
1b6238a @camertron Update README.md
camertron authored
4 localized equivalents. Currently supported types of text include dates, times, currencies, decimals, percentages, and symbols.
5fc211e @camertron Beginning the cldr gem
camertron authored
5
1b6238a @camertron Update README.md
camertron authored
6 ## Installation
7
8 `gem install twitter_cldr`
5fc211e @camertron Beginning the cldr gem
camertron authored
9
1b6238a @camertron Update README.md
camertron authored
10 ## Usage
11
12 ```ruby
13 require 'twitter_cldr'
14 ```
15
16 ### Basics
17
18 Get a list of all currently supported locales (these are all supported on twitter.com):
19
20 ```ruby
21 TwitterCldr.supported_locales # [:ar, :da, :de, :en, :es, ... ]
22 ```
23
24 Determine if a locale is supported by TwitterCLDR:
25
26 ```ruby
27 TwitterCldr.supported_locale?(:es) # true
28 TwitterCldr.supported_locale?(:xx) # false
29 ```
30
31
32 TwitterCldr patches core Ruby objects like Fixnum and Date to make localization as straightforward as possible.
33
34 ### Numbers
35
36 Fixnum, Bignum, and Float objects are supported. Here are some examples:
4c751ac @caniszczyk Update README.md
caniszczyk authored
37
38 ```ruby
1b6238a @camertron Update README.md
camertron authored
39 # default formatting with to_s
4c751ac @caniszczyk Update README.md
caniszczyk authored
40 1337.localize(:es).to_s # 1.337
1b6238a @camertron Update README.md
camertron authored
41
42 # currencies, default USD
33103ad Fixed tests to accommodate CLDR version 21 changes
Cameron Dutro authored
43 1337.localize(:es).to_currency.to_s # 1.337,00 $
44 1337.localize(:es).to_currency.to_s(:currency => "EUR") # 1.337,00 €
45 1337.localize(:es).to_currency.to_s(:currency => "Peru") # 1.337,00 S/.
1b6238a @camertron Update README.md
camertron authored
46
47 # percentages
4c751ac @caniszczyk Update README.md
caniszczyk authored
48 1337.localize(:es).to_percent.to_s # 1.337%
49 1337.localize(:es).to_percent.to_s(:precision => 2) # 1.337,00%
1b6238a @camertron Update README.md
camertron authored
50
51 # decimals
52 1337.localize(:es).to_decimal.to_s(:precision => 3) # 1.337,000
53 ```
54
55 **Note**: The :precision option can be used with all these number formatters.
56
57 Behind the scenes, these convenience methods are creating instances of LocalizedNumber. You can do the same thing if you're feeling adventurous:
58
59 ```ruby
60 num = TwitterCldr::LocalizedNumber.new(1337, :es)
61 num.to_currency.to_s # ...etc
62 ```
63
64 #### More on Currencies
65
66 If you're looking for a list of supported countries and currencies, use the TwitterCldr::Shared::Currencies class:
67
68 ```ruby
69 # all supported countries
70 TwitterCldr::Shared::Currencies.countries # ["Lithuania", "Philippines", ... ]
71
72 # all supported currency codes
73 TwitterCldr::Shared::Currencies.currency_codes # ["LTL", "PHP" ... ]
74
75 # data for a specific country
76 TwitterCldr::Shared::Currencies.for_country("Canada") # { :currency => "Dollar", :symbol => "$", :code => "CAD" }
77
78 # data for a specific currency code
ed0c061 @camertron A few minor changes to the currency section of the readme.
camertron authored
79 TwitterCldr::Shared::Currencies.for_code("CAD") # { :currency => "Dollar", :symbol => "$", :country => "Canada"}
1b6238a @camertron Update README.md
camertron authored
80 ```
81
82 ### Dates and Times
83
84 Date, Time, and DateTime objects are supported:
85
86 ```ruby
33103ad Fixed tests to accommodate CLDR version 21 changes
Cameron Dutro authored
87 DateTime.now.localize(:es).to_full_s # "lunes, 12 de diciembre de 2011 21:44:57 UTC -0800"
88 DateTime.now.localize(:es).to_long_s # "12 de diciembre de 2011 21:44:57 -08:00"
89 DateTime.now.localize(:es).to_medium_s # "12/12/2011 21:44:57"
90 DateTime.now.localize(:es).to_short_s # "12/12/11 21:44"
1b6238a @camertron Update README.md
camertron authored
91
92 Date.today.localize(:es).to_full_s # "lunes 12 de diciembre de 2011"
93 Date.today.localize(:es).to_long_s # "12 de diciembre de 2011"
94 Date.today.localize(:es).to_medium_s # "12/12/2011"
95 Date.today.localize(:es).to_short_s # "12/12/11"
96
97 Time.now.localize(:es).to_full_s # "21:44:57 UTC -0800"
0bf2732 Fixing stupid stupid timezone crap in readme_spec
Cameron Dutro authored
98 Time.now.localize(:es).to_long_s # "21:44:57 UTC"
d01b6ff Added readme tests, localized array. Fixed number formatting from co…
Cameron Dutro authored
99 Time.now.localize(:es).to_medium_s # "21:44:57"
100 Time.now.localize(:es).to_short_s # "21:44"
4c751ac @caniszczyk Update README.md
caniszczyk authored
101 ```
102
1b6238a @camertron Update README.md
camertron authored
103 The CLDR data set only includes 4 specific date formats, full, long, medium, and short, so you'll have to choose amongst them for the one that best fits your needs. Yes, it's limiting, but the 4 formats get the job done most of the time :)
4c751ac @caniszczyk Update README.md
caniszczyk authored
104
1b6238a @camertron Update README.md
camertron authored
105 Behind the scenes, these convenience methods are creating instances of LocalizedDate, LocalizedTime, and LocalizedDateTime. You can do the same thing if you're feeling adventurous:
4c751ac @caniszczyk Update README.md
caniszczyk authored
106
107 ```ruby
1b6238a @camertron Update README.md
camertron authored
108 dt = TwitterCldr::LocalizedDateTime.new(DateTime.now, :es)
109 dt.to_short_s # ...etc
4c751ac @caniszczyk Update README.md
caniszczyk authored
110 ```
111
2cb63d8 @camertron Update master
camertron authored
112 #### Relative Dates and Times
113
114 In addition to formatting full dates and times, TwitterCLDR supports relative time spans via several convenience methods and the `LocalizedTimespan` class. TwitterCLDR tries to guess the best time unit (eg. days, hours, minutes, etc) based on the length of the time span. Unless otherwise specified, TwitterCLDR will use the current date and time as the reference point for the calculation.
115
116 ```ruby
117 (DateTime.now - 1).localize.ago # 1 day ago
118 (DateTime.now - 0.5).localize.ago # 12 hours ago (i.e. half a day)
119
120 (DateTime.now + 1).localize.until # In 1 day
121 (DateTime.now + 0.5).localize.until # In 12 hours
122 ```
123
124 Specify other locales:
125
126 ```ruby
127 (DateTime.now - 1).localize(:de).ago # Vor 1 Tag
128 (DateTime.now + 1).localize(:de).until # In 1 Tag
129 ```
130
131 Force TwitterCLDR to use a specific time unit by including the `:unit` option:
132
133 ```ruby
134 (DateTime.now - 1).localize(:de).ago(:unit => :hour) # Vor 24 Stunden
135 (DateTime.now + 1).localize(:de).until(:unit => :hour) # In 24 Stunden
136 ```
137
138 Specify a different reference point for the time span calculation:
139
140 ```ruby
141 # 86400 = 1 day in seconds, 259200 = 3 days in seconds
142 (Time.now + 86400).localize(:de).ago(:unit => :hour, :base_time => (Time.now + 259200)) # Vor 48 Stunden
143 ```
144
145 Behind the scenes, these convenience methods are creating instances of `LocalizedTimespan`, whose constructor accepts a number of seconds as the first argument. You can do the same thing if you're feeling adventurous:
146
147 ```ruby
148 ts = TwitterCldr::LocalizedTimespan.new(86400, :de)
149 ts.to_s # In 1 Tag
150 ts.to_s(:hour) # In 24 Stunden
151
152 ts = TwitterCldr::LocalizedTimespan.new(-86400, :de)
153 ts.to_s # Vor 1 Tag
154 ts.to_s(:hour) # Vor 24 Stunden
155 ```
156
1b6238a @camertron Update README.md
camertron authored
157 ### Plural Rules
158
159 Some languages, like English, have "countable" nouns. You probably know this concept better as "plural" and "singular", i.e. the difference between "strawberry" and "strawberries". Other languages, like Russian, have three plural forms: one (numbers ending in 1), few (numbers ending in 2, 3, or 4), and many (everything else). Still other languages like Japanese don't use countable nouns at all.
160
161 TwitterCLDR makes it easy to find the plural rules for any numeric value:
4c751ac @caniszczyk Update README.md
caniszczyk authored
162
163 ```ruby
164 1.localize(:ru).plural_rule # :one
165 2.localize(:ru).plural_rule # :few
166 5.localize(:ru).plural_rule # :many
167 ```
168
1b6238a @camertron Update README.md
camertron authored
169 Behind the scenes, these convenience methods use the TwitterCldr::Formatters::Plurals::Rules class. You can do the same thing (and a bit more) if you're feeling adventurous:
4c751ac @caniszczyk Update README.md
caniszczyk authored
170
171 ```ruby
1b6238a @camertron Update README.md
camertron authored
172 # get all rules for the default locale
173 TwitterCldr::Formatters::Plurals::Rules.all # [:one, ... ]
174
175 # get all rules for a specific locale
176 TwitterCldr::Formatters::Plurals::Rules.all_for(:es) # [:one, :other]
177 TwitterCldr::Formatters::Plurals::Rules.all_for(:ru) # [:one, :few, :many, :other]
178
179 # get the rule for a number in a specific locale
180 TwitterCldr::Formatters::Plurals::Rules.rule_for(1, :ru) # :one
181 TwitterCldr::Formatters::Plurals::Rules.rule_for(2, :ru) # :few
4c751ac @caniszczyk Update README.md
caniszczyk authored
182 ```
9f3ef52 @camertron Updated history/version etc
camertron authored
183
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
184 ### Plurals
185
186 In addition to providing access to plural rules, TwitterCLDR allows you to embed plurals directly in your source code:
187
188 ```ruby
189 replacements = { :horse_count => 3,
190 :horses => { :one => "is 1 horse",
191 :other => "are %{horse_count} horses" } }
192
193 # "there are 3 horses in the barn"
194 "there %{horse_count:horses} in the barn".localize % replacements
195 ```
196
197 Because providing a pluralization hash with the correct plural rules can be difficult, you can also embed plurals as a JSON hash into your string:
198
199 ```ruby
200 str = 'there %<{ "horse_count": { "one": "is one horse", "other": "are %{horse_count} horses" } }> in the barn'
201
202 # "there are 3 horses in the barn"
203 str.localize % { :horse_count => 3 }
204 ```
205
070d08a @camertron Update README.md
camertron authored
206 NOTE: If you're using TwitterCLDR with Rails 3, you may see an error if you try to use the `%` function on a localized string in your views. Strings in views in Rails 3 are instances of `SafeBuffer`, which patches the `gsub` method that the TwitterCLDR plural formatter relies on. To fix this issue, simply call `to_str` on any `SafeBuffer` before calling `localize`. More info [here](https://github.com/rails/rails/issues/1555). An example:
207
208 ```ruby
209 # throws an error in Rails 3 views:
210 '%<{"count": {"one": "only one", "other": "tons more!"}}'.localize % { :count => 2 }
211
212 # works just fine:
213 '%<{"count": {"one": "only one", "other": "tons more!"}}'.to_str.localize % { :count => 2 }
214 ```
215
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
216 The `LocalizedString` class supports all forms of interpolation and combines support from both Ruby 1.8 and 1.9:
217
218 ```ruby
3bc4b07 @camertron Update readme to add missing plural description.
camertron authored
219 # Ruby 1.8
220 "five euros plus %.3f in tax" % (13.25 * 0.087)
221
222 # Ruby 1.9
d01b6ff Added readme tests, localized array. Fixed number formatting from co…
Cameron Dutro authored
223 "five euros plus %.3f in tax" % (13.25 * 0.087)
3bc4b07 @camertron Update readme to add missing plural description.
camertron authored
224 "there are %{count} horses in the barn" % { :count => "5" }
225
226 # with TwitterCLDR
227 "five euros plus %.3f in tax".localize % (13.25 * 0.087)
81fa6fd @camertron A bit more readme cleanup.
camertron authored
228 "there are %{count} horses in the barn".localize % { :count => "5" }
3bc4b07 @camertron Update readme to add missing plural description.
camertron authored
229 ```
230
231 When you pass a Hash as an argument and specify placeholders with %<foo>d, TwitterCLDR will interpret the hash values as named arguments and format the string according to the instructions appended to the closing `>`. In this way, TwitterCLDR supports both Ruby 1.8 and 1.9 interpolation syntax in the same string:
232
233 ```ruby
234 "five euros plus %<percent>.3f in %{noun}".localize % { :percent => 13.25 * 0.087, :noun => "tax" }
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
235 ```
236
1b6238a @camertron Update README.md
camertron authored
237 ### World Languages
9e6fdb3 @caniszczyk Update README
caniszczyk authored
238
1b6238a @camertron Update README.md
camertron authored
239 You can use the localize convenience method on language code symbols to get their equivalents in another language:
9e6fdb3 @caniszczyk Update README
caniszczyk authored
240
1b6238a @camertron Update README.md
camertron authored
241 ```ruby
242 :es.localize(:es).as_language_code # "español"
36b3f0e @camertron Fixing typo in readme.
camertron authored
243 :ru.localize(:es).as_language_code # "ruso"
1b6238a @camertron Update README.md
camertron authored
244 ```
9e6fdb3 @caniszczyk Update README
caniszczyk authored
245
1b6238a @camertron Update README.md
camertron authored
246 Behind the scenes, these convenience methods are creating instances of LocalizedSymbol. You can do the same thing if you're feeling adventurous:
247
248 ```ruby
249 ls = LocalizedSymbol.new(:ru, :es)
250 ls.as_language_code # "ruso"
251 ```
252
253 In addition to translating language codes, TwitterCLDR provides access to the full set of supported languages via the TwitterCldr::Shared::Languages class:
254
255 ```ruby
256 # get all languages for the default locale
257 TwitterCldr::Shared::Languages.all # { ... :"zh-Hant" => "Traditional Chinese", :vi => "Vietnamese" ... }
258
259 # get all languages for a specific locale
260 TwitterCldr::Shared::Languages.all_for(:es) # { ... :"zh-Hant" => "chino tradicional", :vi => "vietnamita" ... }
261
262 # get a language by its code for the default locale
263 TwitterCldr::Shared::Languages.from_code(:'zh-Hant') # "Traditional Chinese"
264
265 # get a language from its code for a specific locale
266 TwitterCldr::Shared::Languages.from_code_for_locale(:'zh-Hant', :es) # "chino tradicional"
267
268 # translate a language from one locale to another
269 # signature: translate_language(lang, source_locale, destination_locale)
270 TwitterCldr::Shared::Languages.translate_language("chino tradicional", :es, :en) # "Traditional Chinese"
271 TwitterCldr::Shared::Languages.translate_language("Traditional Chinese", :en, :es) # "chino tradicional"
272 ```
273
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
274 ### Unicode Data
275
276 TwitterCLDR provides ways to retrieve individual code points as well as normalize and decompose Unicode text.
277
278 Retrieve data for code points:
279
280 ```ruby
f6b1d13 Added NFC and NFKC algorithms, refactored Shared::UnicodeData::Attrib…
Cameron Dutro authored
281 code_point = TwitterCldr::Shared::CodePoint.for_hex("1F3E9")
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
282 code_point.name # "LOVE HOTEL"
283 code_point.bidi_mirrored # "N"
284 code_point.category # "So"
285 code_point.combining_class # "0"
286 ```
287
288 Convert characters to code points:
289
290 ```ruby
c17a2ad @camertron Update README to include new CodePoint and NFD/NFKD classes.
camertron authored
291 TwitterCldr::Utils::CodePoints.from_string("¿") # ["00BF"]
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
292 ```
293
294 Convert code points to characters:
295
296 ```ruby
c17a2ad @camertron Update README to include new CodePoint and NFD/NFKD classes.
camertron authored
297 TwitterCldr::Utils::CodePoints.to_string(["00BF"]) # "¿"
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
298 ```
299
2cb63d8 @camertron Update master
camertron authored
300 Normalize/decompose a Unicode string (NFD, NFKD, NFC, and NFKC implementations available). Note that the normalized string will almost always look the same as the original string because most character display systems automatically combine decomposed characters.
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
301
302 ```ruby
303 TwitterCldr::Normalizers::NFD.normalize("français") # "français"
304 ```
305
c17a2ad @camertron Update README to include new CodePoint and NFD/NFKD classes.
camertron authored
306 Normalization is easier to see in hex:
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
307
308 ```ruby
309 # ["0065", "0073", "0070", "0061", "00F1", "006F", "006C"]
c17a2ad @camertron Update README to include new CodePoint and NFD/NFKD classes.
camertron authored
310 TwitterCldr::Utils::CodePoints.from_string("español")
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
311
312 # ["0065", "0073", "0070", "0061", "006E", "0303", "006F", "006C"]
c17a2ad @camertron Update README to include new CodePoint and NFD/NFKD classes.
camertron authored
313 TwitterCldr::Utils::CodePoints.from_string(TwitterCldr::Normalizers::NFD.normalize("español"))
3648965 @camertron Updating readme to incorporate plurals and unicode data/normalization.
camertron authored
314 ```
315
316 Notice in the example above that the letter "ñ" was transformed from `00F1` to `006E 0303`, which represent the "n" and the "˜" respectively.
317
3c8886a @camertron Updating readme again to include unicode normalization and code point…
camertron authored
318 A few convenience methods also exist for `String` that make it easy to normalize and get code points for strings:
319
320 ```ruby
321 # ["0065", "0073", "0070", "0061", "00F1", "006F", "006C"]
322 "español".localize.code_points
323
324 # ["0065", "0073", "0070", "0061", "006E", "0303", "006F", "006C"]
325 "español".localize.normalize.code_points
326 ```
327
d01b6ff Added readme tests, localized array. Fixed number formatting from co…
Cameron Dutro authored
328 Specify a specific normalization algorithm via the :using option. Currently, only NFD and NFKD are supported (default is NFD):
329
330 ```ruby
331 # ["0065", "0073", "0070", "0061", "006E", "0303", "006F", "006C"]
332 "español".localize.normalize(:using => :NFKD).code_points
333 ```
334
1b6238a @camertron Update README.md
camertron authored
335 ## About Twitter-specific Locales
336
337 Twitter tries to always use BCP-47 language codes. Data from the CLDR doesn't always match those codes, so TwitterCLDR provides a `convert_locale` method to convert between the two. All functionality throughout the entire gem defers to `convert_locale` before retrieving CLDR data. `convert_locale` supports Twitter-supported BCP-47 language codes as well as CLDR locale codes, so you don't have to guess which one to use. Here are a few examples:
338
339 ```ruby
340 TwitterCldr.convert_locale(:'zh-cn') # :zh
341 TwitterCldr.convert_locale(:zh) # :zh
342 TwitterCldr.convert_locale(:'zh-tw') # :'zh-Hant'
343 TwitterCldr.convert_locale(:'zh-Hant') # :'zh-Hant'
344
345 TwitterCldr.convert_locale(:msa) # :ms
346 TwitterCldr.convert_locale(:ms) # :ms
347 ```
348
349 There are a few functions in TwitterCLDR that don't require a locale code, and instead use the default locale by calling `TwitterCldr.get_locale`. The `get_locale` function defers to `FastGettext.locale` when the FastGettext library is available, and falls back on :en (English) when it's not. (Twitter uses the FastGettext gem to retrieve translations efficiently in Ruby).
350
351 ```ruby
352 TwitterCldr.get_locale # will return :en
353
354 require 'fast_gettext'
355 FastGettext.locale = "ru"
356
357 TwitterCldr.get_locale # will return :ru
358 ```
359
360 ## Requirements
361
362 No external requirements.
5fc211e @camertron Beginning the cldr gem
camertron authored
363
4c27cb0 @camertron Update README.md
camertron authored
364 ## Running Tests
365
366 `bundle exec rake` should do the trick. Tests are written in RSpec using RR as the mocking framework.
367
891f77d @camertron Update master
camertron authored
368 ## JavaScript Support
369 (Note: These changes have not yet been released as a gem.)
370
371 TwitterCLDR currently supports localization of dates and times in JavaScript. More awesome features are coming soon.
372
373 ### Generating the JavaScript
374
375 You can automatically generate the JavaScript versions of TwitterCLDR using this Rubygem. Here's the one-liner:
376
377 `bundle exec rake js:build OUTPUT_DIR=/path/to/desired/output/location`
378
379 If you'd like to customize the generated output further, you'll need to require the `TwitterCldr::Js` namespace. You can choose the locales to export and whether to export a minified version alongside the full version for each locale.
380
381 ```ruby
382 require 'twitter_cldr'
383
384 TwitterCldr.require_js # require JavaScript environment
385 TwitterCldr::Js.output_dir = "/path/to/output/location"
386 TwitterCldr::Js.make(:locales => [:de, :sv, :ja, :ar], # generate files for German, Swedish,
387 :minify => true) # Japanese, and Arabic
388 TwitterCldr::Js.install # copy files to output directory
389 ```
390
391 ### Dates and Times (JS)
392
393 ```javascript
394 // include twitter_cldr_es.js for the Spanish DateTimeFormatter
395 var fmt = new TwitterCldr.DateTimeFormatter();
396
397 fmt.format(new Date(), {"type": "full"}); // "lunes, 12 de diciembre de 2011 21:44:57 UTC -0800"
398 fmt.format(new Date(), {"type": "long"}); // "12 de diciembre de 201121:45:42 -08:00"
399 fmt.format(new Date(), {"type": "medium"}); // "12/12/2011 21:46:09"
400 fmt.format(new Date(), {"type": "short"}); // "12/12/11 21:47"
401
402 fmt.format(new Date(), {"format": "date", "type": "full"}); // "lunes, 12 de diciembre de 2011"
403 fmt.format(new Date(), {"format": "date", "type": "long"}); // "12 de diciembre de 2011"
404 fmt.format(new Date(), {"format": "date", "type": "medium"}); // "12/12/2011"
405 fmt.format(new Date(), {"format": "date", "type": "short"}); // "12/12/11"
406
407 fmt.format(new Date(), {"format": "time", "type": "full"}); // "21:44:57 UTC -0800"
408 fmt.format(new Date(), {"format": "time", "type": "long"}); // "21:45:42 -08:00"
409 fmt.format(new Date(), {"format": "time", "type": "medium"}); // "21:46:09"
410 fmt.format(new Date(), {"format": "time", "type": "short"}); // "21:47"
411 ```
412
413 The CLDR data set only includes 4 specific date formats, full, long, medium, and short, so you'll have to choose amongst them for the one that best fits your needs. Yes, it's limiting, but the 4 formats get the job done most of the time :)
414
415 ### Running Tests (JS)
416
417 A JavaScript test suite comes with twitter-cldr-rb. You'll need to install the Qt libs to be able to run the suite, as it uses [jasmine](https://github.com/pivotal/jasmine-gem) and [jasmine-headless-webkit](http://johnbintz.github.com/jasmine-headless-webkit/).
418
419 1. Install qt (eg. `brew install qt`, `sudo apt-get install qt4`, etc)
420 2. Run `bundle`
421 3. Run `bundle exec rake js:test`
422
423 The tests are located in `js/spec` and look similar to RSpec tests.
424
9e6fdb3 @caniszczyk Update README
caniszczyk authored
425 ## Authors
5fc211e @camertron Beginning the cldr gem
camertron authored
426
9e6fdb3 @caniszczyk Update README
caniszczyk authored
427 * Cameron C. Dutro: http://github.com/camertron
1b6238a @camertron Update README.md
camertron authored
428 * Portions taken from the ruby-cldr gem by Sven Fuchs: http://github.com/svenfuchs/ruby-cldr
429
430 ## Links
431 * ruby-cldr gem: [http://github.com/svenfuchs/ruby-cldr](http://github.com/svenfuchs/ruby-cldr)
432 * fast_gettext gem: [https://github.com/grosser/fast_gettext](https://github.com/grosser/fast_gettext)
433 * CLDR homepage: [http://cldr.unicode.org/](http://cldr.unicode.org/)
5fc211e @camertron Beginning the cldr gem
camertron authored
434
9e6fdb3 @caniszczyk Update README
caniszczyk authored
435 ## License
5fc211e @camertron Beginning the cldr gem
camertron authored
436
9e6fdb3 @caniszczyk Update README
caniszczyk authored
437 Copyright 2012 Twitter, Inc.
5fc211e @camertron Beginning the cldr gem
camertron authored
438
9e6fdb3 @caniszczyk Update README
caniszczyk authored
439 Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
1b6238a @camertron Update README.md
camertron authored
440
441 ## Future Plans
442
891f77d @camertron Update master
camertron authored
443 * Implement Unicode Collation Algorithm (UCA) for sorting/searching.
1b6238a @camertron Update README.md
camertron authored
444 * Patch Ruby 1.8 strings to provide better Unicode support (probably using pack and unpack).
Something went wrong with that request. Please try again.