Skip to content

Instantly share code, notes, and snippets.

@mamantoha
Created April 18, 2017 18:03
Show Gist options
  • Save mamantoha/5c10a153dd0e4aa393583374f4b607a9 to your computer and use it in GitHub Desktop.
Save mamantoha/5c10a153dd0e4aa393583374f4b607a9 to your computer and use it in GitHub Desktop.
Ukrainian language support for Ruby on Rails
# config/locales/defaults/uk.rb
{
uk: {
date: {
# In Ukrainian month name with day and standalone day are different
month_names: lambda do |key, options|
if options[:format] && options[:format] =~ /%-?d %B/
:'date.month_names_with_day'
else
:'date.month_names_standalone'
end
end
}
}
}
# config/locales/defaults/uk.yml
uk:
date:
formats:
full: "%-d %B, %Y - %A"
full_month: "%B, %Y"
full_day: "%-d %B, %Y"
week_abbr: "%a"
month_names_with_day:
-
- січня
- лютого
- березня
- квітня
- травня
- червня
- липня
- серпня
- вересня
- жовтня
- листопада
- грудня
month_names_standalone:
-
- Січень
- Лютий
- Березень
- Квітень
- Травень
- Червень
- Липень
- Серпень
- Вересень
- Жовтень
- Листопад
- Грудень
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment