Skip to content

fix(i18n): use %{product_name} in api_keys usage_instructions (#1505)#2000

Merged
jjmata merged 1 commit into
we-promise:mainfrom
Rene0422:fix/i18n-product-name-api-keys-1505
May 26, 2026
Merged

fix(i18n): use %{product_name} in api_keys usage_instructions (#1505)#2000
jjmata merged 1 commit into
we-promise:mainfrom
Rene0422:fix/i18n-product-name-api-keys-1505

Conversation

@Rene0422
Copy link
Copy Markdown
Contributor

@Rene0422 Rene0422 commented May 26, 2026

Summary

Closes #1505.

The issue body singled out en.yml and fr.yml as still hardcoding "Maybe API" in the settings.api_keys.show.current_api_key.usage_instructions key, but those two were actually fixed in #1501 — both already use %{product_name}. The same swap was never applied to the other locales, so five translations still ship the stale brand.

The view side is already wired up: every render site passes product_name: product_name into the t() call:

So the fix is locale-only.

Changes

Five one-line edits in config/locales/views/settings/api_keys/:

File Before After
nb.yml:39 …til Maybe API-et: …til %{product_name} API-et:
pl.yml:40 …do API Maybe: …do API %{product_name}:
tr.yml:39 Maybe API'ye istek… %{product_name} API'ye istek…
es.yml:40 …a la API de Maybe: …a la API de %{product_name}:
zh-TW.yml:40 在向 Maybe API 發送… 在向 %{product_name} API 發送…

Each preserves the surrounding grammar (article, particle, spacing) of its translation.

Verified

$ grep -rn "Maybe" config/locales/views/settings/api_keys/
config/locales/views/settings/api_keys/tr.yml:18:        description: "Maybe verilerinize…"

The only remaining "Maybe" reference is in tr.yml:18 (no_api_key.description) — see "Out of scope" below.

Out of scope

  • tr.yml:18 no_api_key.description — still says "Maybe verilerinize…". Skipped because:
    1. The key is rendered via t(".no_api_key.description") with no product_name: argument, so swapping the literal for %{product_name} would leave the placeholder unresolved.
    2. The English equivalent at en.yml:26 also hardcodes "Sure", so this would need an EN/FR + view change first.
    3. It's not a usage_instructions key, which is what the issue scopes.

Happy to address as a follow-up if reviewers want a broader branding sweep.

Test plan

  • bin/rails runner 'I18n.available_locales.each { |l| I18n.with_locale(l) { I18n.t("settings.api_keys.show.current_api_key.usage_instructions", product_name: "Sure") } }; puts "ok"' — sanity check that every locale parses and resolves the placeholder.
  • bin/rails test
  • bin/rubocop -f github -a
  • bundle exec erb_lint ./app/**/*.erb -a
  • Manual: switch the UI to Spanish / Polish / Turkish / Norwegian / Traditional Chinese, open Settings → API Keys, confirm the usage-instructions sentence reads "Sure" (or whatever Rails.configuration.x.product_name is set to) instead of "Maybe".

Summary by CodeRabbit

  • Documentation
    • Updated API key usage instruction translations across Spanish, Norwegian, Polish, Turkish, and Traditional Chinese to dynamically reference the correct product name in API documentation.

Review Change Stack

@superagent-security superagent-security Bot added contributor:verified Contributor passed trust analysis. pr:verified PR passed security analysis. and removed not-gittensor labels May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b13fa3e-6b2e-44d4-aea7-fb3ce844912b

📥 Commits

Reviewing files that changed from the base of the PR and between e0537a4 and 608646c.

📒 Files selected for processing (5)
  • config/locales/views/settings/api_keys/es.yml
  • config/locales/views/settings/api_keys/nb.yml
  • config/locales/views/settings/api_keys/pl.yml
  • config/locales/views/settings/api_keys/tr.yml
  • config/locales/views/settings/api_keys/zh-TW.yml

📝 Walkthrough

Walkthrough

This PR updates API key settings translation files across five languages (Spanish, Norwegian, Polish, Turkish, Traditional Chinese) to replace hardcoded "Maybe API" product name references with dynamic %{product_name} interpolation placeholders in usage instruction strings.

Changes

Localization branding updates

Layer / File(s) Summary
Localization updates for product name interpolation
config/locales/views/settings/api_keys/es.yml, config/locales/views/settings/api_keys/nb.yml, config/locales/views/settings/api_keys/pl.yml, config/locales/views/settings/api_keys/tr.yml, config/locales/views/settings/api_keys/zh-TW.yml
All five locale files' usage_instructions strings now use %{product_name} interpolation instead of hardcoded brand name references, enabling white-label customization and consistency across locales.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • we-promise/sure#1555: Updates the same localization keys for English and French locales with identical product name interpolation refactoring.

Suggested labels

contributor:verified, pr:verified

Suggested reviewers

  • jjmata

Poem

🐰 Five tongues now speak the %{product_name} way,
No more hardcoded "Maybe" here to stay,
Dynamic branding flows through each locale,
A rabbit's clean refactor—simply hale! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: updating locale files to use %{product_name} interpolation instead of hardcoded text in API key usage instructions.
Linked Issues check ✅ Passed The PR successfully replaces hardcoded product name references with %{product_name} interpolation in five locale files (nb.yml, pl.yml, tr.yml, es.yml, zh-TW.yml), meeting the core objective to enable consistent branding and white-labelling as requested in issue #1505.
Out of Scope Changes check ✅ Passed All changes are directly within scope: locale file updates for usage_instructions keys as specified in issue #1505. No unrelated modifications to codebase logic, structure, or other functionality are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jjmata jjmata merged commit 946c4d0 into we-promise:main May 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:verified Contributor passed trust analysis. pr:verified PR passed security analysis.

Development

Successfully merging this pull request may close these issues.

Branding cleanup: replace hardcoded Maybe API with product_name in usage_instructions locale keys

2 participants