Skip to content

Commit 684a06b

Browse files
authored
Merge branch 'main' into TranslateElectrophysiologyUploaders
2 parents ec844f1 + 1f2ae28 commit 684a06b

File tree

150 files changed

+6986
-1143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+6986
-1143
lines changed

.github/labeler.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,8 @@ RaisinBread:
216216

217217
"Language: SQL":
218218
- changed-files:
219-
- any-glob-to-any-file: '**/*.sql'
219+
- any-glob-to-any-file: '**/*.sql'
220+
221+
"Multilingual":
222+
- changed-files:
223+
- any-glob-to-any-file: '**/*.po'

Makefile

Lines changed: 48 additions & 1 deletion
Large diffs are not rendered by default.

SQL/0000-00-03-ConfigTables.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CREATE TABLE `Config` (
4646
--
4747

4848
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('study', 'Settings related to details of the study', 1, 0, 'Study', 1);
49-
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'title', 'Full descriptive title of the study', 1, 0, 'text', ID, 'Study title', 1 FROM ConfigSettings WHERE Name="study";
49+
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber, Multilingual) SELECT 'title', 'Full descriptive title of the study', 1, 0, 'text', ID, 'Study title', 1, true FROM ConfigSettings WHERE Name="study";
5050
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'studylogo', 'Filename containing logo of the study. File should be located under the htdocs/images/ folder', 1, 0, 'text', ID, 'Study logo', 2 FROM ConfigSettings WHERE Name="study";
5151
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_left', 'Path for top left logo on the login page.', 1, 0, 'text', ID, 'Login Top Left Logo', 3 FROM ConfigSettings WHERE Name="study";
5252
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_right', 'Path for top right logo on the login page.', 1, 0, 'text', ID, 'Login Top Right Logo', 3 FROM ConfigSettings WHERE Name="study";
@@ -94,7 +94,7 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType,
9494

9595

9696
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('gui', 'Settings related to the overall display of LORIS', 1, 0, 'GUI', 3);
97-
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'StudyDescription', 'Description of the Study', 1, 0, 'textarea', ID , 'Study Description', 2 FROM ConfigSettings WHERE Name="gui";
97+
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber, Multilingual) SELECT 'StudyDescription', 'Description of the Study', 1, 0, 'textarea', ID , 'Study Description', 2, true FROM ConfigSettings WHERE Name="gui";
9898
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useEEGBrowserVisualizationComponents', 'Whether to enable the visualization components on the EEG Browser module', 1, 0, 'boolean', ID, 'Enable the EEG Browser components', 4 FROM ConfigSettings WHERE Name="gui";
9999

100100

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE ConfigSettings SET Multilingual=true WHERE Name IN ('projectDescription', 'StudyDescription', 'title');

jsx/Modal.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ButtonElement,
66
FormElement,
77
} from 'jsx/Form';
8+
import {useTranslation} from 'react-i18next';
89

910
export type ModalProps = PropsWithChildren<{
1011
throwWarning?: boolean;
@@ -38,20 +39,22 @@ const Modal = ({
3839
}: ModalProps) => {
3940
const [loading, setLoading] = useState(false); // Tracks loading during submit
4041
const [success, setSuccess] = useState(false); // Tracks success after submit
42+
const {t} = useTranslation('loris'); // Initialize translation
4143

4244
/**
4345
* Handles modal close event. Shows a confirmation if `throwWarning` is true.
4446
*/
4547
const handleClose = () => {
4648
if (throwWarning) { // Display warning if enabled
4749
Swal.fire({
48-
title: 'Are You Sure?',
49-
text: 'Leaving the form will result in the loss of any information ' +
50-
'entered.',
50+
title: t('Are You Sure?'),
51+
text:
52+
t('Leaving the form will result in the'
53+
+' loss of any information entered.'),
5154
type: 'warning',
5255
showCancelButton: true,
53-
confirmButtonText: 'Proceed',
54-
cancelButtonText: 'Cancel',
56+
confirmButtonText: t('Proceed'),
57+
cancelButtonText: t('Cancel'),
5558
}).then((result) => result.value && onClose());
5659
} else {
5760
onClose(); // Close immediately if no warning
@@ -89,7 +92,7 @@ const Modal = ({
8992
*/
9093
const submitButton = () => {
9194
if (onSubmit && !(loading || success)) { // Show button if conditions met
92-
return <div style={submitStyle}><ButtonElement/></div>;
95+
return <div style={submitStyle}><ButtonElement label={t('Save')}/></div>;
9396
}
9497
};
9598

@@ -175,7 +178,7 @@ const Modal = ({
175178
const loader = loading && (
176179
<div style={processStyle}>
177180
<Loader size={20}/>
178-
<h5 className='animate-flicker'>Saving</h5>
181+
<h5 className='animate-flicker'>{t('Saving')}</h5>
179182
</div>
180183
);
181184

@@ -188,7 +191,7 @@ const Modal = ({
188191
style={{color: 'green', marginBottom: '2px'}}
189192
className='glyphicon glyphicon-ok-circle'
190193
/>
191-
<h5>Success!</h5>
194+
<h5>{t('Success!')}</h5>
192195
</div>
193196
);
194197

locale/es/LC_MESSAGES/loris.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,21 @@ msgstr "Scan hecho"
239239
msgid "Language"
240240
msgstr "Lenguaje"
241241

242+
msgid "Access denied"
243+
msgstr "Acceso denegado"
244+
245+
msgid "No."
246+
msgstr "número"
247+
248+
msgid "Are you sure?"
249+
msgstr "Estás seguro?"
250+
251+
msgid "Yes, I am sure!"
252+
msgstr "¡Sí, estoy seguro!"
253+
254+
msgid "No, cancel it!"
255+
msgstr "¡No, cancélalo!"
256+
242257
# Data table strings
243258
msgid "{{pageCount}} rows displayed of {{totalCount}}."
244259
msgstr "{{pageCount}} filas mostradas de {{totalCount}}."

locale/fr/LC_MESSAGES/loris.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,21 @@ msgstr "Scan complété"
241241
msgid "Language"
242242
msgstr "Langue"
243243

244+
msgid "Access denied"
245+
msgstr "Accès refusé"
246+
247+
msgid "No."
248+
msgstr "Nombre"
249+
250+
msgid "Are you sure?"
251+
msgstr "Es-tu sûr?"
252+
253+
msgid "Yes, I am sure!"
254+
msgstr "Oui, j'en suis sûr!"
255+
256+
msgid "No, cancel it!"
257+
msgstr "Non, annulez-le !"
258+
244259
# Data table strings
245260
msgid "{{pageCount}} rows displayed of {{totalCount}}."
246261
msgstr "{{pageCount}} lignes affichées de {{totalCount}}."

locale/hi/LC_MESSAGES/loris.po

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ msgstr "सहेजें"
141141
msgid "Reset"
142142
msgstr "रीसेट करें"
143143

144+
msgid "Note"
145+
msgstr "नोट"
146+
144147
msgid "Back"
145148
msgstr "वापस"
146149

@@ -311,6 +314,9 @@ msgstr "विवरण देखें"
311314
msgid "Ethnicity"
312315
msgstr "जातीयता"
313316

317+
msgid "Access denied"
318+
msgstr "पहुँच अस्वीकृत"
319+
314320
msgid "Previous"
315321
msgstr "पिछला"
316322

@@ -503,3 +509,23 @@ msgstr "अनुमति अस्वीकृत"
503509

504510
msgid "Please make sure files are not larger than {{maxFileSize}}"
505511
msgstr "कृपया सुनिश्चित करें कि फ़ाइलें {{maxFileSize}} से बड़ी न हों"
512+
msgid "Are You Sure?"
513+
msgstr "क्या आप सुनिश्चित हैं?"
514+
515+
msgid "Are you sure?"
516+
msgstr "क्या आप सुनिश्चित हैं?"
517+
518+
msgid "Yes, I am sure!"
519+
msgstr "हाँ, मैं सुनिश्चित हूँ!"
520+
521+
msgid "No, cancel it!"
522+
msgstr "नहीं, रद्द करें!"
523+
524+
msgid "Leaving the form will result in the loss of any information entered."
525+
msgstr "फ़ॉर्म छोड़ने से दर्ज की गई सभी जानकारी खो जाएगी।"
526+
527+
msgid "Proceed"
528+
msgstr "आगे बढ़ें"
529+
530+
msgid "Saving"
531+
msgstr "सहेजा जा रहा है"

0 commit comments

Comments
 (0)