मैं i18n सिस्टम का उपयोग कर रेल फॉर्म का अनुवाद करना चाहता हूं।रेल - फॉर्म क्रियाओं में मॉडल नाम का अनुवाद करें
मेरे मॉडल विशेषताओं का सही ढंग से अनुवाद किया जाता है, लेकिन जब मैं सबमिट क्रियाओं का अनुवाद करना चाहता हूं, मॉडल नाम का अनुवाद नहीं किया जाता है।
यहाँ मेरी fr.yml स्थान फ़ाइल है
fr:
activerecord:
model:
character:
one: "Personnage"
other: "Personnages"
attributes:
character:
name: "Nom"
title: "Titre"
biography: "Biographie"
helpers:
submit:
update: "Mise à jour %{model}"
मेरे _form.html.erb
<%= form_for(@character) do |f| %>
<% if @character.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@character.errors.count, "error") %> prohibited this character from being saved:</h2>
<ul>
<% @character.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :biography %><br />
<%= f.text_area :biography, :rows => 8%>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
मेरी प्रपत्र पर है, मैं अद्यतन बटन की उम्मीद "होने के लिए मिसे à jour Personnage ", लेकिन मेरे पास अभी भी" माईस à jour कैरेक्टर "है।
आपकी मदद के लिए धन्यवाद!
यह है! मदद के लिए आपका बहुत बहुत धन्यवाद ! –
आपका बहुत स्वागत है! मैंने पहले यह गलती कर ली है। –
क्योंकि मैं इस समस्या में भाग गया था: यदि आपका मॉडल 'ActiveModel' का उपयोग करता है लेकिन सीधे' ActiveRecord' नहीं है (शायद क्योंकि आप इसके बजाय डेटा मैपर का उपयोग करते हैं), तो इसके बजाय 'activemodel.models.character' का उपयोग करें। –