;
break;
- case 'Instrument':
+ case t('Instrument', {ns: 'loris', count: 1}):
result =
{this.state.data.fieldOptions.instruments[cell]}
;
break;
}
@@ -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
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 +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,
@@ -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 (
{
- 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.po b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po
new file mode 100644
index 00000000000..bf671acd6ec
--- /dev/null
+++ b/modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.po
@@ -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 , 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 "स्थिति"
+
+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 "विद्युतडाक मान्य नहीं है।"
diff --git a/modules/survey_accounts/locale/survey_accounts.pot b/modules/survey_accounts/locale/survey_accounts.pot
index 354363c7bcc..9bd3b188f9e 100644
--- a/modules/survey_accounts/locale/survey_accounts.pot
+++ b/modules/survey_accounts/locale/survey_accounts.pot
@@ -20,3 +20,84 @@ 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 ""
+
+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 "Email is not valid."
+msgstr ""
+
+msgid "Confirm Email address"
+msgstr ""
diff --git a/modules/survey_accounts/php/addsurvey.class.inc b/modules/survey_accounts/php/addsurvey.class.inc
index 37c53debde0..818e0734d77 100644
--- a/modules/survey_accounts/php/addsurvey.class.inc
+++ b/modules/survey_accounts/php/addsurvey.class.inc
@@ -65,21 +65,37 @@ class AddSurvey extends \NDB_Form
// Check that all required fields are present.
if (!empty($values['Email']) ) {
if (!filter_var($values['Email'], FILTER_VALIDATE_EMAIL) ) {
- return ['Email' => 'The email address is not valid.'];
+ return ['Email' => dgettext(
+ 'survey_accounts',
+ 'The email address is not valid.'
+ )
+ ];
}
}
if (!empty($values['Email']) && !empty($values['Email2'])) {
if ($values['Email'] != $values['Email2']) {
- return ['Email2' => 'The email addresses do not match.'];
+ return ['Email2' => dgettext(
+ 'survey_accounts',
+ 'The email addresses do not match.'
+ )
+ ];
}
}
if (!empty($values['Email']) && empty($values['Email2'])) {
- return ['Email2' => 'Please confirm the email address.'];
+ return ['Email2' => dgettext(
+ 'survey_accounts',
+ 'Please confirm the email address.'
+ )
+ ];
}
if (empty($values['Test_name'])) {
- return ['Test_name' => 'Please choose an instrument.'];
+ return ['Test_name' => dgettext(
+ 'survey_accounts',
+ 'Please choose an instrument.'
+ )
+ ];
}
$numCandidates = $db->pselectOne(
@@ -91,15 +107,21 @@ class AddSurvey extends \NDB_Form
'v_CandID' => $values['CandID'],
]
);
- $error = "PSCID and CandID do not match "
- ."or candidate does not exist.";
+ $error = dgettext(
+ 'survey_accounts',
+ 'PSCID and DCCID do not match or candidate does not exist.'
+ );
if ($numCandidates != 1) {
return
['CandID' => $error];
}
if (! in_array($values['VL'], \Utility::getVisitList(), true)) {
- return ['VL' => "You must specify a valid Visit Label."];
+ return ['VL' => dgettext(
+ 'survey_accounts',
+ 'You must specify a valid Visit Label.'
+ )
+ ];
}
$numSessions = $db->pselectOne(
@@ -116,9 +138,12 @@ class AddSurvey extends \NDB_Form
if ($numSessions != 1) {
return [
- 'VL' => "Visit ".
- $values['VL'].
- " does not exist for given candidate",
+ 'VL' => dgettext('loris', "Visit")." ".
+ $values['VL']." ".
+ dgettext(
+ 'survey_accounts',
+ 'does not exist for given candidate'
+ ),
];
}
@@ -136,7 +161,10 @@ class AddSurvey extends \NDB_Form
$user = \NDB_Factory::singleton()->user();
if (!$user->hasProject(\ProjectID::singleton($projectID))) {
return [
- 'Project' => "You are not affiliated with this session's project"
+ 'Project' => dgettext(
+ 'survey_accounts',
+ 'You are not affiliated with this session\'s project'
+ )
];
}
@@ -153,7 +181,10 @@ class AddSurvey extends \NDB_Form
'v_VL' => $values['VL'],
]
);
- $reminder = " already exists for given candidate for visit ";
+ $reminder = dgettext(
+ 'survey_accounts',
+ 'already exists for given candidate for visit'
+ );
foreach ($instrument_list as $instrument) {
if ($values['Test_name'] == $instrument['Test_name']) {
$instrument_instance = \NDB_BVL_Instrument::factory(
@@ -175,7 +206,11 @@ class AddSurvey extends \NDB_Form
FILTER_VALIDATE_EMAIL
)
) {
- return ['Email' => 'Email is not valid.'];
+ return ['Email' => dgettext(
+ 'survey_accounts',
+ 'Email is not valid.'
+ )
+ ];
}
}
@@ -302,7 +337,10 @@ class AddSurvey extends \NDB_Form
)
);
$this->addBasicText("Email", "Email address");
- $this->addBasicText("Email2", "Confirm Email address");
+ $this->addBasicText(
+ "Email2",
+ dgettext('survey_accounts', 'Confirm Email address')
+ );
$this->form->addFormRule([&$this, '_validateAddSurvey']);
}
diff --git a/modules/survey_accounts/php/survey_accounts.class.inc b/modules/survey_accounts/php/survey_accounts.class.inc
index 3b7f758a2c3..fa850fae910 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
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}
-
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")}
{foreach from=$form.errors item=error}
@@ -50,14 +54,14 @@
{$form.Email.label}
{$form.Email.html}
-
+
{$form.Email2.label}
{$form.Email2.html}
-
-
+
+
{/if}
@@ -67,15 +71,21 @@
-
-
Email to Study Participant
+
+
{dgettext("survey_accounts", "Email to Study Participant")}
-
+
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
);
}