【发布时间】:2014-06-06 07:21:19
【问题描述】:
我已经构建了多语言应用程序。但是此时我发现通过ActiveAdmin界面编辑我的翻译有很多麻烦。我希望能够通过此界面添加/编辑翻译。因为使用 seed.rb 不是用户的选择。
想法是在编辑/创建产品时有 2 个文本字段,在第一个文本字段中,我可以用我的母语编写产品描述,第二个用英文描述。我不为产品表创建新列。我不想使用内置的 Globalize3 结构。
像category_translations 这样的其他表在哪里。
如果我这样尝试:
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs "Content" do
f.input :name
f.input :condition, :collection => @condition,:hint=>"Select condition"
f.input :sub_desc, :input_html => { :class => "tinymce" }
f.input :description, :input_html => { :class => "tinymce" },:locale=>'en'
f.input :description, :input_html => { :class => "tinymce" },:locale=>'lv'
f.input :technical_data, :input_html => {:class=>"tinymce" }
f.input :intro_text
f.input :category, :collection => @category
f.input :slug
f.input :manufacturer, :collection => @manufacturer,:hint=>"Choose manufacturer"
end
f.inputs "Image" do
f.input :photo, :as => :file, :hint=>"Select image to upload. Allowed file formats *jpg *png, Soft signs not Allowed"
#form :partial => "form"
end
f.actions
end
我试图将语言环境变量设置为输入,但这根本没有给我任何错误。 有人遇到过类似问题吗?
【问题讨论】:
标签: ruby-on-rails translation activeadmin globalize3 globalize