Skip to content

Add translators comments and number sprintf placeholders#301

Open
masteradhoc wants to merge 1 commit into
plausible:developfrom
masteradhoc:translation-improvments
Open

Add translators comments and number sprintf placeholders#301
masteradhoc wants to merge 1 commit into
plausible:developfrom
masteradhoc:translation-improvments

Conversation

@masteradhoc
Copy link
Copy Markdown

@masteradhoc masteradhoc commented May 16, 2026

Reviewed and improved some flagged plugin-check issues related to internationalization:

  • Added // translators: comments above every __() call that contains placeholders or HTML, giving translators the context they need
  • Replaced unordered %s placeholders with numbered equivalents (%1$s, %2$s, etc.) in strings that contain multiple substitutions, ensuring translators can reorder them for their language

Summary by CodeRabbit

  • Documentation
    • Enhanced translator context annotations for user-facing messages throughout the admin and integration modules to support more accurate translations across supported languages.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c10831c6-8c4e-452f-9a5d-05c3f54025b8

📥 Commits

Reviewing files that changed from the base of the PR and between c2fc480 and 141c3f3.

📒 Files selected for processing (9)
  • src/Admin/Module.php
  • src/Admin/Settings/API.php
  • src/Admin/Settings/Hooks.php
  • src/Admin/Settings/Page.php
  • src/Admin/Upgrades.php
  • src/Ajax.php
  • src/Client.php
  • src/Integrations/EDD.php
  • src/Integrations/WooCommerce.php

📝 Walkthrough

Walkthrough

This PR enhances internationalization support by adding translator context comments to clarify placeholder meanings in user-facing translatable strings across the plugin. It also standardizes some message templates to use numbered sprintf placeholders instead of unnumbered ones for better translation consistency.

Changes

Translator context and placeholder standardization

Layer / File(s) Summary
Admin module error and proxy messages
src/Admin/Module.php
Three translator hints added to proxy-related messages: module installation failure, non-SSL proxy notice, and proxy enablement error with inaccessible REST API.
Onboarding wizard slide descriptions
src/Admin/Settings/API.php
Welcome and success slide templates updated with translator comments and numbered placeholders (%1$s, %2$s, etc.) to match sprintf argument positions.
Settings page descriptions and output
src/Admin/Settings/Hooks.php, src/Admin/Settings/Page.php
Translator context comments added to ten settings and hook output locations (analytics connection, affiliate patterns, query parameters, proxy bypass, shared links, view stats messages); one shared-link example converted to numbered placeholders.
Admin upgrade notices
src/Admin/Upgrades.php
Translator context comments added to CE and Cloud API token notice outputs.
API token validation error
src/Ajax.php
Invalid token error message updated with translator comment and numbered placeholders for token creation URL and read-more link.
Client API error messages
src/Client.php
Six translator context comments added to error messages in tracker configuration, shared link creation, goal creation, funnel creation, goal deletion, and custom property enablement operations.
Integration goal labels
src/Integrations/EDD.php, src/Integrations/WooCommerce.php
Translator hints added to product page visit goal labels in EDD and WooCommerce integrations.

In readme's glow and translator's care,
We whisper hints of placeholders fair,
From admin's page to API's call,
Each %s now has context for all! 🐰

🚥 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 accurately summarizes the main changes across all files: adding translator comments and converting sprintf placeholders to numbered format.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant