Visitar URL original
[IIQ] Translation support for Question Image Alt-text by swatkat1 · Pull Request #14394 · civiform/civiform · GitHub
Skip to content

[IIQ] Translation support for Question Image Alt-text - #14394

Merged
swatkat1 merged 12 commits into
mainfrom
IIQ_tranlation
Nov 3, 2026
Merged

swatkat1 merged 12 commits into
mainfrom
IIQ_tranlation

Conversation

@swatkat1

@swatkat1 swatkat1 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

[IIQ]Adding Translation support for Question Image Alt-text.

TDD- https://docs.google.com/document/d/1uG-2TKiFAERGpVRMMcU9OXGyM3hVsOVbR-ta3_rFP1I/edit?tab=t.0

I have diverted a little bit away from the TDD as I found a better design during implementation. I have updated the TDD to contain this section
TDD update 10/30- Instead of creating a separate StaticQuestionTranslationForm, we are extending the existing QuestionTranslationForm to include imageDescription. In CiviForm’s data model, localizedImageDescription lives on the base QuestionDefinition and QuestionModel, rather than being exclusive to a static question subclass. Keeping the field on the base form avoids unnecessary class boilerplate code and the implementation can be easily extended to other question types in future if need be.

Release notes

Adding Translation support for Question Image Alt-text.

Checklist

Remove any sections below that do not apply to your PR. For sections that do apply, complete all of the appropriate checklist items and check them off. If a checklist item doesn't apply to your PR, leave it unchecked but do not delete it.

General

Read the full guidelines for PRs here

  • Added the correct label (see docs for more info): < feature | enhancement | bug | under-development | dependencies | infrastructure | ignore-for-release | database >
  • Assigned to a specific person, civiform/developers, or a more specific round-robin list
  • Added an additional reviewer from civiform/eng-admin as FYI (if this PR includes functionality changes and neither you nor the primary reviewer is an admin)
  • Added an additional reviewer as required if changes potentially affect the security of the application.
  • Removed the release notes section if the title is sufficient for the release notes description, or put more details in that section.
  • Created unit and/or browser tests which fail without the change (if possible)
  • Performed manual testing (Chrome and Firefox if it includes front-end changes)
  • Extended the README / documentation, if necessary. For user-facing features, consider updating the user docs. For "under-the-hood" changes or things more relevant to developers, consider updating the dev wiki.
  • Ensured PII wasn't added to any new logs, unless it was guarded by isDevOrStaging
  • Noted in the PR description which, if any, code in this PR was generated by AI.

Instructions for manual testing

  1. Login as a CiviForm admin and enable two flags ADMIN_UI_MIGRATION_J2HTML_TO_THYMELEAF_SC_ENABLED and IMAGES_IN_QUESTION_FEATURE_ENABLED
  2. Add a static questions and save.
  3. Edit the Static question and add an image + alt-text
  4. Go to the questions translation screen and see the alt-text ready for translation in the form. Add alt-text description and save in the language.
  5. You should see the translated alt-text as an applicant(screen reader only) in the same language.

Issue(s) this completes

Fixes #13863

@github-actions github-actions Bot added the i18n Related to internationalization label Oct 29, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bin/fmt would make these changes. Apply them with "Commit suggestion", or run bin/fmt locally.

@swatkat1 swatkat1 added the under-development Features that are hidden behind a feature flag and not yet ready for staging or production testing label Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.64706% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.60%. Comparing base (0d54d28) to head (1bb211e).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ers/admin/AdminQuestionTranslationsController.java 0.00% 8 Missing ⚠️
...admin/questions/QuestionTranslationPageMapper.java 75.00% 0 Missing and 2 partials ⚠️
server/app/services/question/QuestionService.java 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14394      +/-   ##
============================================
- Coverage     82.63%   82.60%   -0.03%     
- Complexity     5798     5833      +35     
============================================
  Files           620      620              
  Lines         26415    26528     +113     
  Branches       2127     2152      +25     
============================================
+ Hits          21827    21914      +87     
- Misses         3852     3864      +12     
- Partials        736      750      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chelseakr-exygy chelseakr-exygy left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Swathi, the TDD note and the tests make this easy to follow. Requesting changes for one thing, inline: saving translations can clear an existing translated alt text.

@swatkat1
swatkat1 merged commit 36afe45 into main Nov 3, 2026
25 checks passed
@swatkat1
swatkat1 deleted the IIQ_tranlation branch November 3, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Related to internationalization under-development Features that are hidden behind a feature flag and not yet ready for staging or production testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IIQ] Translation changes

2 participants