Skip to content

Clearly mark missing translations in survey editor #6807

@jobenjada

Description

@jobenjada

Problem

When required translations are missing, they're sometimes in the "Advanced" section and not easy to find. They should be automatically and clearly marked.

Original Feedback:

Wenn solche "Pflicht-Übersetzungen" fehlen, sind die manchmal in der "Advanced"-Section, und nicht so einfach zu finden. Wäre schön wenn die automatisch und deutlich markiert werden würden

Current Implementation Analysis

Location: Multiple files in survey editor

Current Behavior:

  • Incomplete translations show red text: t("environments.project.languages.incomplete_translations") (line 166 in localized-editor.tsx, line 92 in multi-lang-wrapper.tsx)
  • Validation happens via isValueIncomplete() and checkIfValueIsIncomplete() functions
  • Missing translations are only shown when editing that specific field
  • No global indicator or summary of missing translations

Key Code Locations:

  • Translation validation: apps/web/modules/survey/components/question-form-input/utils.ts:89-123 (isValueIncomplete)
  • Translation editor: apps/web/modules/ee/multi-language-surveys/components/localized-editor.tsx:33-45 (checkIfValueIsIncomplete)
  • Multi-language wrapper: apps/web/modules/survey/components/question-form-input/components/multi-lang-wrapper.tsx:90-94
  • Survey validation: apps/web/modules/survey/editor/lib/validation.ts:241-287 (isSurveyValid)

Current Validation:

  • isValueIncomplete() checks if a field is invalid and not valid for all languages
  • Only shows warning inline when editing the field
  • checkForEmptyFallBackValue() is called during publish validation
  • No visual indicator in the question list or survey overview

Proposed Solution (Minimal Code Changes)

  1. Add translation status indicator to question cards:

    • Add a badge/icon next to questions with incomplete translations
    • Use existing isValueIncomplete() function to check each question field
    • Show indicator in question list view
  2. Add translation summary in survey editor:

    • Create a component that scans all questions and shows count of incomplete translations
    • Display in survey menu bar or as a banner
    • Link to first incomplete translation when clicked
  3. Highlight incomplete fields in Advanced section:

    • When Advanced section is expanded, visually mark fields with incomplete translations
    • Use border color or background highlight
    • Add tooltip explaining what's missing

Files to Modify:

  • apps/web/modules/survey/editor/components/questions-view.tsx (add indicators to question cards)
  • apps/web/modules/survey/editor/components/survey-menu-bar.tsx (add translation status summary)
  • apps/web/modules/survey/components/question-form-input/components/multi-lang-wrapper.tsx (enhance visual marking)
  • Create new utility: apps/web/modules/survey/editor/lib/translation-status.ts (scan all translations)

Estimated Effort: Low-Medium (1-2 days)

  • Mostly UI additions using existing validation functions
  • Need to scan all questions/fields which may have performance implications

Priority: Medium (UX improvement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions