README.md in ffi-icu-0.5.1 vs README.md in ffi-icu-0.5.2

- old
+ new

@@ -98,11 +98,11 @@ curf = ICU::NumberFormatting.create('en-US', :currency) curf.format(1234.56, 'USD') #=> "$1,234.56" ``` Time Formatting/Parsing --------------------------- +----------------------- Examples: ```ruby # class method interface @@ -128,13 +128,12 @@ formatter = ICU::TimeFormatting.create(:locale => 'cs_CZ', :date => :pattern, :time => :pattern, :skeleton => 'Y') formatter.format(Time.now) #=> "2015" ``` - Duration Formatting ---------------- +------------------- ```ruby # What the various styles look like formatter = ICU::DurationFormatting::DurationFormatter.new(locale: 'en-AU', style: :long) formatter.format({hours: 8, minutes: 40, seconds: 35}) #=> "8 hours, 40 minutes, 35 seconds" @@ -175,11 +174,11 @@ # All fractional parts except the last are truncated formatter = ICU::DurationFormatting::DurationFormatter.new(locale: 'en-AU', style: :long) formatter.format({days: 2, hours: 7.3, minutes: 40.9, seconds:0.43}) #=> "2 days, 7 hours, 40 minutes, 0.43 seconds" -# With RU locale +# With RU locale formatter = ICU::DurationFormatting::DurationFormatter.new(locale: 'ru', style: :long) formatter.format({hours: 1, minutes: 2, seconds: 3}) #=> "1 час 2 минуты 3 секунды" formatter = ICU::DurationFormatting::DurationFormatter.new(locale: 'ru', style: :long) formatter.format({hours: 10, minutes: 20, seconds: 30}) #=> "10 часов 20 минут 30 секунд" formatter = ICU::DurationFormatting::DurationFormatter.new(locale: 'ru', style: :narrow) @@ -193,10 +192,23 @@ Example: ```ruby ICU::Transliteration.transliterate('Traditional-Simplified', '沈從文') # => "沈从文" +``` +Locale +------ + +Examples: + +```ruby +locale = ICU::Locale.new('en-US') +locale.display_country('en-US') #=> "United States" +locale.display_language('es') #=> "inglés" +locale.display_name('es') #=> "inglés (Estados Unidos)" +locale.display_name_with_context('en-US', [:length_short]) #=> "English (US)" +locale.display_name_with_context('en-US', [:length_long]) #=> "English (United States)" ``` TODO: =====