Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature batch localization #4852

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Feature batch localization #4852

wants to merge 10 commits into from

Conversation

myovchev
Copy link
Contributor

Summary

The batch localization feature.

What are the specific steps to test this change?

See PRO-6856 and PRO-6965

What kind of change does this PR introduce?

(Check at least one)

  • 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

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@myovchev myovchev marked this pull request as draft January 30, 2025 11:34
@myovchev myovchev requested a review from boutell February 3, 2025 12:30
@myovchev myovchev marked this pull request as ready for review February 3, 2025 12:30
try {
await manager.localize(req, item, locale, {
update: !payload.relationship ? true : update,
batch: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This flag is still not accounted anywhere. The idea is to be passed down to the localization event handlers.

if (e.data?.parentNotLocalized) {
payload.detail = 'apostrophe:parentNotLocalized';
} else {
payload.detail = e.data?.detail;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

error.data.detail is a proposed standard in the context of the localization process. If the localization or any underlying event handling throws apos error and provides detail data property, it will be used in the UI error reporting.

// human-readable message is a standard error payload property.
// For example `error.data.detail`.
if (e.data?.parentNotLocalized) {
payload.detail = 'apostrophe:parentNotLocalized';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may want to add detail: 'apostrophe:parentNotLocalized' where parentNotLocalized is calculated and assigned. This way we can remove the redundant checks here and in the i18n UI.

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