我已经构建了多语言应用程序。但是在这一点上,我发现通过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
我试图将语言环境变量设置为输入,但这根本没有给我任何错误。有人有类似的问题吗?