Skip to content

[translator] Configurable single/multi target-language selection #46

Description

@denis-urban

Summary

The bulk dashboard and per-document panel translate into one target language per run. Add a plugin option to allow selecting multiple target languages in a single run, configurable per install (default stays single for backward compatibility).

Current behavior

  • Both forms render the target as a single-value select (FormSelectLocale bound to FORM_FIELDS.TARGET_LNG).
  • Form schema: target_lng: z.string().nonempty().
  • The enqueue endpoint (EnqueueInputSchema) accepts a single target_lng; the handler builds one task per selected document.

Proposed change

Add a config option, e.g.:

translatorPlugin({
  // ...
  targetSelection: 'single' | 'multi', // default: 'single'
})
  • single → unchanged.
  • multi → the target field becomes a multi-select; enqueue accepts target_lng: string | string[] and fans out one task per (document × target language). The handler already loops over selected documents — add an inner loop over target languages.

Acceptance criteria

  • Default (single) behavior is unchanged.
  • multi lets an editor pick N target languages; a run queues all of them.
  • Progress/status (get-collection-status) reflects every queued target.
  • The enqueue endpoint accepts both string and string[] for target_lng (back-compat).

Notes

  • Source-language selection stays single.
  • Existing-translation / in-progress indicators per target language are a separate enhancement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions