Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with calendar data #188

Merged
merged 1 commit into from Jun 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md.erb
Expand Up @@ -257,6 +257,15 @@ TwitterCldr::Localized::LocalizedTimespan.new(45).to_s(:approximate => true) #
TwitterCldr::Localized::LocalizedTimespan.new(52).to_s(:approximate => true) # <%= assert(TwitterCldr::Localized::LocalizedTimespan.new(52).to_s(:approximate => true), "In 1 minute").inspect %>
```

### Calendar Data

CLDR contains a trove of calendar data, much of which can be accessed. One example is names of months, days, years.

```ruby
TwitterCldr::Shared::Calendar.new(:sv).months.take(3) # <%= assert(TwitterCldr::Shared::Calendar.new(:sv).months.take(3), ["Januari", "Februari", "Mars"]).inspect %>
```


### Lists

TwitterCLDR supports formatting lists of strings as you might do in English by using commas, eg: "Apples, cherries, and oranges". Use the `localize` method on an array followed by a call to `to_sentence`:
Expand Down