Ruby Rails 中使用表单编辑和更新时如何更改按钮标题

How to change the button title when I use the the form to edit and update in Ruby on Rails

views/articles/new.html.erb我有

<div class="py-16 bg-gray-50 overflow-hidden lg:py-24">
  <div class="relative max-w-xl mx-auto px-4 sm:px-6 lg:px-8 lg:max-w-7xl">


<h1>Novo Artigo</h1>

<%= render "form", article: @article %>
  </div>
</div>

views/articles/new.html.erb我有

<div class="py-16 bg-gray-50 overflow-hidden lg:py-24">
  <div class="relative max-w-xl mx-auto px-4 sm:px-6 lg:px-8 lg:max-w-7xl">

  <h1>Editar artigo</h1>

  <%= render "form", article: @article %>
  </div>
</div>

我有 _form.html.erb,我想知道如何在编辑文章和创建新文章时更改按钮标题。

<%= form_with model: article do |form| %>
  <-- other code -->
  <%= form.submit 'Criar artigo', class:"mt-44 inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"%>
<% end %>

解决方案是删除 <%= form.submit 'Criar atigo'...%>config/locales/en.yml 上的文本,我这样写:

en:
  helpers:
    submit:
      create: "Criar um artigo"
      update: "Editar um artigo"