messere1 opened a new pull request, #6041:
URL: https://github.com/apache/rocketmq-dashboard/pull/6041

   ### Which Issue(s) This PR Fixes
   
   - Resubmission of #1914 (closed during the August branch-rebase sweep, with 
an invitation to resubmit against the current branch). Original report: #1913, 
closed as not planned — the defect is still present on the current 
`rocketmq-studio` tip.
   
   ### Brief Description
   
   `t()` interpolates parameters with `String.prototype.replace(searchString, 
replacement)`:
   
   - only the **first** occurrence of a placeholder is substituted when a 
string repeats it;
   - a parameter value containing `$&`, `` $` ``, `$'` or `$1` is interpreted 
as a replacement pattern and corrupts the interpolated text.
   
   Switch to `split(...).join(...)` so every occurrence is replaced 
**literally**.
   
   ### How Did You Test This Change?
   
   ```text
   $ cd web && npx vitest run src/i18n/__tests__/LangContext.test.tsx
    Test Files  1 passed (1)
         Tests  8 passed (8)
   $ npx eslint src/i18n/LangContext.tsx 
src/i18n/__tests__/LangContext.test.tsx   # clean
   ```
   
   The new cases cover a repeated placeholder and a `$&` value round-tripping 
literally.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added or updated for non-trivial changes
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text)
   - [x] Architecture constraints stay green (frontend-only change)
   - [x] New source files carry the ASF license header (no new files)
   - [x] Documentation touched where behaviour changed (bug fix only, no 
behaviour spec change)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to