Pro 8541 switch locale empty doc - #5135
Merged
Merged
Conversation
ValJed
marked this pull request as draft
November 3, 2025 14:39
…to parent component
…ehavior, emit entire locale
…s when localizing
ValJed
marked this pull request as ready for review
November 4, 2025 14:44
…Name to localize modal, sets missing currentId
haroun
suggested changes
Nov 5, 2025
| "willMoveImageToArchive": "Tým sa obrázok presunie do archívu.", | ||
| "yes": "Áno", | ||
| "yesLocalizeAndSwitchLocales": "Áno, preložte túto stránku a prepnite jazykovú mutáciu", | ||
| "yesLocalizeAndSwitchLocalesDoc": "Sim, localizar este {{ docType }} e trocar idiomas", |
| }, | ||
| computed: { | ||
| ...mapState(useModalStore, [ 'activeModal', 'updateModalData' ]), | ||
| ...mapState(useModalStore, [ 'activeModal' ]), |
Contributor
There was a problem hiding this comment.
we still use updateModalData, why did we removed it?
Contributor
Author
There was a problem hiding this comment.
Yes it was already here in the methods, so when you added it in the computed it created a duplicates warning. (methods should be added to methods not computed which is for reactive data: refs / computed).
|
|
||
| ### Adds | ||
|
|
||
| * When switching locale from the doc editor, ask the user if he wants to localize the current one in the target locale or want to start a blank document. |
Contributor
There was a problem hiding this comment.
Suggested change
| * When switching locale from the doc editor, ask the user if he wants to localize the current one in the target locale or want to start a blank document. | |
| * When switching locale from the doc editor, ask if the user wants to localize the current document in the target locale or want to start a blank document. |
ValJed
force-pushed
the
pro-8541-switch-locale-empty-doc
branch
from
November 5, 2025 11:20
b28a981 to
c03f0e3
Compare
haroun
suggested changes
Nov 6, 2025
| const forbiddenTooltip = $t('apostrophe:localeSwitcherPermissionToCreate', { | ||
| docType: props.moduleOptions.label.toLowerCase() | ||
| }); | ||
| const docType = $t(props.moduleOptions.label)?.toLowerCase(); |
Contributor
There was a problem hiding this comment.
I don't think this is a reliable way to get the doc type. It should be props.moduleOptions.name.
|
|
||
| if (isLocalized) { | ||
| this.switchModalLocale(locale.name); | ||
| await this.$nextTick(); |
Contributor
Author
There was a problem hiding this comment.
I thought it was necessary somehow, when testing now it looks working without it.. Removing.
… (we use modalData.locale instead)
…, no call to redirect route
ValJed
force-pushed
the
pro-8541-switch-locale-empty-doc
branch
3 times, most recently
from
November 12, 2025 10:00
c7a6e09 to
80407dd
Compare
ValJed
force-pushed
the
pro-8541-switch-locale-empty-doc
branch
from
November 12, 2025 10:02
80407dd to
50e7895
Compare
haroun
approved these changes
Nov 12, 2025
haroun
added a commit
that referenced
this pull request
Nov 12, 2025
* main: Pro 8541 switch locale empty doc (#5135)
haroun
added a commit
that referenced
this pull request
Nov 12, 2025
…ation * main: Pro 8541 switch locale empty doc (#5135)
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.
Summary
See ticket, flow support:
Cypress tests: https://github.com/apostrophecms/testbed/pull/399
What kind of change does this PR introduce?
Make sure the PR fulfills these requirements: