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

wip/Dashboard Internationalization #379

Merged
merged 29 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4bac643
initial commit
ksmontville Feb 15, 2024
30617f7
initial commit [skip ci]
ksmontville Feb 20, 2024
6608575
Merge branch 'main' into internationalization
ksmontville Feb 20, 2024
0d348da
local merge to main
ksmontville Feb 20, 2024
4a2526e
modify workflow
ksmontville Feb 20, 2024
f5faaae
Undo change to timeout.
ksmontville Feb 21, 2024
b2e6eb0
Add translations to Click to start and Preparing your game
ksmontville Feb 21, 2024
30fb55d
Format
ksmontville Feb 21, 2024
a36c553
Update roar apps, update Spanish translations.
ksmontville Feb 21, 2024
0825ec1
Update roar apps, update Spanish translations.
ksmontville Feb 21, 2024
ce95cfa
Merge branch 'main' into internationalization
ksmontville Feb 21, 2024
afd65b6
update package-lock
ksmontville Feb 21, 2024
5fbd996
Add error handling to translations.
ksmontville Feb 21, 2024
3039bca
Format
ksmontville Feb 21, 2024
6de08b0
Reorganize translations and page title files.
ksmontville Feb 21, 2024
d36552f
Remove unnecessary files.
ksmontville Feb 21, 2024
03a8a64
Change string interpolation in console log
ksmontville Feb 22, 2024
498c2a8
Implement language selector.
ksmontville Feb 23, 2024
8eb5422
Create LanguageSelector component; update Cypress tests.
ksmontville Feb 23, 2024
4752333
Update cypress tests
ksmontville Feb 23, 2024
d78ad91
format
ksmontville Feb 23, 2024
56f27d9
Fix cypress tests.
ksmontville Feb 23, 2024
e387f26
Resolve merge conflicts
ksmontville Feb 27, 2024
390161b
Format
ksmontville Feb 27, 2024
3d9a048
upday playSWR test.
ksmontville Feb 27, 2024
76a169a
Merge branch 'main' into internationalization
ksmontville Feb 28, 2024
fa1a67b
Change imports to relative
ksmontville Feb 28, 2024
fc18259
Update package lock
ksmontville Feb 28, 2024
dc92b40
Format and set Sentry only to run in production mode
ksmontville Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"axios": "^1.5.1",
"buffer": "^6.0.3",
"chart.js": "^4.3.3",
"dotenv": "^16.3.1",
"core-tasks": "^1.0.0-alpha.1",
"dotenv": "^16.3.1",
"emailjs-com": "^3.2.0",
"firebase": "^9.14.0",
"jose": "^4.14.4",
Expand All @@ -60,6 +60,7 @@
"vite-plugin-node-polyfills": "^0.9.0",
"vue": "^3.2.25",
"vue-google-maps-community-fork": "^0.3.1",
"vue-i18n": "^9.9.1",
"vue-router": "^4.1.6",
"vue3-text-clamp": "^0.1.2",
"zipson": "^0.2.12"
Expand Down
2 changes: 1 addition & 1 deletion roar-firebase-functions
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<AppHead>
<title>ROAR: {{ $route.meta.pageTitle }}</title>
<title>ROAR: {{ $route.meta.pageTitle[language] }}</title>
<meta name="description" content="A web-based tool to query ROAR assessment data!" />

<!-- Social -->
Expand All @@ -27,6 +27,8 @@ import { useAuthStore } from '@/store/auth';
import { ref } from 'vue';
import { fetchDocById } from '@/helpers/query/utils';

const language = window.navigator.language;

const navbarBlacklist = ref([
'SignIn',
'PlayApp',
Expand Down
4 changes: 2 additions & 2 deletions src/components/GameTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
/>
</svg>
</i>
<span v-if="!allGamesComplete && !game.completedOn">Click to start</span>
<span v-else>Task Completed!</span>
<span v-if="!allGamesComplete && !game.completedOn">{{ $t('gameTabs.clickToStart') }}</span>
<span v-else>{{ $t('gameTabs.taskCompleted') }}</span>
</div>
</div>
<div class="roar-game-image">
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PvMenu>
</div>
<router-link :to="{ name: 'SignOut' }" class="signout-button">
<PvButton data-cy="button-sign-out" class="no-underline">Sign Out</PvButton>
<PvButton data-cy="button-sign-out" class="no-underline">{{ $t('navBar.signOut') }}</PvButton>
</router-link>
</div>
</nav>
Expand Down
8 changes: 5 additions & 3 deletions src/components/ParticipantSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<PvChart type="doughnut" :data="chartData" :options="chartOptions" />
<div>
<p class="sidebar-progress-totals">{{ completedGames }}/{{ totalGames }}</p>
<p>tasks completed!</p>
<p>{{ $t('participantSidebar.tasksCompleted') }}</p>
</div>
</div>
<ul class="sidebar-info">
<li class="sidebar-title"><strong>Student Info</strong></li>
<li class="sidebar-title">
<strong>{{ $t('participantSidebar.studentInfo') }}</strong>
</li>
<li>
Grade: <span class="sidebar-info-item">{{ studentInfo.grade }}</span>
{{ $t('participantSidebar.grade') }}: <span class="sidebar-info-item">{{ studentInfo.grade }}</span>
</li>
</ul>
</div>
Expand Down
34 changes: 19 additions & 15 deletions src/components/auth/SignIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,62 @@
<div class="field mt-2">
<div class="p-input-icon-right">
<PvInputText
id="email"
:id="$t('authSignIn.emailId')"
v-model="v$.email.$model"
:class="{ 'p-invalid': invalid }"
aria-describedby="email-error"
placeholder="Username or email"
:placeholder="$t('authSignIn.emailPlaceholder')"
data-cy="input-username-email"
/>
</div>
<small v-if="invalid" class="p-error">Incorrect username/email or password</small>
<small v-if="invalid" class="p-error">{{ $t('authSignIn.incorrectEmailOrPassword') }}</small>
</div>
<div class="field mt-4 mb-5">
<div>
<span v-if="evaluatingEmail">
<PvSkeleton height="2.75rem" />
</span>
<div v-else-if="allowPassword && allowLink">Both allowed</div>
<div v-else-if="allowPassword && allowLink">{{ $t('authSignIn.bothAllowed') }}</div>
<PvPassword
v-else-if="allowPassword"
id="password"
:id="$t('authSignIn.passwordId')"
v-model="v$.password.$model"
:class="{ 'p-invalid': invalid }"
toggle-mask
show-icon="pi pi-eye-slash"
hide-icon="pi pi-eye"
:feedback="false"
placeholder="Password"
:placeholder="$t('authSignIn.passwordPlaceholder')"
data-cy="input-password"
>
<template #header>
<h6>Pick a password</h6>
<h6>{{ $t('authSignIn.pickPassword') }}</h6>
</template>
<template #footer="sp">
{{ sp.level }}
<PvDivider />
<p class="mt-2">Suggestions</p>
<p class="mt-2">{{ $t('authSignIn.suggestions') }}</p>
<ul class="pl-2 ml-2 mt-0" style="line-height: 1.5">
<li>At least one lowercase</li>
<li>At least one uppercase</li>
<li>At least one numeric</li>
<li>Minimum 8 characters</li>
<li>{{ $t('authSignIn.atLeastOneLowercase') }}</li>
<li>{{ $t('authSignIn.atLeastOneUppercase') }}</li>
<li>{{ $t('authSignIn.atLeastOneNumeric') }}</li>
<li>{{ $t('authSignIn.minimumCharacters') }}</li>
</ul>
</template>
</PvPassword>
<div v-else-if="allowLink">
<PvPassword disabled placeholder="Press Go to sign-in with an email link." />
<PvPassword disabled :placeholder="$t('signInWithEmailLinkPlaceholder')" />
</div>
<div v-else>
<PvPassword disabled class="p-invalid text-red-600" placeholder="Error: invalid email" />
<PvPassword
disabled
class="p-invalid text-red-600"
:placeholder="$t('authSignIn.invalidEmailPlaceholder')"
/>
</div>
</div>
</div>
<PvButton type="submit" label="Go! &rarr;" class="submit-button" />
<PvButton type="submit" :label="$t('authSignIn.buttonLabel') + ' &rarr;'" class="submit-button" />
</form>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskFluency.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskLetter.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskLevante.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskMultichoice.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskPA.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskSRE.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskSWR-ES.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskSWR.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/TaskVocab.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="jspsych-target" class="game-target" translate="no" />
<div v-if="!gameStarted" class="col-full text-center">
<h1>Preparing your game!</h1>
<h1>{{ $t('tasks.preparing') }}</h1>
<AppSpinner />
</div>
</template>
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ import 'primeflex/primeflex.scss'; // primeflex
import './assets/styles/theme-tailwind.css'; // base theme (pulled from Primevue)
import './assets/styles/theme.scss'; // ROAR theme

// translations
import { i18n } from './translations/i18n';

// Begin the app!
const app = createApp(App);
const pinia = createPinia();
Expand All @@ -97,6 +100,7 @@ app.use(VueGoogleMaps, {
app.use(createHead());
app.use(TextClamp);
app.use(VueQueryPlugin);
app.use(i18n);

app.component('PvAccordion', PvAccordion);
app.component('PvAccordionTab', PvAccordionTab);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CleverLanding.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="loading-container">
<AppSpinner style="margin-bottom: 1rem" />
<span>Loading your data from Clever...</span>
<span>{{ $t('cleverLanding.cleverLoading') }}</span>
</div>
</template>
<script setup>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/HomeParticipant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<div v-if="!noGamesAvailable || consentSpinner">
<div v-if="isFetching || consentSpinner" class="loading-container">
<AppSpinner style="margin-bottom: 1rem" />
<span>Loading Assignments</span>
<span>{{ $t('homeParticipant.loadingAssignments') }}</span>
</div>
<div v-else>
<h2 v-if="adminInfo?.length == 1" class="p-float-label dropdown-container">
{{ adminInfo.at(0).name }}
</h2>
<div v-if="adminInfo?.length > 1" class="p-float-label dropdown-container">
<PvDropdown v-model="selectedAdmin" :options="adminInfo ?? []" option-label="name" input-id="dd-assignment" />
<label for="dd-assignment">Select an assignment</label>
<label for="dd-assignment">{{ $t('homeParticipant.selectAssignment') }}</label>
</div>
<div class="tabs-container">
<ParticipantSidebar :total-games="totalGames" :completed-games="completeGames" :student-info="studentInfo" />
Expand All @@ -21,10 +21,10 @@
</div>
<div v-else>
<div class="col-full text-center">
<h1>You have no assignments!</h1>
<p class="text-center">Please contact your administrator to get added to an assignment.</p>
<h1>{{ $t('homeParticipant.noAssignments') }}</h1>
<p class="text-center">{{ $t('homeParticipant.contactAdministrator') }}</p>
<router-link :to="{ name: 'SignOut' }">
<PvButton label="Sign out" class="no-underline" icon="pi pi-sign-out" />
<PvButton :label="$t('navBar.signOut')" class="no-underline" icon="pi pi-sign-out" />
</router-link>
</div>
</div>
Expand Down
Loading
Loading