feat: warn about invalid ICU placeholders in the editor - #3782
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe translation list and table editors now compute invalid ICU placeholders using project placeholder data and display them through ChangesInvalid ICU placeholder validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TranslationWrite
participant useInvalidPlaceholders
participant useProject
participant getInvalidPlaceholders
participant MissingPlaceholders
TranslationWrite->>useInvalidPlaceholders: pass translation state
useInvalidPlaceholders->>useProject: read ICU placeholders
useInvalidPlaceholders->>getInvalidPlaceholders: validate translation placeholders
getInvalidPlaceholders-->>useInvalidPlaceholders: return invalid placeholders
useInvalidPlaceholders-->>TranslationWrite: return invalid placeholders
TranslationWrite->>MissingPlaceholders: pass missing and invalid placeholders
MissingPlaceholders-->>TranslationWrite: render localized validation messages
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
bdshadow
marked this pull request as ready for review
July 18, 2026 22:46
bdshadow
force-pushed
the
bdshadow/invalid-icu-placeholders
branch
from
July 20, 2026 08:29
b8f1ee4 to
565613c
Compare
Show an "Invalid ICU: {value}" message next to the missing-placeholders
hint when the edited translation contains text that looks like a
placeholder but isn't valid ICU (e.g. `{placeholder:space}`), using the
new getInvalidPlaceholders helper from @tginternal/editor.
bdshadow
force-pushed
the
bdshadow/invalid-icu-placeholders
branch
from
July 20, 2026 11:49
565613c to
01032b8
Compare
dkrizan
approved these changes
Jul 20, 2026
TolgeeMachine
added a commit
that referenced
this pull request
Jul 20, 2026
# [3.214.0](v3.213.1...v3.214.0) (2026-07-20) ### Features * warn about invalid ICU placeholders in the editor ([#3782](#3782)) ([95838f5](95838f5)), closes [tolgee/editor#10](tolgee/editor#10) [tolgee/editor#10](tolgee/editor#10)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When ICU is enabled for a project and the edited translation contains an invalid ICU placeholder (e.g.
{placeholder:space}), show anInvalid ICU: {value}message next to the "Missing:" placeholder hint, listing the offending expression(s).This complements the editor-side change (tolgee/editor#10, released as
@tginternal/editor1.19.0), where such expressions now render as plain text: no chip in "Hide code", no highlighting in "Show code", and no RTL scrambling. Invalid RTL content keeps its own direction instead of being forced LTR.Changes
useInvalidPlaceholdershook: detects invalid placeholders in the current translation viagetInvalidPlaceholders, gated onproject.icuPlaceholders.MissingPlaceholders: renders theInvalid ICU: {value}warning (error color) alongside the missing-placeholders hint.TranslationWriteviews.@tginternal/editorbumped to 1.19.0.TODO before merge
getInvalidPlaceholdersexport).@tginternal/editorto the published version.translations_invalid_icu_placeholderskey in the Tolgee project (taggeddraft: invalid-icu-placeholders, with screenshot).Testing
eslintandtscpass. Verified manually against RTL Arabic translations mixing valid ({name}) and invalid ({placeholder:space},{هذا نص عربي}) placeholders: valid ones render as chips in the correct RTL position, invalid ones as plain text following their content direction, and the warning message shows in both editor layouts.Summary by CodeRabbit