Skip to content

Commit e5f34fe

Browse files
authored
Merge branch 'main' into TranslateElectrophysiologyUploaders
2 parents 6613ae6 + 5f67e04 commit e5f34fe

Some content is hidden

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

48 files changed

+1757
-439
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ locales:
8585
msgfmt -o modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.mo modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.po
8686
msgfmt -o modules/api_docs/locale/ja/LC_MESSAGES/api_docs.mo modules/api_docs/locale/ja/LC_MESSAGES/api_docs.po
8787
msgfmt -o modules/battery_manager/locale/ja/LC_MESSAGES/battery_manager.mo modules/battery_manager/locale/ja/LC_MESSAGES/battery_manager.po
88+
msgfmt -o modules/battery_manager/locale/hi/LC_MESSAGES/battery_manager.mo modules/battery_manager/locale/hi/LC_MESSAGES/battery_manager.po
89+
npx i18next-conv -l hi -s modules/battery_manager/locale/hi/LC_MESSAGES/battery_manager.po -t modules/battery_manager/locale/hi/LC_MESSAGES/battery_manager.json --compatibilityJSON v4
8890
msgfmt -o modules/behavioural_qc/locale/ja/LC_MESSAGES/behavioural_qc.mo modules/behavioural_qc/locale/ja/LC_MESSAGES/behavioural_qc.po
8991
msgfmt -o modules/behavioural_qc/locale/hi/LC_MESSAGES/behavioural_qc.mo modules/behavioural_qc/locale/hi/LC_MESSAGES/behavioural_qc.po
9092
npx i18next-conv -l hi -s modules/behavioural_qc/locale/hi/LC_MESSAGES/behavioural_qc.po -t modules/behavioural_qc/locale/hi/LC_MESSAGES/behavioural_qc.json
@@ -163,6 +165,7 @@ locales:
163165
npx i18next-conv -l hi -s modules/issue_tracker/locale/hi/LC_MESSAGES/issue_tracker.po -t modules/issue_tracker/locale/hi/LC_MESSAGES/issue_tracker.json --compatibilityJSON v4
164166
npx i18next-conv -l ja -s modules/issue_tracker/locale/ja/LC_MESSAGES/issue_tracker.po -t modules/issue_tracker/locale/ja/LC_MESSAGES/issue_tracker.json --compatibilityJSON v4
165167
msgfmt -o modules/login/locale/ja/LC_MESSAGES/login.mo modules/login/locale/ja/LC_MESSAGES/login.po
168+
npx i18next-conv -l ja -s modules/login/locale/ja/LC_MESSAGES/login.po -t modules/login/locale/ja/LC_MESSAGES/login.json --compatibilityJSON v4
166169
msgfmt -o modules/media/locale/es/LC_MESSAGES/media.mo modules/media/locale/es/LC_MESSAGES/media.po
167170
msgfmt -o modules/media/locale/fr/LC_MESSAGES/media.mo modules/media/locale/fr/LC_MESSAGES/media.po
168171
msgfmt -o modules/media/locale/ja/LC_MESSAGES/media.mo modules/media/locale/ja/LC_MESSAGES/media.po
@@ -174,6 +177,7 @@ locales:
174177
msgfmt -o modules/module_manager/locale/ja/LC_MESSAGES/module_manager.mo modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po
175178
msgfmt -o modules/module_manager/locale/hi/LC_MESSAGES/module_manager.mo modules/module_manager/locale/hi/LC_MESSAGES/module_manager.po
176179
npx i18next-conv -l hi -s modules/module_manager/locale/hi/LC_MESSAGES/module_manager.po -t modules/module_manager/locale/hi/LC_MESSAGES/module_manager.json
180+
npx i18next-conv -l ja -s modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po -t modules/module_manager/locale/ja/LC_MESSAGES/module_manager.json
177181
msgfmt -o modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.po
178182
msgfmt -o modules/my_preferences/locale/hi/LC_MESSAGES/my_preferences.mo modules/my_preferences/locale/hi/LC_MESSAGES/my_preferences.po
179183
npx i18next-conv -l ja -s modules/my_preferences/locale/ja/LC_MESSAGES/my_preferences.po -t modules/my_preferences/locale/ja/LC_MESSAGES/my_preferences.json --compatibilityJSON v4
@@ -183,8 +187,11 @@ locales:
183187
msgfmt -o modules/next_stage/locale/es/LC_MESSAGES/next_stage.mo modules/next_stage/locale/es/LC_MESSAGES/next_stage.po
184188
msgfmt -o modules/oidc/locale/ja/LC_MESSAGES/oidc.mo modules/oidc/locale/ja/LC_MESSAGES/oidc.po
185189
msgfmt -o modules/publication/locale/ja/LC_MESSAGES/publication.mo modules/publication/locale/ja/LC_MESSAGES/publication.po
190+
msgfmt -o modules/publication/locale/en/LC_MESSAGES/publication.mo modules/publication/locale/en/LC_MESSAGES/publication.po
186191
msgfmt -o modules/publication/locale/hi/LC_MESSAGES/publication.mo modules/publication/locale/hi/LC_MESSAGES/publication.po
187192
npx i18next-conv -l hi -s modules/publication/locale/hi/LC_MESSAGES/publication.po -t modules/publication/locale/hi/LC_MESSAGES/publication.json
193+
npx i18next-conv -l ja -s modules/publication/locale/ja/LC_MESSAGES/publication.po -t modules/publication/locale/ja/LC_MESSAGES/publication.json
194+
npx i18next-conv -l en -s modules/publication/locale/en/LC_MESSAGES/publication.po -t modules/publication/locale/en/LC_MESSAGES/publication.json
188195
msgfmt -o modules/schedule_module/locale/ja/LC_MESSAGES/schedule_module.mo modules/schedule_module/locale/ja/LC_MESSAGES/schedule_module.po
189196
msgfmt -o modules/schedule_module/locale/hi/LC_MESSAGES/schedule_module.mo modules/schedule_module/locale/hi/LC_MESSAGES/schedule_module.po
190197
npx i18next-conv -l hi -s modules/schedule_module/locale/hi/LC_MESSAGES/schedule_module.po -t modules/schedule_module/locale/hi/LC_MESSAGES/schedule_module.json
@@ -223,6 +230,7 @@ dataquery: modules/dataquery/locale/ja/LC_MESSAGES/dataquery.mo
223230
target=dataquery npm run compile
224231

225232
login: modules/login/locale/ja/LC_MESSAGES/login.mo
233+
npx i18next-conv -l ja -s modules/login/locale/ja/LC_MESSAGES/login.po -t modules/login/locale/ja/LC_MESSAGES/login.json --compatibilityJSON v4
226234
target=login npm run compile
227235

228236
module_manager: modules/module_manager/locale/ja/LC_MESSAGES/module_manager.mo modules/module_manager/locale/hi/LC_MESSAGES/module_manager.mo

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/hi/LC_MESSAGES/loris.po

Lines changed: 14 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

@@ -503,3 +506,14 @@ msgstr "अनुमति अस्वीकृत"
503506

504507
msgid "Please make sure files are not larger than {{maxFileSize}}"
505508
msgstr "कृपया सुनिश्चित करें कि फ़ाइलें {{maxFileSize}} से बड़ी न हों"
509+
msgid "Are You Sure?"
510+
msgstr "क्या आप सुनिश्चित हैं?"
511+
512+
msgid "Leaving the form will result in the loss of any information entered."
513+
msgstr "फ़ॉर्म छोड़ने से दर्ज की गई सभी जानकारी खो जाएगी।"
514+
515+
msgid "Proceed"
516+
msgstr "आगे बढ़ें"
517+
518+
msgid "Saving"
519+
msgstr "सहेजा जा रहा है"

locale/ja/LC_MESSAGES/loris.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ msgstr "はい"
123123
msgid "No"
124124
msgstr "いいえ"
125125

126+
msgid "Browse"
127+
msgstr "ブラウズ"
128+
126129
msgid "Create"
127130
msgstr "作成する"
128131

@@ -136,6 +139,9 @@ msgstr "戻る"
136139
msgid "Selection Filter"
137140
msgstr "'選択フィルター"
138141

142+
msgid "Filters"
143+
msgstr "フィルター"
144+
139145
msgid "Show Filters"
140146
msgstr "フィルターを表示"
141147

@@ -145,6 +151,9 @@ msgstr "フィルターを非表示"
145151
msgid "Clear Filters"
146152
msgstr "フィルターをクリア"
147153

154+
msgid "Load Filter Preset"
155+
msgstr "フィルタープリセットを読み込む"
156+
148157
# Common swal labels
149158
msgid "OK"
150159
msgstr "わかりました"
@@ -449,3 +458,6 @@ msgstr "特殊文字は必要ありませんが、パスワードは受け入れ
449458

450459
msgid "We suggest using a password manager to generate one for you."
451460
msgstr "パスワード マネージャーを使用してパスワードを生成することをお勧めします。"
461+
462+
msgid "Incorrect username or password."
463+
msgstr "ユーザー名またはパスワードが正しくありません。"

locale/loris.pot

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ msgstr ""
142142
msgid "Selection Filter"
143143
msgstr ""
144144

145+
msgid "Filters"
146+
msgstr ""
147+
145148
msgid "Show Filters"
146149
msgstr ""
147150

@@ -151,6 +154,9 @@ msgstr ""
151154
msgid "Clear Filters"
152155
msgstr ""
153156

157+
msgid "Load Filter Preset"
158+
msgstr ""
159+
154160
msgid "Show Advanced Filters"
155161
msgstr ""
156162

@@ -188,9 +194,6 @@ msgstr ""
188194
msgid "Close"
189195
msgstr ""
190196

191-
msgid "Close"
192-
msgstr ""
193-
194197
# Common candidate terms
195198
msgid "PSCID"
196199
msgstr ""
@@ -297,6 +300,15 @@ msgstr ""
297300
msgid "Ethnicity"
298301
msgstr ""
299302

303+
msgid "Are You Sure?"
304+
msgstr ""
305+
306+
msgid "Leaving the form will result in the loss of any information entered."
307+
msgstr ""
308+
309+
msgid "Proceed"
310+
msgstr ""
311+
300312
msgid "Previous"
301313
msgstr ""
302314

@@ -306,9 +318,15 @@ msgstr ""
306318
msgid "Save"
307319
msgstr ""
308320

321+
msgid "Saving"
322+
msgstr ""
323+
309324
msgid "Reset"
310325
msgstr ""
311326

327+
msgid "Note"
328+
msgstr ""
329+
312330
msgid "View details"
313331
msgstr ""
314332

0 commit comments

Comments
 (0)