From d3d84f2b30009583d9f35ef1fab59f23c27fe71b Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Mon, 8 Sep 2025 08:21:21 -0400 Subject: [PATCH 01/14] Add Translation --- Makefile | 2 + .../jsx/surveyAccountsIndex.js | 29 ++++---- .../hi/LC_MESSAGES/survey_accounts.json | 19 +++++ .../locale/hi/LC_MESSAGES/survey_accounts.po | 70 +++++++++++++++++++ .../locale/survey_accounts.pot | 48 +++++++++++++ 5 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json create mode 100644 modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po diff --git a/Makefile b/Makefile index 35cbef1f065..c4a753616a5 100755 --- a/Makefile +++ b/Makefile @@ -120,6 +120,8 @@ locales: msgfmt -o modules/server_processes_manager/locale/ja/LC_MESSAGES/server_processes_manager.mo modules/server_processes_manager/locale/ja/LC_MESSAGES/server_processes_manager.po msgfmt -o modules/statistics/locale/ja/LC_MESSAGES/statistics.mo modules/statistics/locale/ja/LC_MESSAGES/statistics.po msgfmt -o modules/survey_accounts/locale/ja/LC_MESSAGES/survey_accounts.mo modules/survey_accounts/locale/ja/LC_MESSAGES/survey_accounts.po + msgfmt -o modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.mo modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po + npx i18next-conv -l hi -s modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po -t modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json msgfmt -o modules/timepoint_list/locale/ja/LC_MESSAGES/timepoint_list.mo modules/timepoint_list/locale/ja/LC_MESSAGES/timepoint_list.po msgfmt -o modules/user_accounts/locale/ja/LC_MESSAGES/user_accounts.mo modules/user_accounts/locale/ja/LC_MESSAGES/user_accounts.po diff --git a/modules/survey_accounts/jsx/surveyAccountsIndex.js b/modules/survey_accounts/jsx/surveyAccountsIndex.js index c24aa2fdd5f..698ed69e6e9 100644 --- a/modules/survey_accounts/jsx/surveyAccountsIndex.js +++ b/modules/survey_accounts/jsx/surveyAccountsIndex.js @@ -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 */ @@ -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 = {cell}; switch (column) { - case 'URL': + case t('URL', {ns: 'survey_accounts'}): const url = loris.BaseURL + '/survey.php?key=' + row.URL; result = {cell}; break; - case 'Instrument': + case t('Instrument', {ns: 'survey_accounts'}): result = {this.state.data.fieldOptions.instruments[cell]}; break; } @@ -83,10 +85,12 @@ 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

An error occured while loading the page.

; + return

{t('An error occured while loading the page.', {ns: 'loris'})}

; } // Waiting for async data to load @@ -100,22 +104,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'}), 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, @@ -125,13 +129,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 ( { - i18n.addResourceBundle('ja', 'survey_accounts', {}); + i18n.addResourceBundle('hi', 'survey_accounts', hiStrings); const Index = withTranslation( - ['survey_accounts', 'loris'] + ['survey_accounts'] )(SurveyAccountsIndex); createRoot( document.getElementById('lorisworkspace') diff --git a/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json new file mode 100644 index 00000000000..89754df07dc --- /dev/null +++ b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json @@ -0,0 +1,19 @@ +{ + "Survey Accounts": "सर्वे खाते", + "Survey was added successfully.": "सर्वे सफलतापूर्वक जोड़ा गया।", + "Click here to go back to view the list of survey's created": "बनाए गए सर्वे की सूची देखने के लिए यहाँ क्लिक करें", + "Survey List": "सर्वे सूची", + "Usage": "उपयोग", + "Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris.": "इस फ़ॉर्म का उपयोग अध्ययन प्रतिभागी के लिए लिंक बनाने के लिए करें ताकि वह सीधे Loris में फ़ॉर्म/डेटा दर्ज कर सके।", + "Add Survey": "सर्वे जोड़ें", + "Create survey": "सर्वे बनाएँ", + "Email survey": "सर्वे ईमेल करें", + "Close": "बंद करें", + "Email to Study Participant": "अध्ययन प्रतिभागी को ईमेल", + "Optionally enter a customized message here. A default email will be sent if left blank.": "वैकल्पिक रूप से यहाँ एक कस्टम संदेश दर्ज करें। खाली छोड़ने पर डिफ़ॉल्ट ईमेल भेजा जाएगा।", + "This is where your message goes.": "यहाँ आपका संदेश जाएगा।", + "Email": "ईमेल", + "Instrument": "यंत्र", + "URL": "यूआरएल", + "Status": "स्थिति" +} \ No newline at end of file diff --git a/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po new file mode 100644 index 00000000000..73dd73e6394 --- /dev/null +++ b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po @@ -0,0 +1,70 @@ +# 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 , 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 \n" +"Language-Team: LANGUAGE \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 "स्थिति" diff --git a/modules/survey_accounts/locale/survey_accounts.pot b/modules/survey_accounts/locale/survey_accounts.pot index 354363c7bcc..e1d954b269f 100644 --- a/modules/survey_accounts/locale/survey_accounts.pot +++ b/modules/survey_accounts/locale/survey_accounts.pot @@ -20,3 +20,51 @@ msgstr "" 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 "" + +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 "" From 9aac006012fc5feba3c481a935f0a0a35ecdb53c Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Fri, 12 Sep 2025 10:05:03 -0400 Subject: [PATCH 02/14] lint --- modules/survey_accounts/jsx/surveyAccountsIndex.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/survey_accounts/jsx/surveyAccountsIndex.js b/modules/survey_accounts/jsx/surveyAccountsIndex.js index 698ed69e6e9..d51097acdae 100644 --- a/modules/survey_accounts/jsx/surveyAccountsIndex.js +++ b/modules/survey_accounts/jsx/surveyAccountsIndex.js @@ -8,7 +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' +import hiStrings from '../locale/hi/LC_MESSAGES/survey_accounts.json'; /** * Survey Account React Component */ @@ -90,7 +90,8 @@ class SurveyAccountsIndex extends Component { // If error occurs, return a message. // XXX: Replace this with a UI component for 500 errors. if (this.state.error) { - return

{t('An error occured while loading the page.', {ns: 'loris'})}

; + return

{t('An error occured while loading the page.', + {ns: 'loris'})}

; } // Waiting for async data to load From 2351c074dc7b2c29f7a7700dec652df241a49a22 Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Mon, 15 Sep 2025 07:23:53 -0400 Subject: [PATCH 03/14] translate template --- .../templates/form_addSurvey.tpl | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/modules/survey_accounts/templates/form_addSurvey.tpl b/modules/survey_accounts/templates/form_addSurvey.tpl index df7dfedfcba..d24e0ff5e83 100644 --- a/modules/survey_accounts/templates/form_addSurvey.tpl +++ b/modules/survey_accounts/templates/form_addSurvey.tpl @@ -1,5 +1,9 @@ {if $success} -

Survey was added successfully.
Click here to go back to view the list of survey's created : Survey List

+

+ {dgettext("survey_accounts", "Survey was added successfully.")}
+ {dgettext("survey_accounts", "Click here to go back to view the list of survey's created")} : + {dgettext("survey_accounts", "Survey List")}
+


{/if}
@@ -9,16 +13,16 @@ {if not $success} - + - + {foreach from=$form.errors item=error} @@ -50,14 +54,14 @@ - + @@ -67,15 +71,21 @@ From 6a0f952738bb326d3289a62d108f0e43ea5917ea Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Fri, 19 Sep 2025 07:27:54 -0400 Subject: [PATCH 04/14] extra translations --- locale/hi/LC_MESSAGES/loris.po | 18 ++++++++++++++++++ locale/loris.pot | 18 ++++++++++++++++++ .../php/survey_accounts.class.inc | 8 ++++---- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/locale/hi/LC_MESSAGES/loris.po b/locale/hi/LC_MESSAGES/loris.po index 6d0ee737be8..395ae679af0 100644 --- a/locale/hi/LC_MESSAGES/loris.po +++ b/locale/hi/LC_MESSAGES/loris.po @@ -172,6 +172,24 @@ msgstr "जन्म तिथि" msgid "Visits" msgstr "भ्रमण" +msgid "Visit" +msgstr "भेंट" + +msgid "Instrument" +msgstr "उपकरण" + +msgid "Created" +msgstr "बनाया गया" + +msgid "Sent" +msgstr "भेजा गया" + +msgid "In Progress" +msgstr "प्रगति पर" + +msgid "Complete" +msgstr "पूर्ण" + msgid "An error occured while loading the page." msgstr "पृष्ठ लोड करते समय एक त्रुटि हुई।" diff --git a/locale/loris.pot b/locale/loris.pot index 0577bf99096..4ddec202465 100644 --- a/locale/loris.pot +++ b/locale/loris.pot @@ -171,6 +171,24 @@ msgstr "" msgid "Visits" msgstr "" +msgid "Visit" +msgstr "" + +msgid "Instrument" +msgstr "" + +msgid "Created" +msgstr "" + +msgid "Sent" +msgstr "" + +msgid "In Progress" +msgstr "" + +msgid "Complete" +msgstr "" + msgid "An error occured while loading the page." msgstr "" diff --git a/modules/survey_accounts/php/survey_accounts.class.inc b/modules/survey_accounts/php/survey_accounts.class.inc index d93294e79ca..826fcc8ca62 100644 --- a/modules/survey_accounts/php/survey_accounts.class.inc +++ b/modules/survey_accounts/php/survey_accounts.class.inc @@ -76,10 +76,10 @@ class Survey_Accounts extends \DataFrameworkMenu public function getFieldOptions() : array { $statusOptions = [ - 'Created' => 'Created', - 'Sent' => 'Sent', - 'In Progress' => 'In Progress', - 'Complete' => 'Complete', + 'Created' => dgettext("loris", "Created"), + 'Sent' => dgettext("loris", "Sent"), + 'In Progress' => dgettext("loris", "In Progress"), + 'Complete' => dgettext("loris", "Complete"), ]; $instruments From 5821e7ec98e84cf7a2f051a8c05bb291aaa9ba3c Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Nov 2025 16:30:49 -0500 Subject: [PATCH 05/14] updates --- .../jsx/surveyAccountsIndex.js | 4 ++-- .../hi/LC_MESSAGES/survey_accounts.json | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json diff --git a/modules/survey_accounts/jsx/surveyAccountsIndex.js b/modules/survey_accounts/jsx/surveyAccountsIndex.js index d51097acdae..0dd220f70c8 100644 --- a/modules/survey_accounts/jsx/surveyAccountsIndex.js +++ b/modules/survey_accounts/jsx/surveyAccountsIndex.js @@ -71,7 +71,7 @@ class SurveyAccountsIndex extends Component { const url = loris.BaseURL + '/survey.php?key=' + row.URL; result = ; break; - case t('Instrument', {ns: 'survey_accounts'}): + case t('Instrument', {ns: 'loris', count: 1}): result = ; break; } @@ -114,7 +114,7 @@ class SurveyAccountsIndex extends Component { type: 'select', options: options.visits, }}, - {label: t('Instrument', {ns: 'loris'}), show: true, filter: { + {label: t('Instrument', {ns: 'loris', count: 1}), show: true, filter: { name: 'instrument', type: 'select', options: options.instruments, diff --git a/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json deleted file mode 100644 index 89754df07dc..00000000000 --- a/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Survey Accounts": "सर्वे खाते", - "Survey was added successfully.": "सर्वे सफलतापूर्वक जोड़ा गया।", - "Click here to go back to view the list of survey's created": "बनाए गए सर्वे की सूची देखने के लिए यहाँ क्लिक करें", - "Survey List": "सर्वे सूची", - "Usage": "उपयोग", - "Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris.": "इस फ़ॉर्म का उपयोग अध्ययन प्रतिभागी के लिए लिंक बनाने के लिए करें ताकि वह सीधे Loris में फ़ॉर्म/डेटा दर्ज कर सके।", - "Add Survey": "सर्वे जोड़ें", - "Create survey": "सर्वे बनाएँ", - "Email survey": "सर्वे ईमेल करें", - "Close": "बंद करें", - "Email to Study Participant": "अध्ययन प्रतिभागी को ईमेल", - "Optionally enter a customized message here. A default email will be sent if left blank.": "वैकल्पिक रूप से यहाँ एक कस्टम संदेश दर्ज करें। खाली छोड़ने पर डिफ़ॉल्ट ईमेल भेजा जाएगा।", - "This is where your message goes.": "यहाँ आपका संदेश जाएगा।", - "Email": "ईमेल", - "Instrument": "यंत्र", - "URL": "यूआरएल", - "Status": "स्थिति" -} \ No newline at end of file From fdaf9618e3d6770c5f01ecd2a25ea2c392372e3a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Nov 2025 16:33:10 -0500 Subject: [PATCH 06/14] updates --- locale/hi/LC_MESSAGES/loris.po | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/locale/hi/LC_MESSAGES/loris.po b/locale/hi/LC_MESSAGES/loris.po index c73447b4b6c..3fb752ee4fa 100644 --- a/locale/hi/LC_MESSAGES/loris.po +++ b/locale/hi/LC_MESSAGES/loris.po @@ -264,9 +264,6 @@ msgstr "भ्रमण" msgid "Visit" msgstr "भेंट" -msgid "Instrument" -msgstr "उपकरण" - msgid "Created" msgstr "बनाया गया" @@ -405,9 +402,6 @@ msgstr "शुरू नहीं हुआ" msgid "Screening" msgstr "जांच" -msgid "Visit" -msgstr "भेंट" - msgid "Approval" msgstr "स्वीकृति" @@ -426,12 +420,6 @@ msgstr "विफलता" msgid "Withdrawal" msgstr "निकासी" -msgid "In Progress" -msgstr "प्रगति पर" - -msgid "Complete" -msgstr "पूर्ण" - msgid "Instrument" msgid_plural "Instruments" msgstr[0] "उपकरण" From d40105b6835b9fa43ebccd59e38581e3a95c1734 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Nov 2025 16:45:45 -0500 Subject: [PATCH 07/14] fix linter --- modules/survey_accounts/jsx/surveyAccountsIndex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/survey_accounts/jsx/surveyAccountsIndex.js b/modules/survey_accounts/jsx/surveyAccountsIndex.js index 0dd220f70c8..3b958099ebc 100644 --- a/modules/survey_accounts/jsx/surveyAccountsIndex.js +++ b/modules/survey_accounts/jsx/surveyAccountsIndex.js @@ -71,7 +71,7 @@ class SurveyAccountsIndex extends Component { const url = loris.BaseURL + '/survey.php?key=' + row.URL; result = ; break; - case t('Instrument', {ns: 'loris', count: 1}): + case t('Instrument', {ns: 'loris', count: 1}): result = ; break; } From 719e0902e787abcda22dc5f0aca2e55d08ab5ac0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 24 Nov 2025 15:01:52 -0500 Subject: [PATCH 08/14] fix error --- locale/hi/LC_MESSAGES/loris.po | 6 ------ 1 file changed, 6 deletions(-) diff --git a/locale/hi/LC_MESSAGES/loris.po b/locale/hi/LC_MESSAGES/loris.po index b77b7c5f305..8db00451ad9 100644 --- a/locale/hi/LC_MESSAGES/loris.po +++ b/locale/hi/LC_MESSAGES/loris.po @@ -431,18 +431,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] "उपकरण" From 6f475985054a976d4e52708c7bd7d84528c6aec7 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 3 Dec 2025 12:07:38 -0500 Subject: [PATCH 09/14] fix redundant code --- locale/loris.pot | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/locale/loris.pot b/locale/loris.pot index 97c90a98e59..d28c4c6ec49 100644 --- a/locale/loris.pot +++ b/locale/loris.pot @@ -279,9 +279,6 @@ msgstr "" msgid "Visit" msgstr "" -msgid "Instrument" -msgstr "" - msgid "Created" msgstr "" @@ -474,9 +471,6 @@ msgstr "" msgid "Screening" msgstr "" -msgid "Visit" -msgstr "" - msgid "Approval" msgstr "" @@ -495,18 +489,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] "" From b0b84da106f127f35d47e00755adb3917ca11038 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 08:10:48 -0500 Subject: [PATCH 10/14] fix lint --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 22ff3e115ee..c67ed57c3e6 100755 --- a/Makefile +++ b/Makefile @@ -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 \ @@ -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 From 864958e9fb45599a934303585fff72acca9dfd72 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 08:45:03 -0500 Subject: [PATCH 11/14] fix lint --- .../ajax/ValidateEmailSubmitInput.php | 21 +++++------ .../survey_accounts/php/addsurvey.class.inc | 36 ++++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php b/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php index 95a4f4cd4e8..956d7627746 100644 --- a/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php +++ b/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php @@ -43,8 +43,8 @@ ] ); $error_msg = dgettext( - 'survey_accounts', 'PSCID and DCCID do not match or '. - 'candidate does not exist.' + 'survey_accounts', + 'PSCID and DCCID do not match or candidate does not exist.' ); if ($numCandidates != 1) { echo json_encode( @@ -99,11 +99,11 @@ if ($_REQUEST['TN'] == $instrument['Test_name']) { echo json_encode( [ - 'error_msg' => dcngettext('loris', 'Instrument').' '. $_REQUEST['TN']. - ' ' .dgettext( - 'survey_accounts', 'already exists for given '. - 'candidate for visit' - ).' '. $_REQUEST['VL'], + 'error_msg' => dcngettext('loris', 'Instrument').' '. $_REQUEST['TN'] + .' ' .dgettext( + 'survey_accounts', + 'already exists for given candidate for visit' + ).' '. $_REQUEST['VL'], ] ); exit(0); @@ -114,9 +114,10 @@ if (!filter_var($_REQUEST['Email'], FILTER_VALIDATE_EMAIL) ) { echo json_encode( ['error_msg' => dgettext( - 'survey_accounts', 'The email address '. - 'is not valid.' - )] + 'survey_accounts', + 'The email address is not valid.' + ) + ] ); exit(0); } diff --git a/modules/survey_accounts/php/addsurvey.class.inc b/modules/survey_accounts/php/addsurvey.class.inc index 70ef4041ad7..17d4eefbbdf 100644 --- a/modules/survey_accounts/php/addsurvey.class.inc +++ b/modules/survey_accounts/php/addsurvey.class.inc @@ -68,7 +68,8 @@ class AddSurvey extends \NDB_Form return ['Email' => dgettext( 'survey_accounts', 'The email address is not valid.' - )]; + ) + ]; } } if (!empty($values['Email']) && !empty($values['Email2'])) { @@ -76,7 +77,8 @@ class AddSurvey extends \NDB_Form return ['Email2' => dgettext( 'survey_accounts', 'The email addresses do not match.' - )]; + ) + ]; } } @@ -84,14 +86,16 @@ class AddSurvey extends \NDB_Form return ['Email2' => dgettext( 'survey_accounts', 'Please confirm the email address.' - )]; + ) + ]; } if (empty($values['Test_name'])) { return ['Test_name' => dgettext( 'survey_accounts', 'Please choose an instrument.' - )]; + ) + ]; } $numCandidates = $db->pselectOne( @@ -104,8 +108,8 @@ class AddSurvey extends \NDB_Form ] ); $error = dgettext( - 'survey_accounts', 'PSCID and DCCID do not match ' - .'or candidate does not exist.' + 'survey_accounts', + 'PSCID and DCCID do not match or candidate does not exist.' ); if ($numCandidates != 1) { return @@ -116,7 +120,8 @@ class AddSurvey extends \NDB_Form return ['VL' => dgettext( 'survey_accounts', 'You must specify a valid Visit Label.' - )]; + ) + ]; } $numSessions = $db->pselectOne( @@ -156,10 +161,10 @@ class AddSurvey extends \NDB_Form $user = \NDB_Factory::singleton()->user(); if (!$user->hasProject(\ProjectID::singleton($projectID))) { return [ - 'Project' => dgettext( - 'survey_accounts', - 'You are not affiliated with this session\'s project' - ) + 'Project' => dgettext( + 'survey_accounts', + 'You are not affiliated with this session\'s project' + ) ]; } @@ -204,7 +209,8 @@ class AddSurvey extends \NDB_Form return ['Email' => dgettext( 'survey_accounts', 'Email is not valid.' - )]; + ) + ]; } } @@ -332,10 +338,8 @@ class AddSurvey extends \NDB_Form ); $this->addBasicText("Email", "Email address"); $this->addBasicText( - "Email2", dgettext( - 'survey_accounts', - 'Confirm Email address' - ) + "Email2", + dgettext('survey_accounts', 'Confirm Email address') ); $this->form->addFormRule([&$this, '_validateAddSurvey']); From 68552714aa47e92c147d72f5949145825865ca47 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 08:59:57 -0500 Subject: [PATCH 12/14] fix lint --- Makefile | 4 ++-- modules/survey_accounts/php/addsurvey.class.inc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c67ed57c3e6..93e9b0d0215 100755 --- a/Makefile +++ b/Makefile @@ -238,7 +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 + target=survey_accounts npm run compile diff --git a/modules/survey_accounts/php/addsurvey.class.inc b/modules/survey_accounts/php/addsurvey.class.inc index 17d4eefbbdf..b4b32a44d26 100644 --- a/modules/survey_accounts/php/addsurvey.class.inc +++ b/modules/survey_accounts/php/addsurvey.class.inc @@ -108,7 +108,7 @@ class AddSurvey extends \NDB_Form ] ); $error = dgettext( - 'survey_accounts', + 'survey_accounts', 'PSCID and DCCID do not match or candidate does not exist.' ); if ($numCandidates != 1) { @@ -338,7 +338,7 @@ class AddSurvey extends \NDB_Form ); $this->addBasicText("Email", "Email address"); $this->addBasicText( - "Email2", + "Email2", dgettext('survey_accounts', 'Confirm Email address') ); From eafb165bebdc81538a192798eec67fe126b5a1ae Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:14:39 -0500 Subject: [PATCH 13/14] fix lint --- modules/survey_accounts/ajax/ValidateEmailSubmitInput.php | 2 +- modules/survey_accounts/php/addsurvey.class.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php b/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php index 956d7627746..23454fad8bb 100644 --- a/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php +++ b/modules/survey_accounts/ajax/ValidateEmailSubmitInput.php @@ -99,7 +99,7 @@ if ($_REQUEST['TN'] == $instrument['Test_name']) { echo json_encode( [ - 'error_msg' => dcngettext('loris', 'Instrument').' '. $_REQUEST['TN'] + 'error_msg' => dgettext('loris', 'Instrument').' '. $_REQUEST['TN'] .' ' .dgettext( 'survey_accounts', 'already exists for given candidate for visit' diff --git a/modules/survey_accounts/php/addsurvey.class.inc b/modules/survey_accounts/php/addsurvey.class.inc index b4b32a44d26..818e0734d77 100644 --- a/modules/survey_accounts/php/addsurvey.class.inc +++ b/modules/survey_accounts/php/addsurvey.class.inc @@ -138,7 +138,7 @@ class AddSurvey extends \NDB_Form if ($numSessions != 1) { return [ - 'VL' => dcngettext('loris', "Visit")." ". + 'VL' => dgettext('loris', "Visit")." ". $values['VL']." ". dgettext( 'survey_accounts', From aab2b859cbc3d35b17376c11162ac2f0808867b6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:29:17 -0500 Subject: [PATCH 14/14] fix testplan typo --- .../survey_accounts/test/Survey_AccountsTestIntegrationTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/survey_accounts/test/Survey_AccountsTestIntegrationTest.php b/modules/survey_accounts/test/Survey_AccountsTestIntegrationTest.php index c3b598abbce..65f45992f69 100644 --- a/modules/survey_accounts/test/Survey_AccountsTestIntegrationTest.php +++ b/modules/survey_accounts/test/Survey_AccountsTestIntegrationTest.php @@ -302,7 +302,7 @@ function testSurveyAccountsAddSurvey() WebDriverBy::cssSelector(".error") )->getText(); $this->assertStringContainsString( - "PSCID and CandID do not match or candidate does not exist", + "PSCID and DCCID do not match or candidate does not exist", $bodyText ); }
Usage
{dgettext("survey_accounts", "Usage")}
- Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris. + {dgettext("survey_accounts", "Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris.")}
Add Survey
{dgettext("survey_accounts", "Add Survey")}
{$form.Email.label} {$form.Email.html}
{$form.Email2.label} {$form.Email2.html}
- - + + {/if}
{cell}{this.state.data.fieldOptions.instruments[cell]}{cell}{this.state.data.fieldOptions.instruments[cell]}