From 6e5283899c8e10a3042f333c16d3adb615ed22dd Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Mon, 29 Sep 2025 07:00:36 -0400 Subject: [PATCH 1/3] Add Translations --- Makefile | 4 + locale/loris.pot | 7 + .../mri_violations/jsx/mriViolationsIndex.js | 68 ++++--- modules/mri_violations/jsx/protocolModal.js | 126 +++++++------ .../locale/hi/LC_MESSAGES/mri_violations.json | 51 ++++++ .../locale/hi/LC_MESSAGES/mri_violations.po | 166 ++++++++++++++++++ .../mri_violations/locale/mri_violations.pot | 143 +++++++++++++++ modules/mri_violations/php/resolve.class.inc | 8 +- .../php/usercentermatchornull.class.inc | 3 +- ...centermatchornulloranypermission.class.inc | 3 +- .../php/userprojectmatchornull.class.inc | 3 +- 11 files changed, 495 insertions(+), 87 deletions(-) create mode 100644 modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json create mode 100644 modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po diff --git a/Makefile b/Makefile index c7dec64e0a2..d58dcd162d3 100755 --- a/Makefile +++ b/Makefile @@ -120,6 +120,8 @@ locales: msgfmt -o modules/media/locale/ja/LC_MESSAGES/media.mo modules/media/locale/ja/LC_MESSAGES/media.po msgfmt -o modules/module_manager/locale/ja/LC_MESSAGES/module_manager.mo modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po msgfmt -o modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.po + msgfmt -o modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po + npx i18next-conv -l hi -s modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po -t modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json msgfmt -o modules/next_stage/locale/ja/LC_MESSAGES/next_stage.mo modules/next_stage/locale/ja/LC_MESSAGES/next_stage.po msgfmt -o modules/oidc/locale/ja/LC_MESSAGES/oidc.mo modules/oidc/locale/ja/LC_MESSAGES/oidc.po msgfmt -o modules/publication/locale/ja/LC_MESSAGES/publication.mo modules/publication/locale/ja/LC_MESSAGES/publication.po @@ -160,6 +162,8 @@ module_manager: target=module_manager npm run compile mri_violations: + msgfmt -o modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po + npx i18next-conv -l hi -s modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po -t modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json target=mri_violations npm run compile issue_tracker: diff --git a/locale/loris.pot b/locale/loris.pot index 5d0d10f350e..fffcdb83ce3 100644 --- a/locale/loris.pot +++ b/locale/loris.pot @@ -202,6 +202,12 @@ msgstr "" msgid "Language" msgstr "" +msgid "Access denied" +msgstr "" + +msgid "No." +msgstr "" + # Data table strings msgid "{{pageCount}} rows displayed of {{totalCount}}." msgstr "" @@ -259,3 +265,4 @@ msgstr "" msgid "In Progress" msgstr "" + diff --git a/modules/mri_violations/jsx/mriViolationsIndex.js b/modules/mri_violations/jsx/mriViolationsIndex.js index 9008bf7617c..a8a46d3546b 100644 --- a/modules/mri_violations/jsx/mriViolationsIndex.js +++ b/modules/mri_violations/jsx/mriViolationsIndex.js @@ -3,6 +3,10 @@ import FilterableDataTable from 'FilterableDataTable'; import React, {useEffect, useState} from 'react'; import PropTypes from 'prop-types'; import ProtocolModal from './protocolModal.js'; +import i18n from 'I18nSetup'; +import {withTranslation} from 'react-i18next'; + +import hiStrings from '../locale/hi/LC_MESSAGES/mri_violations.json'; /** * Entry point for the MRI Violatons module. @@ -17,6 +21,8 @@ function MRIViolationsIndex(props) { const [isError, setIsError] = useState(false); const [data, setData] = useState([]); const mapper = columnMapper(fieldOptions); + const {t} = props; + const violationsModal = (violationModal !== false) ? setViolationModal(false)} @@ -109,7 +115,8 @@ function MRIViolationsIndex(props) { let resolutionStatusStyle; let resolutionStatus; - if (column === 'Type of Problem' && cell === 'Protocol Violation') { + if (column === t('Type of Problem', {ns: 'mri_violations'}) && + cell === t('Protocol Violation', {ns: 'mri_violations'})) { return ( Protocol Violation + }>{t('Protocol Violation', {ns: 'mri_violations'})} ); } if ( - column === 'Type of Problem' && - cell === 'Could not identify scan type' + column === t('Type of Problem', {ns: 'mri_violations'}) && + cell === t('Could not identify scan type', {ns: 'mri_violations'}) ) { const seriesDescription = rowData[ - 'Series Description or Scan Type' + t('Series Description or Scan Type', {ns: 'mri_violations'}) ]; return ( @@ -259,74 +266,77 @@ function MRIViolationsIndex(props) { } return [ { - label: 'Patient Name', show: true, filter: { + label: t('Patient Name', {ns: 'mri_violations'}), show: true, filter: { name: 'patientName', type: 'text', }, }, { - label: 'Project', show: true, filter: { + label: t('Project', {ns: 'loris'}), show: true, filter: { name: 'project', type: 'select', options: fieldoptions.projects, }, }, { - label: 'Cohort', show: true, filter: { + label: t('Cohort', {ns: 'loris'}), show: true, filter: { name: 'cohort', type: 'select', options: fieldoptions.cohorts, }, }, { - label: 'Site', show: true, filter: { + label: t('Site', {ns: 'loris'}), show: true, filter: { name: 'site', type: 'select', options: fieldoptions.sites, }, }, { - label: 'Time Run', show: true, filter: { + label: t('Time Run', {ns: 'mri_violations'}), show: true, filter: { name: 'timeRun', type: 'datetime', }, }, { - label: 'Image File', show: true, filter: { + label: t('Image File', {ns: 'mri_violations'}), show: true, filter: { name: 'mincFile', type: 'text', }, }, { - label: 'Series Description or Scan Type', show: true, filter: { + label: t('Series Description or Scan Type', {ns: 'mri_violations'}), + show: true, filter: { name: 'seriesOrType', type: 'text', }, }, { - label: 'Type of Problem', show: true, filter: { + label: t('Type of Problem', {ns: 'mri_violations'}), + show: true, filter: { name: 'typeOfProblem', type: 'select', options: problemtypes, }, }, { - label: 'Resolution Status', show: true, filter: { + label: t('Resolution Status', {ns: 'mri_violations'}), + show: true, filter: { name: 'resolutionStatus', type: 'select', options: { - 'unresolved': 'Unresolved', - 'reran': 'Reran', - 'emailed': 'emailed site/pending', - 'inserted': 'Inserted', - 'rejected': 'Rejected', - 'inserted_flag': 'Inserted with flag', - 'other': 'Other', + 'unresolved': t('Unresolved', {ns: 'mri_violations'}), + 'reran': t('Reran', {ns: 'mri_violations'}), + 'emailed': t('emailed site/pending', {ns: 'mri_violations'}), + 'inserted': t('inserted', {ns: 'mri_violations'}), + 'rejected': t('rejected', {ns: 'mri_violations'}), + 'inserted_flag': t('inserted with flag', {ns: 'mri_violations'}), + 'other': t('other', {ns: 'mri_violations'}), }, }, }, { - label: 'Series UID', show: false, filter: { + label: t('Series UID', {ns: 'mri_violations'}), show: false, filter: { name: 'seriesUID', type: 'text', }, @@ -338,7 +348,7 @@ function MRIViolationsIndex(props) { {label: 'PSCID', show: false}, // Add fake column for resolution dropdown - {label: 'Select Resolution', show: true}, + {label: t('Select Resolution', {ns: 'mri_violations'}), show: true}, ]; }; @@ -348,7 +358,8 @@ function MRIViolationsIndex(props) { {!isLoaded ? : isError ? -

An error occurred while loading the page.

: +

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

: { + i18n.addResourceBundle('hi', 'mri_violations', hiStrings); + + const ViolationsIndex = withTranslation( + ['mri_violations', 'loris'] + )(MRIViolationsIndex); + ReactDOM.createRoot( document.getElementById('lorisworkspace') ).render( - , diff --git a/modules/mri_violations/jsx/protocolModal.js b/modules/mri_violations/jsx/protocolModal.js index 8e3d542d1c5..9baea4796f9 100644 --- a/modules/mri_violations/jsx/protocolModal.js +++ b/modules/mri_violations/jsx/protocolModal.js @@ -3,7 +3,7 @@ import StaticDataTable from 'StaticDataTable'; import React, {useEffect, useState} from 'react'; import PropTypes from 'prop-types'; - +import {withTranslation} from 'react-i18next'; /** * A Modal popup to display a protocol violation of any @@ -13,16 +13,18 @@ import PropTypes from 'prop-types'; * @return {JSX} */ function ProtocolModal(props) { + const {t} = props; switch (props.Type) { case 'protocolviolation': - return ; + return ; case 'protocolcheck': - return ; + return ; default: return null; } } ProtocolModal.propTypes = { Type: PropTypes.string, + t: PropTypes.func, }; /** @@ -38,6 +40,7 @@ ProtocolModal.propTypes = { function ProtocolViolationModal(props) { const [data, setData] = useState([]); const [protocols, setMRIProtocols] = useState([]); + const {t} = props; useEffect(() => { fetch(props.URL + '?format=json' + @@ -57,42 +60,43 @@ function ProtocolViolationModal(props) { let violations = []; - let title = 'Violations for SeriesUID ' + props.SeriesUID; + let title = t('Violations for SeriesUID', {ns: 'mri_violations'}) + + ' ' + props.SeriesUID; for (const violation of data) { - title = 'Violations for ' + violation[4]; + title = t('Violations for', {ns: 'mri_violations'}) + ' ' + violation[4]; violations.push(
-
CandID
+
{t('CandID', {ns: 'mri_violations'})}
{violation[0]}
-
PSCID
+
{t('PSCID', {ns: 'loris'})}
{violation[1]}
-
Time Run
+
{t('Time Run', {ns: 'mri_violations'})}
{violation[2]}
-
Series Description
+
{t('Series Description', {ns: 'mri_violations'})}
{violation[3]}
-
Image Location
+
{t('Image Location', {ns: 'mri_violations'})}
{violation[4]}
-
Patient Name
+
{t('Patient Name', {ns: 'mri_violations'})}
{violation[5]}
-
Series UID
+
{t('Series UID', {ns: 'mri_violations'})}
{props.SeriesUID}
-
Echo Time
+
{t('Echo Time', {ns: 'mri_violations'})}
{violation[8]}
@@ -100,21 +104,21 @@ function ProtocolViolationModal(props) { - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -166,23 +170,23 @@ function ProtocolViolationModal(props) {
Protocol GroupTRTETISlice ThicknessXspaceYspaceZspaceXstepYstepZstepTimeImage TypePhase Encoding DirectionEcho Number{t('Protocol Group', {ns: 'mri_violations'})}{t('TR', {ns: 'mri_violations'})}{t('TE', {ns: 'mri_violations'})}{t('TI', {ns: 'mri_violations'})}{t('Slice Thickness', {ns: 'mri_violations'})}{t('Xspace', {ns: 'mri_violations'})}{t('Yspace', {ns: 'mri_violations'})}{t('Zspace', {ns: 'mri_violations'})}{t('Xstep', {ns: 'mri_violations'})}{t('Ystep', {ns: 'mri_violations'})}{t('Zstep', {ns: 'mri_violations'})}{t('Time', {ns: 'mri_violations'})}{t('Image Type', {ns: 'mri_violations'})}{t('Phase Encoding Direction', {ns: 'mri_violations'})}{t('Echo Number', {ns: 'mri_violations'})}
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -204,7 +208,7 @@ function ProtocolViolationModal(props) {
Center NameScanner IDScan TypeTR RangeTE RangeTI RangeSlice Thickness RangeXspace RangeYspace RangeZspace RangeXstep RangeYstep RangeZstep RangeTime RangeImage TypePhase Encoding DirectionEcho Number{t('Center Name', {ns: 'mri_violations'})}{t('Scanner ID', {ns: 'mri_violations'})}{t('Scan Type', {ns: 'mri_violations'})}{t('TR Range', {ns: 'mri_violations'})}{t('TE Range', {ns: 'mri_violations'})}{t('TI Range', {ns: 'mri_violations'})}{t('Slice Thickness Range', {ns: 'mri_violations'})}{t('Xspace Range', {ns: 'mri_violations'})}{t('Yspace Range', {ns: 'mri_violations'})}{t('Zspace Range', {ns: 'mri_violations'})}{t('Xstep Range', {ns: 'mri_violations'})}{t('Ystep Range', {ns: 'mri_violations'})}{t('Zstep Range', {ns: 'mri_violations'})}{t('Time Range', {ns: 'mri_violations'})}{t('Image Type', {ns: 'mri_violations'})}{t('Phase Encoding Direction', {ns: 'mri_violations'})}{t('Echo Number', {ns: 'mri_violations'})}
{protocol['ScannerID']} {protocol['ScanType']} - Series Description Regex: + {t('Series Description Regex:', {ns: 'mri_violations'})} {protocol['series_description_regex']} @@ -244,9 +248,9 @@ function ProtocolViolationModal(props) { show={true} width="90%" title={title}> -

Image Protocol

+

{t('Image Protocol', {ns: 'mri_violations'})}

{violations} -

Study Protocols

+

{t('Study Protocols', {ns: 'mri_violations'})}

{protocolgroups} ; } @@ -254,6 +258,7 @@ ProtocolViolationModal.propTypes = { URL: PropTypes.string, SeriesUID: PropTypes.string, onClose: PropTypes.func, + t: PropTypes.func, }; /** @@ -268,6 +273,7 @@ ProtocolViolationModal.propTypes = { */ function ProtocolCheckViolationModal(props) { const [data, setData] = useState([]); + const {t} = props; useEffect(() => { fetch(props.URL + '?format=json' + '&violationtype=protocolcheck' + @@ -286,12 +292,20 @@ function ProtocolCheckViolationModal(props) { return -

Scan Problems

- +

{t('Scan Problems', {ns: 'mri_violations'})}

+ @@ -301,5 +315,7 @@ ProtocolCheckViolationModal.propTypes = { URL: PropTypes.string, SeriesUID: PropTypes.string, onClose: PropTypes.func, + t: PropTypes.func, }; -export default ProtocolModal; + +export default withTranslation(['mri_violations', 'loris'])(ProtocolModal); diff --git a/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json b/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json new file mode 100644 index 00000000000..a7c534164e7 --- /dev/null +++ b/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json @@ -0,0 +1,51 @@ +{ + "MRI Violated Scans": "एमआरआई उल्लंघन स्कैन", + "Violations for SeriesUID": "सीरीज़UID के लिए उल्लंघन", + "Violations for": "के लिए उल्लंघन", + "Time Run": "चलने का समय", + "Series Description": "श्रृंखला विवरण", + "Image Location": "छवि स्थान", + "Patient Name": "मरीज़ का नाम", + "Series UID": "श्रृंखला UID", + "Echo Time": "इको समय", + "Protocol Group": "प्रोटोकॉल समूह", + "TR": "टीआर", + "TE": "टीई", + "TI": "टीआई", + "Slice Thickness": "स्लाइस की मोटाई", + "Xspace": "एक्स स्पेस", + "Yspace": "वाई स्पेस", + "Zspace": "ज़ेड स्पेस", + "Xstep": "एक्स स्टेप", + "Ystep": "वाई स्टेप", + "Zstep": "ज़ेड स्टेप", + "Time": "समय", + "Image Type": "छवि प्रकार", + "Phase Encoding Direction": "फेज एन्कोडिंग दिशा", + "Echo Number": "इको संख्या", + "Image Protocol": "छवि प्रोटोकॉल", + "Study Protocols": "अध्ययन प्रोटोकॉल", + "Scan Problems": "स्कैन समस्याएँ", + "Scan Type": "स्कैन प्रकार", + "Severity": "गंभीरता", + "Header": "शीर्षक", + "Value": "मान", + "Valid Values": "मान्य मान", + "Protocol Violation": "प्रोटोकॉल उल्लंघन", + "Could not identify scan type": "स्कैन प्रकार की पहचान नहीं हो सकी", + "Series Description or Scan Type": "श्रृंखला विवरण या स्कैन प्रकार", + "Resolution Status": "समाधान स्थिति", + "Unresolved": "अनसुलझा", + "Reran": "पुनः चलाया गया", + "emailed site/pending": "साइट को ईमेल किया/लंबित", + "inserted": "डाला गया", + "rejected": "अस्वीकृत", + "Inserted with flag": "फ्लैग के साथ डाला गया", + "other": "अन्य", + "Type of Problem": "समस्या का प्रकार", + "Select Resolution": "समाधान चुनें", + "Image File": "छवि फ़ाइल", + "Must submit data in JSON format": "डेटा JSON प्रारूप में जमा करना आवश्यक है", + "Can not implement filter on a resource type that has no centers.": "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई केंद्र नहीं हैं।", + "Can not implement filter on a resource type that has no projects.": "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई प्रोजेक्ट नहीं हैं।" +} \ No newline at end of file diff --git a/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po b/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po new file mode 100644 index 00000000000..38e5baa24af --- /dev/null +++ b/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.po @@ -0,0 +1,166 @@ +# 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 "MRI Violated Scans" +msgstr "एमआरआई उल्लंघन स्कैन" + +msgid "Violations for SeriesUID" +msgstr "सीरीज़UID के लिए उल्लंघन" + +msgid "Violations for" +msgstr "के लिए उल्लंघन" + +msgid "Time Run" +msgstr "चलने का समय" + +msgid "Series Description" +msgstr "श्रृंखला विवरण" + +msgid "Image Location" +msgstr "छवि स्थान" + +msgid "Patient Name" +msgstr "मरीज़ का नाम" + +msgid "Series UID" +msgstr "श्रृंखला UID" + +msgid "Echo Time" +msgstr "इको समय" + +msgid "Protocol Group" +msgstr "प्रोटोकॉल समूह" + +msgid "TR" +msgstr "टीआर" + +msgid "TE" +msgstr "टीई" + +msgid "TI" +msgstr "टीआई" + +msgid "Slice Thickness" +msgstr "स्लाइस की मोटाई" + +msgid "Xspace" +msgstr "एक्स स्पेस" + +msgid "Yspace" +msgstr "वाई स्पेस" + +msgid "Zspace" +msgstr "ज़ेड स्पेस" + +msgid "Xstep" +msgstr "एक्स स्टेप" + +msgid "Ystep" +msgstr "वाई स्टेप" + +msgid "Zstep" +msgstr "ज़ेड स्टेप" + +msgid "Time" +msgstr "समय" + +msgid "Image Type" +msgstr "छवि प्रकार" + +msgid "Phase Encoding Direction" +msgstr "फेज एन्कोडिंग दिशा" + +msgid "Echo Number" +msgstr "इको संख्या" + +msgid "Image Protocol" +msgstr "छवि प्रोटोकॉल" + +msgid "Study Protocols" +msgstr "अध्ययन प्रोटोकॉल" + +msgid "Scan Problems" +msgstr "स्कैन समस्याएँ" + +msgid "Scan Type" +msgstr "स्कैन प्रकार" + +msgid "Severity" +msgstr "गंभीरता" + +msgid "Header" +msgstr "शीर्षक" + +msgid "Value" +msgstr "मान" + +msgid "Valid Values" +msgstr "मान्य मान" + +msgid "Protocol Violation" +msgstr "प्रोटोकॉल उल्लंघन" + +msgid "Could not identify scan type" +msgstr "स्कैन प्रकार की पहचान नहीं हो सकी" + +msgid "Series Description or Scan Type" +msgstr "श्रृंखला विवरण या स्कैन प्रकार" + +msgid "Resolution Status" +msgstr "समाधान स्थिति" + +msgid "Unresolved" +msgstr "अनसुलझा" + +msgid "Reran" +msgstr "पुनः चलाया गया" + +msgid "emailed site/pending" +msgstr "साइट को ईमेल किया/लंबित" + +msgid "inserted" +msgstr "डाला गया" + +msgid "rejected" +msgstr "अस्वीकृत" + +msgid "Inserted with flag" +msgstr "फ्लैग के साथ डाला गया" + +msgid "other" +msgstr "अन्य" + +msgid "Type of Problem" +msgstr "समस्या का प्रकार" + +msgid "Select Resolution" +msgstr "समाधान चुनें" + +msgid "Image File" +msgstr "छवि फ़ाइल" + +msgid "Must submit data in JSON format" +msgstr "डेटा JSON प्रारूप में जमा करना आवश्यक है" + +msgid "Can not implement filter on a resource type that has no centers." +msgstr "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई केंद्र नहीं हैं।" + +msgid "Can not implement filter on a resource type that has no projects." +msgstr "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई प्रोजेक्ट नहीं हैं।" diff --git a/modules/mri_violations/locale/mri_violations.pot b/modules/mri_violations/locale/mri_violations.pot index bd5bc3cb494..1ee312bc191 100644 --- a/modules/mri_violations/locale/mri_violations.pot +++ b/modules/mri_violations/locale/mri_violations.pot @@ -27,3 +27,146 @@ msgstr "" msgid "Violated scans" msgstr "" +msgid "Violations for SeriesUID" +msgstr "" + +msgid "Violations for" +msgstr "" + +msgid "Time Run" +msgstr "" + +msgid "Series Description" +msgstr "" + +msgid "Image Location" +msgstr "" + +msgid "Patient Name" +msgstr "" + +msgid "Series UID" +msgstr "" + +msgid "Echo Time" +msgstr "" + +msgid "Protocol Group" +msgstr "" + +msgid "TR" +msgstr "" + +msgid "TE" +msgstr "" + +msgid "TI" +msgstr "" + +msgid "Slice Thickness" +msgstr "" + +msgid "Xspace" +msgstr "" + +msgid "Yspace" +msgstr "" + +msgid "Zspace" +msgstr "" + +msgid "Xstep" +msgstr "" + +msgid "Ystep" +msgstr "" + +msgid "Zstep" +msgstr "" + +msgid "Time" +msgstr "" + +msgid "Image Type" +msgstr "" + +msgid "Phase Encoding Direction" +msgstr "" + +msgid "Echo Number" +msgstr "" + +msgid "Image Protocol" +msgstr "" + +msgid "Study Protocols" +msgstr "" + +msgid "Scan Problems" +msgstr "" + +msgid "Scan Type" +msgstr "" + +msgid "Severity" +msgstr "" + +msgid "Header" +msgstr "" + +msgid "Value" +msgstr "" + +msgid "Valid Values" +msgstr "" + +msgid "Protocol Violation" +msgstr "" + +msgid "Could not identify scan type" +msgstr "" + +msgid "Series Description or Scan Type" +msgstr "" + +msgid "Resolution Status" +msgstr "" + +msgid "Unresolved" +msgstr "" + +msgid "Reran" +msgstr "" + +msgid "emailed site/pending" +msgstr "" + +msgid "inserted" +msgstr "" + +msgid "rejected" +msgstr "" + +msgid "Inserted with flag" +msgstr "" + +msgid "other" +msgstr "" + +msgid "Type of Problem" +msgstr "" + +msgid "Select Resolution" +msgstr "" + +msgid "Image File" +msgstr "" + +msgid "Must submit data in JSON format" +msgstr "" + +msgid "Can not implement filter on a resource type that has no centers." +msgstr "" + +msgid "Can not implement filter on a resource type that has no projects." +msgstr "" diff --git a/modules/mri_violations/php/resolve.class.inc b/modules/mri_violations/php/resolve.class.inc index 3264e0fc835..990852e8567 100644 --- a/modules/mri_violations/php/resolve.class.inc +++ b/modules/mri_violations/php/resolve.class.inc @@ -41,14 +41,14 @@ class Resolve extends \NDB_Page { $user = $request->getAttribute("user"); if (!$this->_hasAccess($user)) { - return new \LORIS\Http\Response\JSON\Forbidden("Access denied"); + return new \LORIS\Http\Response\JSON\Forbidden(dgettext('loris', + "Access denied")); } $requestdata = json_decode((string) $request->getBody(), true); if (!is_array($requestdata)) { - return new \LORIS\Http\Response\JSON\BadRequest( - "Must submit data in JSON format" - ); + return new \LORIS\Http\Response\JSON\BadRequest(dgettext('loris', + "Must submit data in JSON format")); } $DB = $this->loris->getDatabaseConnection(); diff --git a/modules/mri_violations/php/usercentermatchornull.class.inc b/modules/mri_violations/php/usercentermatchornull.class.inc index 8459e5ee855..6a2812d4874 100644 --- a/modules/mri_violations/php/usercentermatchornull.class.inc +++ b/modules/mri_violations/php/usercentermatchornull.class.inc @@ -37,7 +37,8 @@ class UserCenterMatchOrNull implements \LORIS\Data\Filter return true; } throw new \LorisException( - "Can not implement filter on a resource type that has no centers." + dgettext('mri_violations', + "Can not implement filter on a resource type that has no centers.") ); } } diff --git a/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc b/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc index 3518a8b0190..5c35302dd56 100644 --- a/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc +++ b/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc @@ -51,7 +51,8 @@ class UserCenterMatchOrNullOrAnyPermission implements \LORIS\Data\Filter return true; } throw new \LorisException( - "Can not implement filter on a resource type that has no centers." + dgettext('loris', + "Can not implement filter on a resource type that has no centers.") ); } } diff --git a/modules/mri_violations/php/userprojectmatchornull.class.inc b/modules/mri_violations/php/userprojectmatchornull.class.inc index d1699704133..7c359889a75 100644 --- a/modules/mri_violations/php/userprojectmatchornull.class.inc +++ b/modules/mri_violations/php/userprojectmatchornull.class.inc @@ -57,7 +57,8 @@ class UserProjectMatchOrNull implements \LORIS\Data\Filter return true; } throw new \LorisException( - "Can not implement filter on a resource type that has no projects." + dgettext('loris', + "Can not implement filter on a resource type that has no projects.") ); } } From 150761142f2d181ab6e68cf57e3b7b71dc04ea2f Mon Sep 17 00:00:00 2001 From: Saket Hatwar Date: Tue, 30 Sep 2025 06:13:03 -0400 Subject: [PATCH 2/3] lint --- locale/hi/LC_MESSAGES/loris.po | 9 ++++++ modules/mri_violations/php/resolve.class.inc | 28 ++++++++++++------- .../php/usercentermatchornull.class.inc | 8 ++++-- ...centermatchornulloranypermission.class.inc | 8 ++++-- .../php/userprojectmatchornull.class.inc | 9 ++++-- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/locale/hi/LC_MESSAGES/loris.po b/locale/hi/LC_MESSAGES/loris.po index 32d08fba0ca..ee832f91a59 100644 --- a/locale/hi/LC_MESSAGES/loris.po +++ b/locale/hi/LC_MESSAGES/loris.po @@ -187,6 +187,15 @@ msgstr "उन्नत फ़िल्टर दिखाएँ" msgid "Hide Advanced Filters" msgstr "उन्नत फ़िल्टर छुपाएँ" +msgid "Language" +msgstr "भाषा" + +msgid "Access denied" +msgstr "पहुँच अस्वीकृत" + +msgid "No." +msgstr "क्रमांक" + # Data table strings msgid "{{pageCount}} rows displayed of {{totalCount}}." msgstr "{{totalCount}} में से {{pageCount}} पंक्तियाँ प्रदर्शित" diff --git a/modules/mri_violations/php/resolve.class.inc b/modules/mri_violations/php/resolve.class.inc index 990852e8567..d614a898567 100644 --- a/modules/mri_violations/php/resolve.class.inc +++ b/modules/mri_violations/php/resolve.class.inc @@ -1,8 +1,9 @@ hasAnyPermission( [ @@ -37,18 +38,26 @@ class Resolve extends \NDB_Page * * @return ResponseInterface */ - public function handle(ServerRequestInterface $request) : ResponseInterface + public function handle(ServerRequestInterface $request): ResponseInterface { $user = $request->getAttribute("user"); if (!$this->_hasAccess($user)) { - return new \LORIS\Http\Response\JSON\Forbidden(dgettext('loris', - "Access denied")); + return new \LORIS\Http\Response\JSON\Forbidden( + dgettext( + 'loris', + "Access denied" + ) + ); } $requestdata = json_decode((string) $request->getBody(), true); if (!is_array($requestdata)) { - return new \LORIS\Http\Response\JSON\BadRequest(dgettext('loris', - "Must submit data in JSON format")); + return new \LORIS\Http\Response\JSON\BadRequest( + dgettext( + 'loris', + "Must submit data in JSON format" + ) + ); } $DB = $this->loris->getDatabaseConnection(); @@ -80,7 +89,7 @@ class Resolve extends \NDB_Page // Not modified $response = $response->withStatus(304); } - } else if ($val !== 'unresolved') { + } elseif ($val !== 'unresolved') { // no need to insert to DB for Unresolved value. // Base of the insert @@ -154,4 +163,3 @@ class Resolve extends \NDB_Page return $response; } } - diff --git a/modules/mri_violations/php/usercentermatchornull.class.inc b/modules/mri_violations/php/usercentermatchornull.class.inc index 6a2812d4874..8278d7ab6bc 100644 --- a/modules/mri_violations/php/usercentermatchornull.class.inc +++ b/modules/mri_violations/php/usercentermatchornull.class.inc @@ -20,7 +20,7 @@ class UserCenterMatchOrNull implements \LORIS\Data\Filter * * @return bool */ - public function filter(\User $user, \Loris\Data\DataInstance $resource) : bool + public function filter(\User $user, \Loris\Data\DataInstance $resource): bool { // phan only understands method_exists on simple variables. // Assigning to a variable is the a workaround @@ -37,8 +37,10 @@ class UserCenterMatchOrNull implements \LORIS\Data\Filter return true; } throw new \LorisException( - dgettext('mri_violations', - "Can not implement filter on a resource type that has no centers.") + dgettext( + 'mri_violations', + "Can not implement filter on a resource type that has no centers." + ) ); } } diff --git a/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc b/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc index 5c35302dd56..a3fbce96899 100644 --- a/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc +++ b/modules/mri_violations/php/usercentermatchornulloranypermission.class.inc @@ -30,7 +30,7 @@ class UserCenterMatchOrNullOrAnyPermission implements \LORIS\Data\Filter * * @return bool */ - public function filter(\User $user, \Loris\Data\DataInstance $resource) : bool + public function filter(\User $user, \Loris\Data\DataInstance $resource): bool { // phan only understands method_exists on simple variables. // Assigning to a variable is the a workaround @@ -51,8 +51,10 @@ class UserCenterMatchOrNullOrAnyPermission implements \LORIS\Data\Filter return true; } throw new \LorisException( - dgettext('loris', - "Can not implement filter on a resource type that has no centers.") + dgettext( + 'loris', + "Can not implement filter on a resource type that has no centers." + ) ); } } diff --git a/modules/mri_violations/php/userprojectmatchornull.class.inc b/modules/mri_violations/php/userprojectmatchornull.class.inc index 7c359889a75..105f65b5571 100644 --- a/modules/mri_violations/php/userprojectmatchornull.class.inc +++ b/modules/mri_violations/php/userprojectmatchornull.class.inc @@ -12,6 +12,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 * @link https://www.github.com/aces/Loris/ */ + namespace LORIS\mri_violations; /** @@ -40,7 +41,7 @@ class UserProjectMatchOrNull implements \LORIS\Data\Filter * * @return bool true if the user has a project in common with the data */ - public function filter(\User $user, \Loris\Data\DataInstance $resource) : bool + public function filter(\User $user, \Loris\Data\DataInstance $resource): bool { // phan only understands method_exists on simple variables. // Assigning to a variable is the a workaround @@ -57,8 +58,10 @@ class UserProjectMatchOrNull implements \LORIS\Data\Filter return true; } throw new \LorisException( - dgettext('loris', - "Can not implement filter on a resource type that has no projects.") + dgettext( + 'loris', + "Can not implement filter on a resource type that has no projects." + ) ); } } From c4d5574e9bf037e5fa7ff1cd72bb9ccb97a7726f Mon Sep 17 00:00:00 2001 From: T Saket Hatwar <112693309+SKADE2303@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:11:46 +0530 Subject: [PATCH 3/3] Delete modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json --- .../locale/hi/LC_MESSAGES/mri_violations.json | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json diff --git a/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json b/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json deleted file mode 100644 index a7c534164e7..00000000000 --- a/modules/mri_violations/locale/hi/LC_MESSAGES/mri_violations.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "MRI Violated Scans": "एमआरआई उल्लंघन स्कैन", - "Violations for SeriesUID": "सीरीज़UID के लिए उल्लंघन", - "Violations for": "के लिए उल्लंघन", - "Time Run": "चलने का समय", - "Series Description": "श्रृंखला विवरण", - "Image Location": "छवि स्थान", - "Patient Name": "मरीज़ का नाम", - "Series UID": "श्रृंखला UID", - "Echo Time": "इको समय", - "Protocol Group": "प्रोटोकॉल समूह", - "TR": "टीआर", - "TE": "टीई", - "TI": "टीआई", - "Slice Thickness": "स्लाइस की मोटाई", - "Xspace": "एक्स स्पेस", - "Yspace": "वाई स्पेस", - "Zspace": "ज़ेड स्पेस", - "Xstep": "एक्स स्टेप", - "Ystep": "वाई स्टेप", - "Zstep": "ज़ेड स्टेप", - "Time": "समय", - "Image Type": "छवि प्रकार", - "Phase Encoding Direction": "फेज एन्कोडिंग दिशा", - "Echo Number": "इको संख्या", - "Image Protocol": "छवि प्रोटोकॉल", - "Study Protocols": "अध्ययन प्रोटोकॉल", - "Scan Problems": "स्कैन समस्याएँ", - "Scan Type": "स्कैन प्रकार", - "Severity": "गंभीरता", - "Header": "शीर्षक", - "Value": "मान", - "Valid Values": "मान्य मान", - "Protocol Violation": "प्रोटोकॉल उल्लंघन", - "Could not identify scan type": "स्कैन प्रकार की पहचान नहीं हो सकी", - "Series Description or Scan Type": "श्रृंखला विवरण या स्कैन प्रकार", - "Resolution Status": "समाधान स्थिति", - "Unresolved": "अनसुलझा", - "Reran": "पुनः चलाया गया", - "emailed site/pending": "साइट को ईमेल किया/लंबित", - "inserted": "डाला गया", - "rejected": "अस्वीकृत", - "Inserted with flag": "फ्लैग के साथ डाला गया", - "other": "अन्य", - "Type of Problem": "समस्या का प्रकार", - "Select Resolution": "समाधान चुनें", - "Image File": "छवि फ़ाइल", - "Must submit data in JSON format": "डेटा JSON प्रारूप में जमा करना आवश्यक है", - "Can not implement filter on a resource type that has no centers.": "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई केंद्र नहीं हैं।", - "Can not implement filter on a resource type that has no projects.": "ऐसे संसाधन प्रकार पर फ़िल्टर लागू नहीं किया जा सकता जिसमें कोई प्रोजेक्ट नहीं हैं।" -} \ No newline at end of file