E
E
Evgeny Danilov2016-02-15 19:29:02
Ruby on Rails
Evgeny Danilov, 2016-02-15 19:29:02

Rails - humanize for Cyrillic not working?

Dear Railroaders!
I was surprised to find that the simplest humanize method (as well as titleize and apparently other similar ones) does not work for Russian words. Google is silent on my numerous queries like a fish.
Here is an example in the console:
2.2.2 :002 > "example".humanize
=> "Example" (everything is ok)
2.2.2 :003 > "example".humanize
=> "example" (mystic...)
"russian" " is installed (although it seems to have nothing to do with it). The locale is configured: config.i18n.default_locale = :ru
Friends, I'm at a loss, help me out!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima, 2016-02-15
@jmelkor

Try this: "example".mb_chars.titleize

A
Anton Frolovskiy, 2016-02-16
@fr_ant

mb_chars

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question