From 162caf0e9f2a15b43293f0b9cea908ee8c837a64 Mon Sep 17 00:00:00 2001 From: Brian Richard <44203805+briian365@users.noreply.github.com> Date: Sun, 26 Apr 2026 10:29:23 +0300 Subject: [PATCH] fix(localization): update API usage instructions to include product name placeholder (#1555) * fix(localization): update API usage instructions to include product name placeholder * Fix: Update show and created views to use dynamic usage_instructions per CodeRabbit * fix: update usage instructions translation key for API key usage --- app/views/settings/api_keys/created.html.erb | 2 +- app/views/settings/api_keys/show.html.erb | 4 ++-- config/locales/views/settings/api_keys/en.yml | 2 +- config/locales/views/settings/api_keys/fr.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/settings/api_keys/created.html.erb b/app/views/settings/api_keys/created.html.erb index 5e7eb833e..05f7eceb0 100644 --- a/app/views/settings/api_keys/created.html.erb +++ b/app/views/settings/api_keys/created.html.erb @@ -77,7 +77,7 @@

How to use your API key

-

Include your API key in the X-Api-Key header when making requests:

+

<%= t("settings.api_keys.show.current_api_key.usage_instructions", product_name: product_name) %>

curl -H "X-Api-Key: <%= @api_key.plain_key %>" <%= request.base_url %>/api/v1/accounts
diff --git a/app/views/settings/api_keys/show.html.erb b/app/views/settings/api_keys/show.html.erb index 91e1bd322..5aefbe560 100644 --- a/app/views/settings/api_keys/show.html.erb +++ b/app/views/settings/api_keys/show.html.erb @@ -37,7 +37,7 @@

How to use your API key

-

Include your API key in the X-Api-Key header when making requests:

+

<%= t(".current_api_key.usage_instructions", product_name: product_name) %>

curl -H "X-Api-Key: <%= @current_api_key.plain_key %>" <%= request.base_url %>/api/v1/accounts
@@ -125,7 +125,7 @@

How to use your API key

-

Include your API key in the X-Api-Key header when making requests:

+

<%= t(".current_api_key.usage_instructions", product_name: product_name) %>

curl -H "X-Api-Key: <%= @current_api_key.plain_key %>" <%= request.base_url %>/api/v1/accounts
diff --git a/config/locales/views/settings/api_keys/en.yml b/config/locales/views/settings/api_keys/en.yml index 07f25246b..f6f3d4d46 100644 --- a/config/locales/views/settings/api_keys/en.yml +++ b/config/locales/views/settings/api_keys/en.yml @@ -37,7 +37,7 @@ en: never_expires: "Never expires" permissions: "Permissions" usage_instructions_title: "How to use your API key" - usage_instructions: "Include your API key in the X-Api-Key header when making requests to the Maybe API:" + usage_instructions: "Include your API key in the X-Api-Key header when making requests to the %{product_name} API:" regenerate_key: "Create New Key" revoke_key: "Revoke Key" revoke_confirmation: "Are you sure you want to revoke this API key? This action cannot be undone and will immediately disable all applications using this key." diff --git a/config/locales/views/settings/api_keys/fr.yml b/config/locales/views/settings/api_keys/fr.yml index 8a6fdfe3c..9851ab654 100644 --- a/config/locales/views/settings/api_keys/fr.yml +++ b/config/locales/views/settings/api_keys/fr.yml @@ -37,7 +37,7 @@ fr: never_expires: "N'expire jamais" permissions: "Autorisations" usage_instructions_title: "Comment utiliser votre clé API" - usage_instructions: "Incluez votre clé API dans l'en-tête X-Api-Key lors des requêtes à l'API Maybe :" + usage_instructions: "Incluez votre clé API dans l'en-tête X-Api-Key lors des requêtes à l'API %{product_name} :" regenerate_key: "Créer une nouvelle clé" revoke_key: "Révoquer la clé" revoke_confirmation: "Êtes-vous sûr(e) de vouloir révoquer cette clé API ? Cette action ne peut pas être annulée et désactivera immédiatement toutes les applications utilisant cette clé."