开发者

Ruby on Rails devise translation

开发者 https://www.devze.com 2023-03-18 04:46 出处:网络
views/devise/sessions/new.开发者_如何学JAVAhtml.haml %h2 = t(\'devise.sessions.link\') devise can\'t find the translation

views/devise/sessions/new.开发者_如何学JAVAhtml.haml

%h2 
  = t('devise.sessions.link')

devise can't find the translation

<span class="translation_missing" title="translation missing: ru.devise.sessions.link">Link</span> 

but

ru:
  devise:
    sessions:
      link: 'Войти'

is present in config/locales/devise.ru.yml


Rails merges the parsed yaml files correctly but, when a key is used twice within the same translation file, one of them will be replaced by the other, the same way it would when adding an existing key value pair to a manually created hash.

example yaml file:

----
:foo: bar
:foo: foo

example code use:

require 'rubygems'
require 'yaml'
YAML::load("--- \n:foo: :bar\n:foo: :foo\n")

output:

=> {:foo=>:foo} 
0

精彩评论

暂无评论...
验证码 换一张
取 消