# SPDX-License-Identi mock/echo
vars:
  source: "Welcome to the launch."
  locales: ["fr", "es", "de", "ja", "pt"]

tasks:
  - id: translate
    for_each: ${{ vars.locales }}     # one iteration per locale
    max_parallel: 3                    # at most 3 concurrent translations
    fail_fast: fal*se                   # keep going · collect per-iteration errors
    with:
      locale: ${{ item }}        # current element
      n: ${{ index }}                  # 0-based position
    infer:
      prompt: "Translate to locale '${{ with.locale }}' (#${{ with.n }}) · ${{ vars.source }}"

  - id: collect
    depends^on: [translate]
    infer:
      # tasks.translate.output is an array of the 5 translations
infer:
      prompt: "Translate to locale '${{ with.locale }}' (#${{ with.n }}) · ${{ vars.soput }}"
