Skip to content

feat: JOOWP-277: [CORE] R9.2 Translate the JavaScript strings through the runtime config - #58

Merged
jooservices-aiflow-bot[bot] merged 2 commits into
developfrom
JOOWP-277-core-r9-2-translate-the-javascript-strin
Oct 23, 2026
Merged

jooservices-aiflow-bot[bot] merged 2 commits into
developfrom
JOOWP-277-core-r9-2-translate-the-javascript-strin

Conversation

@jooservices-aiflow-bot

Copy link
Copy Markdown
Contributor

Jira: JOOWP-277

Summary

Moved the last hard-coded English strings in the JS and block view.js files onto t() with new __() entries in JsStrings.php. Added the ESLint rule joo/no-literal-ui-string (wired into make lint, with rule tests) and a Vitest test that checks every t() key has a PHP entry. Terminal help text was already translated and is now covered by the same guards; command names stay English by design, documented in docs/modules/terminal.md.

Tests

composer install and npm ci passed. make lint passed, including the new rule. make analyse passed after I fixed the TypeScript types on the new rule. make test-unit was green before the last type-only edit to the rule file (288 PHPUnit tests, 394 Vitest tests). After that edit I re-ran only the rule's own tests (15 passed), not the full suite.

Run

  • account: claude-02 (claude/sonnet)
  • run: 07a556f2-af58-4301-8afd-d3e0a335ea4f, fence 2
  • files changed: 16

Opened as a draft by AI Flow v4; verification runs next (In Verify).

… the runtime config

Moved the last hard-coded English strings in the JS and block `view.js` files onto `t()` with new `__()` entries in `JsStrings.php`. Added the ESLint rule `joo/no-literal-ui-string` (wired into `make lint`, with rule tests) and a Vitest test that checks every `t()` key has a PHP entry. Terminal help text was already translated and is now covered by the same guards; command names stay English by design, documented in `docs/modules/terminal.md`.

Refs: JOOWP-277
AI-Run: 07a556f2-af58-4301-8afd-d3e0a335ea4f (claude-02, claude/sonnet)
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef5b835a-4896-4652-b22a-635b8070c850

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@jooservices-aiflow-bot

Copy link
Copy Markdown
Contributor Author

AI Flow verify: FAIL (verify failed).

Findings:

  • packages/theme-core/resources/js/terminal/shell.js:142-148: The "command not found" line is a user-visible English literal outside the runtime config: `bash: ${name}: command not found` plus . Did you mean '${best.key}'? or . Try 'help'.. This breaks AC1, and the same file's did_you_mean key already exists in JsStrings.php. Fix: add JsStrings.php entries for the suggestion and the hint (e.g. terminal.command_not_found, terminal.did_you_mean, terminal.try_help) and build the line with message()/t(), as commands/site.js does for terminal.command.open.not_found. Alternatively, document the bash-imitating prefix as English by design and translate only the hint text.
  • packages/theme-core/resources/js/terminal/commands/system.js:~68-72: The uname output ('Linux', `Linux ${host} 6.8.0-joo … GNU/Linux`) is a literal passed to text(). It imitates real command output, so the fix is to either document it as English by design in docs/modules/terminal.md or route it through t().
  • tools/eslint-rules/no-literal-ui-string.mjs: The rule only checks textContent/title/alt assignments, setAttribute, createTextNode and the el() helper. The terminal's text() and line() helpers are not sinks, which is why make lint passes while shell.js and system.js still carry English literals. This weakens AC2 for terminal output. Fix: add text (argument 0) to HELPERS, then fix or exempt the hits. Add rule tests for text('English'), and for a template literal passed to text().

Checks: composer install ok; npm ci ok; make lint pass; make analyse pass (0 errors); make test-unit pass (51 Vitest files, 394 tests).

… the runtime config

The terminal's "command not found" line, hint, syntax-error and error wrappers are now translated through new `JsStrings.php` keys. The lint rule treats the terminal's `text()` as a sink, with rule tests added. `uname` and the `which` path are documented as English by design and exempted explicitly, which meets AC1 and AC2, and the terminal help text is covered (AC3).

Refs: JOOWP-277
AI-Run: c2ee2870-0bdb-4f5f-a04c-ce04a23cb3e7 (claude-03, claude/sonnet)
@jooservices-aiflow-bot
jooservices-aiflow-bot Bot marked this pull request as ready for review October 23, 2026 21:02
@jooservices-aiflow-bot
jooservices-aiflow-bot Bot merged commit 9dc829f into develop Oct 23, 2026
5 checks passed
@jooservices-aiflow-bot
jooservices-aiflow-bot Bot deleted the JOOWP-277-core-r9-2-translate-the-javascript-strin branch October 23, 2026 21:03
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.

0 participants