Skip to content

Pro 8671 fix localize modal - #5156

Merged
ValJed merged 3 commits into
mainfrom
pro-8671-fix-localize-modal
Nov 13, 2025
Merged

ValJed merged 3 commits into
mainfrom
pro-8671-fix-localize-modal

Conversation

@ValJed

@ValJed ValJed commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Summary

Use modalData.locale in AposI18nLocalize component. This generates somehow a watcher to not be triggered so:
moves relatedDocTypes to data (recomputed only when relatedDocs change). Get rid of two watchers.

What are the specific steps to test this change?

https://github.com/apostrophecms/testbed/actions/runs/19333410651 🟢

What kind of change does this PR introduce?

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

@linear

linear Bot commented Nov 13, 2025

Copy link
Copy Markdown

@ValJed
ValJed force-pushed the pro-8671-fix-localize-modal branch from d92bc1e to 39bc51b Compare November 13, 2025 13:41
this.docTypesSeen.push(item.value);
this.wizard.values.relatedDocTypesToLocalize.data.push(item.value);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the watcher on relatedDocTypes used to do, no need for a watcher here since we want to set it when related doc types are set in batch mode only.

this.wizard.values.relatedDocTypesToLocalize.data.push(doc.type);
}
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the watcher on relatedDocs used to do, no need for a watcher here since relatedDocs is set by the method updateRelatedDocs all the time. Makes code more comprehensible.

@ValJed
ValJed requested review from haroun and myovchev November 13, 2025 13:49

@myovchev myovchev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is also apos.getActiveLocale(). We really need to document "how to get current locale" once and for all.

@ValJed

ValJed commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

@myovchev getActiveLocale() is handy for when you need it out of vue. Most of the time in vue it's preferable to use the computed directly (because dynamic, can be watched etc)

@ValJed
ValJed merged commit 28dc223 into main Nov 13, 2025
9 checks passed
@ValJed
ValJed deleted the pro-8671-fix-localize-modal branch November 13, 2025 15:27
haroun added a commit that referenced this pull request Nov 19, 2025
* main:
  PRO-8708: bring back passing of the actual area options in the form developers expect to see them to custom insert menu item components (#5162)
  adds object of useful error when widget fails to render (#5141)
  add addMissingSchemaFields task (#5101)
  Pro 8360 box field (#5142)
  Pro 8671 fix localize modal (#5156)
  longPolling: false option (#5154)
  PRO-5472: file widget (#5126)
haroun added a commit that referenced this pull request Nov 19, 2025
* main:
  PRO-8708: bring back passing of the actual area options in the form developers expect to see them to custom insert menu item components (#5162)
  adds object of useful error when widget fails to render (#5141)
  add addMissingSchemaFields task (#5101)
  Pro 8360 box field (#5142)
  Pro 8671 fix localize modal (#5156)
  longPolling: false option (#5154)
  PRO-5472: file widget (#5126)
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.

2 participants