From 4cfc3163eed461cd8b83229f49a327bb5edd4080 Mon Sep 17 00:00:00 2001 From: Paul Bob <69730720+Paul-Bob@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:03:56 +0200 Subject: [PATCH] feature: configure custom save label per resource using localization (#182) --- docs/3.0/localization.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/3.0/localization.md b/docs/3.0/localization.md index 03750796..c95e80a2 100644 --- a/docs/3.0/localization.md +++ b/docs/3.0/localization.md @@ -62,6 +62,19 @@ es: other: 'archivos' ``` +## Localizing buttons label + +The `avo.save` configuration applies to all save buttons. If you wish to customize the localization for a specific resource, such as `Avo::Resources::Product`, you can achieve this by: + +```yml +--- +en: + avo: + resource_translations: + product: + save: "Save the product!" +``` + ## Setting the locale Setting the locale for Avo is simple. Just use the `config.locale = :en` config attribute. Default is `nil` and will fall back to whatever you have configured in `application.rb`.