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/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/jsx/surveyAccountsIndex.js b/modules/survey_accounts/jsx/surveyAccountsIndex.js index c24aa2fdd5f..d51097acdae 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,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'}), 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.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 "" 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 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 @@
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}