Commit 16b248d
Issue 35647 translate content on page not working (#36231)
## Summary
Fixes #35647
When a user selected a language that had no page version yet, the UVE
editor showed a confirmation dialog asking to create a new translation.
Clicking **"No"** previously navigated the user back to the previous
language. This made it impossible to view or translate the content that
already exists on the page in that language without first creating a
full page version.
### What changed
**`edit-ema-editor.component.ts` — stay on selected language when
declining to create a translation**
The `reject` handler in `createNewTranslation` previously called
`#goBackToCurrentLanguage()` to navigate back to the previous language.
It now does nothing — the page is already loaded in the target language
when the dialog appears, so dismissing the dialog naturally keeps the
user there.
Content already on the page is shown in the selected language where
versions exist, with fallback to the default language where they don't.
The page is read-only (no editing) since there is no page version in
that language.
**`withPageApi.ts` — sync mode to Preview when page has no translation**
When a page loads in an untranslated language, `pageParams.mode` is
forced to `UVE_MODE.PREVIEW` so the store's mode matches the read-only
state the iframe is already in.
**`withEditor.ts` — expose `$isMissingTranslation` signal**
Made the internal `isMissingTranslation` computed public so the mode
selector can react to it.
**`dot-editor-mode-selector.component.ts` — restrict the mode dropdown**
- **Draft hidden**: always hidden when `$isMissingTranslation = true` —
there is nothing to draft-edit.
- **Published hidden**: also hidden — the fallback content shown is not
the published state of that language.
- **`$syncSelectedMode` effect**: replaced one-time `ngOnInit`
initialization with a reactive `effect` so the dropdown updates whenever
the mode or available options change (e.g. when switching languages).
### Behavior after fix
| Action | Before | After |
|---|---|---|
| Select untranslated language | Dialog appears → clicking "No" returns
to previous language | Dialog appears → clicking "No" stays on selected
language (read-only) |
https://github.com/user-attachments/assets/deb2a91d-b2be-4fc7-8dec-50bd5a5af195
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 527c553 commit 16b248d
10 files changed
Lines changed: 215 additions & 166 deletions
File tree
- core-web/libs/portlets/edit-ema/portlet/src/lib
- dot-ema-shell
- edit-ema-editor
- components/dot-uve-toolbar
- components/dot-editor-mode-selector
- store/features
- editor
- page-api
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| 645 | + | |
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
207 | 240 | | |
208 | 241 | | |
209 | 242 | | |
| |||
Lines changed: 33 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
83 | 107 | | |
84 | 108 | | |
85 | 109 | | |
| |||
118 | 142 | | |
119 | 143 | | |
120 | 144 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 145 | | |
128 | 146 | | |
129 | 147 | | |
| |||
Lines changed: 4 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
798 | 799 | | |
799 | 800 | | |
800 | 801 | | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
| 802 | + | |
| 803 | + | |
838 | 804 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | 805 | | |
843 | 806 | | |
844 | 807 | | |
845 | 808 | | |
846 | 809 | | |
847 | 810 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | 811 | | |
854 | | - | |
| 812 | + | |
855 | 813 | | |
856 | 814 | | |
857 | 815 | | |
| |||
Lines changed: 7 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| |||
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | | - | |
289 | | - | |
| 287 | + | |
| 288 | + | |
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
310 | 296 | | |
311 | 297 | | |
312 | 298 | | |
| |||
396 | 382 | | |
397 | 383 | | |
398 | 384 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | 385 | | |
433 | 386 | | |
434 | 387 | | |
| |||
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
281 | 278 | | |
282 | 279 | | |
283 | 280 | | |
| |||
0 commit comments