Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 转换活动管理默认\u操作_Ruby On Rails_Ruby On Rails 3_Activeadmin - Fatal编程技术网

Ruby on rails 转换活动管理默认\u操作

Ruby on rails 转换活动管理默认\u操作,ruby-on-rails,ruby-on-rails-3,activeadmin,Ruby On Rails,Ruby On Rails 3,Activeadmin,我已经建立了主动管理与法语翻译。除了没有翻译的表单动作外,其他一切都很好 例如,我得到的是updatemodel,而不是Mettreájour 它应该在法语翻译文件(fr.yaml)中吗 更新 我从formtastic的语言环境文件中使用以下yml翻译了创建操作: fr: formtastic: yes: 'Oui' no: 'Non' create: 'Créer' update: 'Modifier' submit: 'Envoyer' c

我已经建立了主动管理与法语翻译。除了没有翻译的表单动作外,其他一切都很好

例如,我得到的是
updatemodel
,而不是
Mettreájour

它应该在法语翻译文件(
fr.yaml
)中吗

更新

我从formtastic的语言环境文件中使用以下yml翻译了创建操作:

fr:
  formtastic:
    yes: 'Oui'
    no: 'Non'
    create: 'Créer'
    update: 'Modifier'
    submit: 'Envoyer'
    cancel: 'Annuler'
    reset: 'Réinitialiser'
    required: 'requis'
但是,
更新
操作不会被转换

更新2

我将
f.actions
更改为

f.actions do
  f.action :submit
  f.action :cancel
end

现在提交的内容将被翻译。

活动管理员使用Formtastic gem。尝试更改formtastic区域设置

例如:

fr:
  formtastic:
    titles:
      post_details: "Post details"
    labels:
      post:
        title: "Your Title"
        body: "Write something..."
        edit:
          title: "Edit title"
    hints:
      post:
        title: "Choose a good title for your post."
        body: "Write something inspiring here."
    placeholders:
      post:
        title: "Title your post"
        slug: "Leave blank for an automatically generated slug"
      user:
        email: "you@yours.com"
    actions:
      create: "Create my %{model}"
      update: "Save changes"
      reset: "Reset form"
      cancel: "Cancel and go back"
      dummie: "Launch!"

我没有想到这一点!这一定是解决办法。我明天试试,谢谢!您的yml不起作用,但我在github存储库中找到了一个区域设置文件。我更新了我的问题。结果是active admin安装了formtastic 2.2.1。我在我的gemfle中指定了formtastic 4,它成功了。