Answer the question
In order to leave comments, you need to log in
Russian in Ruby on Rails?
RoR does not accept Russian string literals in the controller file:
SyntaxError in PagesController#about<br/>
<br/>
/home/alex/rails/test/app/controllers/pages_controller.rb:3: invalid multibyte char (US-ASCII)<br/>
/home/alex/rails/test/app/controllers/pages_controller.rb:3: invalid multibyte char (US-ASCII)<br/>
/home/alex/rails/test/app/controllers/pages_controller.rb:3: syntax error, unexpected $end, expecting keyword_end<br/>
@title = "Главная"<br/>
^<br/>
Rails.root: /home/alex/rails/test<br/>
GATEWAY_INTERFACE: "CGI/1.1"<br/>
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"<br/>
HTTP_ACCEPT_CHARSET: "windows-1251,utf-8;q=0.7,*;q=0.3"<br/>
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"<br/>
HTTP_ACCEPT_LANGUAGE: "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4"<br/>
HTTP_CACHE_CONTROL: "max-age=0"<br/>
REMOTE_ADDR: "127.0.0.1"<br/>
REMOTE_HOST: "localhost"<br/>
SERVER_NAME: "localhost"<br/>
SERVER_PROTOCOL: "HTTP/1.1"
Answer the question
In order to leave comments, you need to log in
Read this: Rails Internationalization (I18n) API and don't write string literals in controllers or models anymore.
In general, take a look at this screencast: Railscasts: #30 Pretty Page Title and read the comments to it to learn how to organize the work with page titles correctly (“rails-way”).
This is something related to the ruby 1.9.x branch, there is no such thing under 1.8.7.
Moreover, I remember that if you generate a project from under 1.9.x right away, then this does not happen.
Does anyone have experience of migrating Russian-language projects from 1.8.7 to 1.9.x?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question