Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Support for Statements and Answers #170

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

dankim444
Copy link
Collaborator

Description

This PR introduces multilingual support for both statements and answers in the UI and backend. On the frontend, we can now render survey statements and answers in the appropriate UI language. On the server side, the backend has been updated to track the UI language in submitted answers and retrieve the correct language-specific columns for both statements and answers. When merged, this PR will close #146.

Changes

  1. Translation files updated:
    • updates translation.json files for cypress tests and the UI
  2. Language-based rendering on frontend
    • Components updated for multilingual support: Enter.tsx, Feedback.tsx, MutiStepForm.tsx, Question.tsx, Result.tsx, SocialSurvey.tsx, Statement.tsx, StatementForm.tsx, Layout.tsx, Dashboard.tsx, DashboardChart.tsx, NotificationBox.tsx, TwitterText.tsx
    • Layout.tsx, Dashboard.tsx: passes language as a parameter to API call, retrieves statements based on language, re-renders whenever language changes.
  3. Updated language selection of statements and answer in backend:
    • /getanswers endpoint: selects the correct statement column based on the UI language
    • / post answers endpoint: tracks the UI language in answers submitted by the user
    • treatment function: queries the appropriate statements based on the UI language

Notes

  • I noticed some statements in the statements table haven't been normalized yet. However, if we are starting with a clean slate for the next experiment, this shouldn't be a problem.

@dankim444 dankim444 requested a review from amirrr August 23, 2024 04:32
@dankim444 dankim444 self-assigned this Aug 23, 2024
Copy link

cypress bot commented Aug 23, 2024

Commonsense    Run #98

Run Properties:  status check failed Failed #98  •  git commit 31d65b2781: update locales for cypress tests
Project Commonsense
Branch Review issue-146
Run status status check failed Failed #98
Run duration 01m 15s
Commit git commit 31d65b2781: update locales for cypress tests
Committer dankim444
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 10
View all changes introduced in this branch ↗︎

Tests for review

Failed  cypress/e2e/1-functionality/formfill.cy.js • 1 failed test

View Output

Test Artifacts
fill out the survay > Select radio and click 'Next' in a loop Test Replay Screenshots

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.

Language support for statements
1 participant