Skip to content

fix(platform): show connector setting options in the reader's language - #5126

Closed
tale-code-bot wants to merge 1 commit into
mainfrom
fix/connector-config-option-labels
Closed

tale-code-bot wants to merge 1 commit into
mainfrom
fix/connector-config-option-labels

Conversation

@tale-code-bot

Copy link
Copy Markdown
Collaborator

Summary

A connector's credential form now shows a select's options in the reader's language. Before, the mailbox's Connection security offered the raw values tls and starttls in every language: a config field could not declare labels for its options.

Context: #4746 (e6227a0cc) already translated each setting's label and help, and the de and fr HTTP guides. This PR closes what the issue still names:

  • expected item 4, translated enum options;
  • the manifest regression test.

Task: TALE-143 (Development board).

Closes #4743

What changed

  • Schema (packages/shared/src/schemas/connectors.ts):

    • a config field may declare optionLabels, the English label of each enum value;
    • i18n.<locale>.optionLabels overrides them per locale;
    • the connector's refinement refuses a label for a value the field does not take, and option labels on a field without enum.

    enum stays the set of values that are stored and validated, so nothing that reads it changes.

  • Manifest (configs/platform/system/connectors/imap-smtp/connector.yml):

    • security offers Implicit TLS / STARTTLS: de Implizites TLS / STARTTLS, fr TLS implicite / STARTTLS. No German text has ß, so there is no de-CH override.
    • The hidden fromAddress gains de and fr label and help, worded like Outlook's, so every declared setting text is translated.
  • Catalog and contract (connector_catalog.ts, contract/connector-credentials.ts): pass optionLabels through, and type i18n.<locale>.optionLabels.

  • Form (config-fields.tsx): each option resolves on its own through useLocalized: exact tag, then base language, then English, then the stored value. A sparse de-CH override of one option therefore keeps German for the others.

  • Guard (lib/connectors/action-titles.test.ts, the shipped display-data guard): every shipped setting must carry de and fr for:

    • its label;
    • its help, when English has help;
    • each option's label.

    It also requires de-CH where German has ß and names any unknown locale. A "bites" case shows each problem line.

  • Docs: the configFields row of docs/{en,de,fr}/develop/connectors.md documents optionLabels.

  • Manual suite (suites/connectors.md):

    • CONN-F7 names the option labels;
    • new CONN-F7a checks the mailbox and HTTP forms in Deutsch, Français and Deutsch (Schweiz).

Checklist

  • bun run check: not run in full (the whole monorepo). I ran every part this change touches; see the test plan. CI runs the rest.
  • bun run lint:sast: not run locally. The pinned opengrep binary is not cached in my worker, and I don't download tools from outside the lockfiles; the pre-commit scan skipped for the same reason. The PR's SAST check runs it.
  • Translations: N/A for the messages/ catalogs, because no key changed. The new user-visible texts live in the connector manifest and ship in en, de and fr. No German text has ß, so there is no de-CH override.
  • Docs updated in docs/{en,de,fr}/develop/connectors.md.
  • README: N/A. No README names connector settings.

Test plan

Everything below ran at 00de44a7b5734aadf1fe08584616af63e9c22aea on Node v24.21.0 and Bun 1.4.2, with credentials removed from the environment.

Each new test fails without its fix (checked by stashing the fix):

Test Result Without the fix
packages/shared: bunx vitest run src/schemas/connectors.test.ts 34 passed the new option-label case fails
Platform server project: lib/connectors/action-titles.test.ts, backend/core/connector_credentials/catalog_docs.test.ts, lib/shared/schemas/shipped-connectors.test.ts 141 passed see the two rows below
↳ the guard, on main's imap-smtp manifest fails with 10 problem lines: the six option labels of security, and the de and fr label and help of fromAddress
↳ the catalog test, without the catalog pass-through fails
Platform UI project: app/features/settings/connectors/config-fields.test.tsx 24 passed the 5 new tests fail

The 5 new UI tests cover the options in en, de, fr and de-CH, plus "a German reader sees none of the English it translates".

Wider suites:

  • Server project over lib/connectors, backend/core/connector_credentials, backend/domains/connector_credentials, lib/shared/schemas and lib/engine: 2822 passed, 1 failed.
    • The failure is lib/engine/core/validate/golden-errors.test.ts. It fails the same way on a clean main (0da082051) in this worker: Node v24.21.0 accepts the regex /(?i:yes)/, which the golden expects to be a syntax error. It is unrelated to this change.
  • UI project over app/features/settings/connectors, app/features/settings/credentials and settings-field-control: 14 files, 135 passed.

Gates:

  • Typecheck: tsc --noEmit passes for @tale/shared and for @tale/platform. The platform needs CI's NODE_OPTIONS=--max-old-space-size=6144.
  • Lint: bun run lint (type-aware oxlint) passes in @tale/shared and @tale/platform.
  • Format: oxfmt --check passes on the changed files.
  • Docs: the full services/docs vitest passes (38 files, 716 tests), and bun run lint:links passes.
  • Manual: bun run lint:manual passes, and tests/manual/scripts/check-guide.ts reports OK for suites/connectors.md.
  • Commit message: commitlint passes.

Not run:

  • the full bun run check;
  • bun run lint:sast (see the checklist);
  • the @tale/cli typecheck. The CLI parses manifests with the same schema but reads no config-field types, and the shipped manifests parse under the new schema in shipped-connectors.test.ts.
  • the running app in a browser. This worker has no stack; CONN-F7 and CONN-F7a describe that check.

Follow-up (not in this PR)

The server's refusals in normalizeConfig still quote a setting's English label and its raw enum values. For example, the "must be one of" message lists tls, starttls.

The credential form rendered a connector setting's select options as
their stored values: the mailbox's Connection security offered `tls`
and `starttls` in English, German and French alike, because a config
field could declare no option labels. #4746 had already translated each
setting's label and help.

A config field now names its options: `optionLabels` gives the English
label of each `enum` value, and `i18n.<locale>.optionLabels` overrides
it. The connector schema refuses a label for a value the field does not
take. The settings catalog and the app contract pass the labels through.
The form resolves each option on its own through the locale chain:
exact tag, base language, English, then the stored value. The mailbox
offers Implicit TLS / STARTTLS (Implizites TLS, TLS implicite), and its
hidden From address carries its German and French like Outlook's.

The shipped display-data guard now also holds every setting's label,
help and option labels to German and French, with de-CH where German
writes ß, so a setting can no longer land in English only. The develop
guide documents `optionLabels` in EN/DE/FR, and the connectors manual
suite names the labels (CONN-F7) and checks the forms in three
languages (CONN-F7a).
@yannickmonney

Copy link
Copy Markdown
Contributor

The autonomous cycle now lands each task through the merge train instead of its own pull request (.agents/repo.md on train), so this pull request closes. The branch fix/connector-config-option-labels stays and the task goes on with it: the Reviewer reviews the branch's head on the task and squashes accepted work onto train.

tale-review-bot pushed a commit that referenced this pull request Oct 30, 2026
Reviewed in pull request #5126 and on the task at 00de44a.

Closes #4743
Task: TALE-143
tale-code-bot added a commit that referenced this pull request Oct 30, 2026
Reviewed in pull request #5126 and on the task at 00de44a.

Closes #4743
Task: TALE-143
@yannickmonney
yannickmonney deleted the fix/connector-config-option-labels branch October 30, 2026 10:32
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.

i18n(platform): connector credential forms show English field labels, help and options in de/fr (HTTP, IMAP/SMTP)

2 participants