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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 18 additions & 0 deletions locale/hi/LC_MESSAGES/loris.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "पृष्ठ लोड करते समय एक त्रुटि हुई।"

Expand Down
18 changes: 18 additions & 0 deletions locale/loris.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

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: 'survey_accounts'}):
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'}), 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
19 changes: 19 additions & 0 deletions modules/survey_accounts/locale/hi/LC_MESSAGES/survey_accounts.json
Original file line number Diff line number Diff line change
@@ -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": "स्थिति"
}
70 changes: 70 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,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 <[email protected]>, 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 <[email protected]>\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 "स्थिति"
48 changes: 48 additions & 0 deletions modules/survey_accounts/locale/survey_accounts.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
8 changes: 4 additions & 4 deletions modules/survey_accounts/php/survey_accounts.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 22 additions & 12 deletions modules/survey_accounts/templates/form_addSurvey.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{if $success}
<p>Survey was added successfully.<br/> Click here to go back to view the list of survey's created : <a href="{$baseurl}/survey_accounts/">Survey List</a><br /></p>
<p>
{dgettext("survey_accounts", "Survey was added successfully.")}<br/>
{dgettext("survey_accounts", "Click here to go back to view the list of survey's created")} :
<a href="{$baseurl}/survey_accounts/">{dgettext("survey_accounts", "Survey List")}</a><br />
</p>
<br />
{/if}
<br />
Expand All @@ -9,16 +13,16 @@
{if not $success}
<table class="table table-primary table-bordered" border="0">
<!-- table title -->
<tr class="info"><th colspan="2">Usage</th></tr>
<tr class="info"><th colspan="2">{dgettext("survey_accounts", "Usage")}</th></tr>

<tr>
<td colspan="2">
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.")}
</td>
</tr>

<!-- table title -->
<tr class="info"><th colspan="2">Add Survey</th></tr>
<tr class="info"><th colspan="2">{dgettext("survey_accounts", "Add Survey")}</th></tr>

{foreach from=$form.errors item=error}
<tr>
Expand Down Expand Up @@ -50,14 +54,14 @@
<td nowrap="nowrap">{$form.Email.label}</td>
<td nowrap="nowrap" id="Email">{$form.Email.html}</td>
</tr>
<tr>
<tr>
<td nowrap="nowrap">{$form.Email2.label}</td>
<td nowrap="nowrap" id="Email2">{$form.Email2.html}</td>
</tr>
<tr>
<td nowrap="nowrap" colspan="2">
<input class="btn btn-sm btn-primary" name="fire_away" value="Create survey" id="create_survey" type="submit" />
<input class="btn btn-sm btn-primary email" name="fire_away" value="Email survey" id="email_survey" type="submit" />
<input class="btn btn-sm btn-primary" name="fire_away" value="{dgettext("survey_accounts", "Create survey")}" id="create_survey" type="submit" />
<input class="btn btn-sm btn-primary email" name="fire_away" value="{dgettext("survey_accounts", "Email survey")}" id="email_survey" type="submit" />
{/if}
</td>
</tr>
Expand All @@ -67,15 +71,21 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h3 class="modal-title">Email to Study Participant</h3>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">{dgettext("survey_accounts", "Close")}</span>
</button>
<h3 class="modal-title">{dgettext("survey_accounts", "Email to Study Participant")}</h3>
</div>
<div class="modal-body">
<textarea class="form-control" id="emailContent" name="email_dialog" rows="24" cols="80" placeholder="Optionally enter a customized message here. A default email will be sent if left blank.">This is where your message goes.</textarea>
<textarea class="form-control" id="emailContent" name="email_dialog" rows="24" cols="80"
placeholder="{dgettext("survey_accounts", "Optionally enter a customized message here. A default email will be sent if left blank.")}">
{dgettext("survey_accounts", "This is where your message goes.")}
</textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" id="emailData" class="btn btn-primary">Email</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{dgettext("survey_accounts", "Close")}</button>
<button type="button" id="emailData" class="btn btn-primary">{dgettext("survey_accounts", "Email")}</button>
</div>
</div>
</div>
Expand Down
Loading