Skip to content

Commit

Permalink
Merge pull request #164 from ananyajain10/add-language-support
Browse files Browse the repository at this point in the history
added hindi and english language to the instrustion and inputform
  • Loading branch information
suryabulusu authored Oct 4, 2024
2 parents 5b18ab2 + d2b5761 commit f115970
Show file tree
Hide file tree
Showing 20 changed files with 692 additions and 1,114 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VUE_APP_BACKEND=http://127.0.0.1:8000
VUE_APP_FORM_LAMBDA=
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
VUE_APP_FORM_LAMBDA: ${{ secrets.VUE_APP_FORM_LAMBDA }}
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
Expand Down Expand Up @@ -102,7 +101,6 @@ jobs:
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
VUE_APP_FORM_LAMBDA: ${{ secrets.VUE_APP_FORM_LAMBDA }}
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
Expand Down Expand Up @@ -155,7 +153,6 @@ jobs:
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
VUE_APP_FORM_LAMBDA: ${{ secrets.VUE_APP_FORM_LAMBDA }}
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy_to_s3_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- name: Build
env:
VUE_APP_BACKEND: ${{ secrets.VUE_APP_BACKEND }}
VUE_APP_FORM_LAMBDA: ${{ secrets.VUE_APP_FORM_LAMBDA }}
run: npm run build

- name: Configure AWS Credentials
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy_to_s3_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- name: Build
env:
VUE_APP_BACKEND: ${{ secrets.VUE_APP_BACKEND }}
VUE_APP_FORM_LAMBDA: ${{ secrets.VUE_APP_FORM_LAMBDA }}
run: npm run build-staging

- name: Configure AWS Credentials
Expand Down
3 changes: 0 additions & 3 deletions docs/ENV.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@

- `VUE_APP_BACKEND`
The URL of the backend.

- `VUE_APP_FORM_LAMBDA`
Lambda URL that handles form submission to MongoDB
64 changes: 56 additions & 8 deletions jest.init.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
* This file contains the initialization for test cases.
* It is being run from jest.config.js as a setupFile.
* It gets loaded before the tests are run.
*/

import { config } from "@vue/test-utils";
import VueClickAway from "vue3-click-away";
import { createI18n } from 'vue-i18n';
import { createStore } from 'vuex';

// Mock window.matchMedia
// Existing configuration
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: (query: string) => ({
Expand All @@ -28,12 +24,64 @@ Object.defineProperty(window, 'scrollTo', {
value: jest.fn(),
});

// inline-svg stub
const InlineSvg = {
template: "<img />",
};

config.global.stubs = {
InlineSvg,
};

config.global.plugins = [VueClickAway];

// i18n configuration
const messages = {
en: {
generalInstructions: {
header: "General Instructions",
timerInfo: "This test has a timer.",
paletteInfo: "The question palette shows the status of the questions.",
},
answeringQuestion: {
title: "Answering a Question",
procedureForMCQ: "Follow these steps for MCQ questions.",
},
},
hi: {
generalInstructions: {
header: "सामान्य निर्देश",
timerInfo: "इस परीक्षा में एक टाइमर है।",
paletteInfo: "प्रश्न पैलेट प्रश्नों की स्थिति दिखाता है।",
},
answeringQuestion: {
title: "प्रश्न का उत्तर देना",
procedureForMCQ: "एमसीक्यू के लिए इन चरणों का पालन करें।",
},
},
};

const i18n = createI18n({
legacy: false,
locale: 'en',
fallbackLocale: 'en',
messages,
});

config.global.plugins.push(i18n);

// Vuex configuration
const store = createStore({
state: {
locale: "en", // Mock locale state
},
getters: {
locale: (state) => state.locale, // Mock locale getter
},
mutations: {
setLocale(state, locale) {
state.locale = locale;
}
},
});

config.global.plugins.push(store);
Loading

0 comments on commit f115970

Please sign in to comment.