R
R
Ruslan Galiev2013-05-31 12:54:24
Ruby on Rails
Ruslan Galiev, 2013-05-31 12:54:24

Ruby on Rails: localization of month and day names not working

Added translations of months and days to the localization file config/locales/ru.yml

ru:
  date:
    formats:
      default: "%d-%m-%Y"
      short: "%b %d"
      long: "%B %d, %Y"

    day_names: [Воскресенье, Понедельник, Вторник, Среда, Четверг, Пятница, Суббота]
    abbr_day_names: [Вос, Пон, Вт, Ср, Чет, Пят, Суб]

    month_names: [~, Январь, Февраль, Март, Апрель, Маи, Июнь, Июль, Август, Сентябрь, Октябрь, Ноябрь, Декабрь]
    abbr_month_names: [~, Янв, Фев, Мар, Апр, Маи, Июн, Июл, Авг, Сен, Окт, Ноя, Дек]
  time:
    formats:
      default: "%d-%m-%Y %H:%M:%S"
      short: "%d %B %H:%M"
      long: "%B %d, %Y %H:%M"

I inserted it into the test view.html.erb.
time now: <%= l Time.now, :format => :short %>
At the output I get:
time now: 31 l 13:13
Instead of the name of the month “Mai”, for some reason, the letter “l” is inserted, who can tell what this is connected with?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Galiev, 2013-05-31
@HerMajor

sl_bug, I already had the ru.date translation in the localization file, well, mine :)))))) Thank you all for your help and enlightenment :)

H
himik, 2013-05-31
@himik

use

B
bsboris, 2013-05-31
@bsboris

Use the russian gem .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question