Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ POFILES=locale/fr/LC_MESSAGES/loris.po \
modules/electrophysiology_uploader/locale/ja/LC_MESSAGES/electrophysiology_uploader.po \
modules/electrophysiology_uploader/locale/hi/LC_MESSAGES/electrophysiology_uploader.po \
modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.po \
modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po \
modules/survey_accounts/locale/ja/LC_MESSAGES/survey_accounts.po \
modules/battery_manager/locale/ja/LC_MESSAGES/battery_manager.po \
modules/battery_manager/locale/hi/LC_MESSAGES/battery_manager.po \
Expand Down Expand Up @@ -237,4 +238,7 @@ my_preferences: $(filter modules/my_preferences/%,$(MOFILES)) $(filter modules/m
target=my_preferences npm run compile

electrophysiology_browser: $(filter modules/electrophysiology_browser/%,$(MOFILES)) $(filter modules/electrophysiology_browser/%,$(I18NJSONFILES))
target=electrophysiology_browser npm run compile
target=electrophysiology_browser npm run compile

survey_accounts: $(filter modules/survey_accounts/%,$(MOFILES)) $(filter modules/survey_accounts/%,$(I18NJSONFILES))
target=survey_accounts npm run compile
24 changes: 15 additions & 9 deletions locale/hi/LC_MESSAGES/loris.po
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,21 @@ msgstr "जन्म तिथि"
msgid "Visits"
msgstr "भ्रमण"

msgid "Visit"
msgstr "भेंट"

msgid "Created"
msgstr "बनाया गया"

msgid "Sent"
msgstr "भेजा गया"

msgid "In Progress"
msgstr "प्रगति पर"

msgid "Complete"
msgstr "पूर्ण"

msgid "An error occured while loading the page."
msgstr "पृष्ठ लोड करते समय एक त्रुटि हुई।"

Expand Down Expand Up @@ -451,9 +466,6 @@ msgstr "कुल"
msgid "Screening"
msgstr "जांच"

msgid "Visit"
msgstr "भेंट"

msgid "Approval"
msgstr "स्वीकृति"

Expand All @@ -469,18 +481,12 @@ msgstr "विफलता"
msgid "Withdrawal"
msgstr "निकासी"

msgid "In Progress"
msgstr "प्रगति पर"

msgid "Progress"
msgstr "प्रगति"

msgid "Success"
msgstr "सफलता"

msgid "Complete"
msgstr "पूर्ण"

msgid "Instrument"
msgid_plural "Instruments"
msgstr[0] "उपकरण"
Expand Down
24 changes: 15 additions & 9 deletions locale/loris.pot
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,21 @@ msgstr ""
msgid "Visits"
msgstr ""

msgid "Visit"
msgstr ""

msgid "Created"
msgstr ""

msgid "Sent"
msgstr ""

msgid "In Progress"
msgstr ""

msgid "Complete"
msgstr ""

msgid "An error occured while loading the page."
msgstr ""

Expand Down Expand Up @@ -462,9 +477,6 @@ msgstr ""
msgid "Screening"
msgstr ""

msgid "Visit"
msgstr ""

msgid "Approval"
msgstr ""

Expand All @@ -483,18 +495,12 @@ msgstr ""
msgid "Withdrawn"
msgstr ""

msgid "In Progress"
msgstr ""

msgid "Progress"
msgstr ""

msgid "Success"
msgstr ""

msgid "Complete"
msgstr ""

msgid "Instrument"
msgid_plural "Instruments"
msgstr[0] ""
Expand Down
24 changes: 17 additions & 7 deletions modules/survey_accounts/ajax/ValidateEmailSubmitInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
'v_CandID' => $_REQUEST['dccid'],
]
);
$error_msg = "PSCID and DCC ID do not match or candidate does not exist.";
$error_msg = dgettext(
'survey_accounts',
'PSCID and DCCID do not match or candidate does not exist.'
);
if ($numCandidates != 1) {
echo json_encode(
['error_msg' => $error_msg]
Expand All @@ -65,16 +68,16 @@
if ($numSessions != 1) {
echo json_encode(
[
'error_msg' => "Visit ". $_REQUEST['VL'].
" does not exist for given candidate",
'error_msg' => dgettext('loris', 'Visit').' '. $_REQUEST['VL'].' '.
dgettext('survey_accounts', 'does not exist for given candidate'),
]
);
exit(0);
}

if (empty($_REQUEST['TN'])) {
echo json_encode(
['error_msg' => 'Please choose an instrument']
['error_msg' => dgettext('survey_accounts', 'Please choose an instrument')]
);
exit(0);
}
Expand All @@ -96,8 +99,11 @@
if ($_REQUEST['TN'] == $instrument['Test_name']) {
echo json_encode(
[
'error_msg' => "Instrument ". $_REQUEST['TN'].
" already exists for given candidate for visit ". $_REQUEST['VL'],
'error_msg' => dgettext('loris', 'Instrument').' '. $_REQUEST['TN']
.' ' .dgettext(
'survey_accounts',
'already exists for given candidate for visit'
).' '. $_REQUEST['VL'],
]
);
exit(0);
Expand All @@ -107,7 +113,11 @@
if (!empty($_REQUEST['Email']) ) {
if (!filter_var($_REQUEST['Email'], FILTER_VALIDATE_EMAIL) ) {
echo json_encode(
['error_msg' => 'The email address is not valid.']
['error_msg' => dgettext(
'survey_accounts',
'The email address is not valid.'
)
]
);
exit(0);
}
Expand Down
30 changes: 18 additions & 12 deletions modules/survey_accounts/jsx/surveyAccountsIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {withTranslation} from 'react-i18next';
import Loader from 'Loader';
import FilterableDataTable from 'FilterableDataTable';

import hiStrings from '../locale/hi/LC_MESSAGES/survey_accounts.json';
/**
* Survey Account React Component
*/
Expand Down Expand Up @@ -63,13 +64,14 @@ class SurveyAccountsIndex extends Component {
* @return {*} a formated table cell for a given column
*/
formatColumn(column, cell, row) {
const {t} = this.props;
let result = <td>{cell}</td>;
switch (column) {
case 'URL':
case t('URL', {ns: 'survey_accounts'}):
const url = loris.BaseURL + '/survey.php?key=' + row.URL;
result = <td><a href={url}>{cell}</a></td>;
break;
case 'Instrument':
case t('Instrument', {ns: 'loris', count: 1}):
result = <td>{this.state.data.fieldOptions.instruments[cell]}</td>;
break;
}
Expand All @@ -83,10 +85,13 @@ class SurveyAccountsIndex extends Component {
* @return {JSX} - React markup for the component
*/
render() {
const {t} = this.props;

// If error occurs, return a message.
// XXX: Replace this with a UI component for 500 errors.
if (this.state.error) {
return <h3>An error occured while loading the page.</h3>;
return <h3>{t('An error occured while loading the page.',
{ns: 'loris'})}</h3>;
}

// Waiting for async data to load
Expand All @@ -100,22 +105,22 @@ class SurveyAccountsIndex extends Component {
*/
const options = this.state.data.fieldOptions;
const fields = [
{label: 'PSCID', show: true, filter: {
{label: t('PSCID', {ns: 'loris'}), show: true, filter: {
name: 'pscid',
type: 'text',
}},
{label: 'Visit', show: true, filter: {
{label: t('Visit', {ns: 'loris'}), show: true, filter: {
name: 'visit',
type: 'select',
options: options.visits,
}},
{label: 'Instrument', show: true, filter: {
{label: t('Instrument', {ns: 'loris', count: 1}), show: true, filter: {
name: 'instrument',
type: 'select',
options: options.instruments,
}},
{label: 'URL', show: true},
{label: 'Status', show: true, filter: {
{label: t('URL', {ns: 'survey_accounts'}), show: true},
{label: t('Status', {ns: 'survey_accounts'}), show: true, filter: {
name: 'Status',
type: 'select',
options: options.statusOptions,
Expand All @@ -125,13 +130,13 @@ class SurveyAccountsIndex extends Component {
location.href='/survey_accounts/addSurvey/';
};
const actions = [
{label: 'Add Survey', action: addSurvey},
{label: t('Add Survey', {ns: 'survey_accounts'}), action: addSurvey},
];

return (
<FilterableDataTable
name="surveyAccounts"
title="Survey Accounts"
title={t('Survey Accounts', {ns: 'survey_accounts'})}
data={this.state.data.Data}
fields={fields}
getFormattedCell={this.formatColumn}
Expand All @@ -144,12 +149,13 @@ class SurveyAccountsIndex extends Component {
SurveyAccountsIndex.propTypes = {
dataURL: PropTypes.string.isRequired,
hasPermission: PropTypes.func.isRequired,
t: PropTypes.func,
};

window.addEventListener('load', () => {
i18n.addResourceBundle('ja', 'survey_accounts', {});
i18n.addResourceBundle('hi', 'survey_accounts', hiStrings);
const Index = withTranslation(
['survey_accounts', 'loris']
['survey_accounts']
)(SurveyAccountsIndex);
createRoot(
document.getElementById('lorisworkspace')
Expand Down
103 changes: 103 additions & 0 deletions modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Default LORIS strings to be translated (English).
# Copy this to a language specific file and add translations to the
# new file.
# Copyright (C) 2025
# This file is distributed under the same license as the LORIS package.
# Dave MacFarlane <dave.macfarlane@mcin.ca>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: LORIS 27\n"
"Report-Msgid-Bugs-To: https://github.com/aces/Loris/issues\n"
"POT-Creation-Date: 2025-04-08 14:37-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Survey Accounts"
msgstr "सर्वे खाते"

msgid "Survey was added successfully."
msgstr "सर्वे सफलतापूर्वक जोड़ा गया।"

msgid "Click here to go back to view the list of survey's created"
msgstr "बनाए गए सर्वे की सूची देखने के लिए यहाँ क्लिक करें"

msgid "Survey List"
msgstr "सर्वे सूची"

msgid "Usage"
msgstr "उपयोग"

msgid "Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris."
msgstr "इस फ़ॉर्म का उपयोग अध्ययन प्रतिभागी के लिए लिंक बनाने के लिए करें ताकि वह सीधे Loris में फ़ॉर्म/डेटा दर्ज कर सके।"

msgid "Add Survey"
msgstr "सर्वे जोड़ें"

msgid "Create survey"
msgstr "सर्वे बनाएँ"

msgid "Email survey"
msgstr "सर्वे ईमेल करें"

msgid "Close"
msgstr "बंद करें"

msgid "Email to Study Participant"
msgstr "अध्ययन प्रतिभागी को ईमेल"

msgid "Optionally enter a customized message here. A default email will be sent if left blank."
msgstr "वैकल्पिक रूप से यहाँ एक कस्टम संदेश दर्ज करें। खाली छोड़ने पर डिफ़ॉल्ट ईमेल भेजा जाएगा।"

msgid "This is where your message goes."
msgstr "यहाँ आपका संदेश जाएगा।"

msgid "Email"
msgstr "ईमेल"

msgid "Instrument"
msgstr "यंत्र"

msgid "URL"
msgstr "यूआरएल"

msgid "Status"
msgstr "स्थिति"

msgid "PSCID and DCCID do not match or candidate does not exist."
msgstr "पीएससीआईडी ​​और डीसीसीआईडी ​​मेल नहीं खाते या उम्मीदवार मौजूद नहीं है।"

msgid "does not exist for given candidate"
msgstr "दिए गए उम्मीदवार के लिए मौजूद नहीं है"

msgid "Please choose an instrument."
msgstr "कृपया एक उपकरण चुनें."

msgid "already exists for given candidate for visit"
msgstr "दिए गए उम्मीदवार के लिए यात्रा हेतु पहले से ही मौजूद है"

msgid "The email address is not valid."
msgstr "ईमेल पता मान्य नहीं है."

msgid "Please confirm the email address."
msgstr "कृपया ईमेल पता की पुष्टि करें."

msgid "The email addresses do not match."
msgstr "ईमेल पते मेल नहीं खाते."

msgid "You must specify a valid Visit Label."
msgstr "आपको एक वैध विज़िट लेबल निर्दिष्ट करना होगा."

msgid "You are not affiliated with this session's project"
msgstr "आप इस सत्र की परियोजना से संबद्ध नहीं हैं"

msgid "Confirm Email address"
msgstr "ईमेल पते की पुष्टि करें"

msgid "Email is not valid."
msgstr "विद्युतडाक मान्य नहीं है।"
Loading
Loading