Skip to content

Commit d975cee

Browse files
author
Dave MacFarlane
committed
[candidate_profile] Translate Candidate Info widget on candidate_profile page
This translates the first candidate info widget on the candidatE_profile page. Japanese is used as the sample language.
1 parent a1ef9fd commit d975cee

File tree

10 files changed

+323
-33
lines changed

10 files changed

+323
-33
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ testdata:
5858
php tools/raisinbread_refresh.php
5959

6060
locales:
61+
msgfmt -o locale/en/LC_MESSAGES/loris.mo locale/en/LC_MESSAGES/loris.po
62+
npx i18next-conv -l en -s locale/en/LC_MESSAGES/loris.po -t locale/en/LC_MESSAGES/loris.json --compatibilityJSON v4
6163
msgfmt -o locale/ja/LC_MESSAGES/loris.mo locale/ja/LC_MESSAGES/loris.po
62-
npx i18next-conv -l ja -s locale/ja/LC_MESSAGES/loris.po -t locale/ja/LC_MESSAGES/loris.json
64+
npx i18next-conv -l ja -s locale/ja/LC_MESSAGES/loris.po -t locale/ja/LC_MESSAGES/loris.json --compatibilityJSON v4
6365
msgfmt -o locale/hi/LC_MESSAGES/loris.mo locale/hi/LC_MESSAGES/loris.po
64-
npx i18next-conv -l hi -s locale/hi/LC_MESSAGES/loris.po -t locale/hi/LC_MESSAGES/loris.json
66+
npx i18next-conv -l hi -s locale/hi/LC_MESSAGES/loris.po -t locale/hi/LC_MESSAGES/loris.json --compatibilityJSON v4
6567
msgfmt -o locale/es/LC_MESSAGES/loris.mo locale/es/LC_MESSAGES/loris.po
66-
npx i18next-conv -l es -s locale/es/LC_MESSAGES/loris.po -t locale/es/LC_MESSAGES/loris.json
68+
npx i18next-conv -l es -s locale/es/LC_MESSAGES/loris.po -t locale/es/LC_MESSAGES/loris.json --compatibilityJSON v4
6769
msgfmt -o modules/new_profile/locale/ja/LC_MESSAGES/new_profile.mo modules/new_profile/locale/ja/LC_MESSAGES/new_profile.po
6870
msgfmt -o modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.mo modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.po
6971
msgfmt -o modules/api_docs/locale/ja/LC_MESSAGES/api_docs.mo modules/api_docs/locale/ja/LC_MESSAGES/api_docs.po

jsx/I18nSetup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {initReactI18next} from 'react-i18next';
33

44
import jaResources from '../locale/ja/LC_MESSAGES/loris.json';
55
import hiResources from '../locale/hi/LC_MESSAGES/loris.json';
6+
import enResources from '../locale/en/LC_MESSAGES/loris.json';
67

78
const resources = {
89
ja: {
@@ -11,6 +12,9 @@ const resources = {
1112
hi: {
1213
loris: hiResources,
1314
},
15+
en: {
16+
loris: enResources,
17+
}
1418
};
1519

1620
i18n

locale/en/LC_MESSAGES/loris.po

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
# Default LORIS strings to be translated (English).
2+
# Copy this to a language specific file and add translations to the
3+
# new file.
4+
# Copyright (C) 2025
5+
# This file is distributed under the same license as the LORIS package.
6+
# Dave MacFarlane <[email protected]>, 2025.
7+
#
8+
9+
msgid ""
10+
msgstr ""
11+
"Project-Id-Version: LORIS 27\n"
12+
"Report-Msgid-Bugs-To: https://github.com/aces/Loris/issues\n"
13+
"POT-Creation-Date: 2025-04-08 14:37-0400\n"
14+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
15+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
16+
"Language-Team: LANGUAGE <[email protected]>\n"
17+
"Language: \n"
18+
"MIME-Version: 1.0\n"
19+
"Content-Type: text/plain; charset=UTF-8\n"
20+
"Content-Transfer-Encoding: 8bit\n"
21+
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
22+
23+
# Smarty template main.tpl strings
24+
msgid "LORIS"
25+
msgstr "LORIS"
26+
27+
msgid "DEV"
28+
msgstr "DEV"
29+
30+
msgid "Affiliations"
31+
msgstr "Affiliations"
32+
33+
msgid "Site Affiliation"
34+
msgstr "Site Affiliation"
35+
36+
msgid "Site Affiliations"
37+
msgstr "Site Affiliations"
38+
39+
msgid "Project Affiliation"
40+
msgstr "Project Affiliation"
41+
42+
msgid "Project Affiliations"
43+
msgstr "Project Affiliations"
44+
45+
msgid "Log Out"
46+
msgstr "Log Out"
47+
48+
msgid "My Preferences"
49+
msgstr "My Preferences"
50+
51+
# Auto extracted strings from PHP
52+
# Menu categories
53+
#: modules/configuration/php/module.class.inc:50
54+
#: modules/help_editor/php/module.class.inc:47
55+
#: modules/instrument_manager/php/module.class.inc:53
56+
#: modules/module_manager/php/module.class.inc:50
57+
#: modules/server_processes_manager/php/module.class.inc:104
58+
#: modules/survey_accounts/php/module.class.inc:48
59+
#: modules/user_accounts/php/module.class.inc:53
60+
msgid "Admin"
61+
msgstr "Admin"
62+
#: modules/acknowledgements/php/module.class.inc:54
63+
#: modules/api_docs/php/module.class.inc:66
64+
#: modules/battery_manager/php/module.class.inc:55
65+
#: modules/datadict/php/module.class.inc:49
66+
#: modules/data_release/php/module.class.inc:56
67+
#: modules/dictionary/php/module.class.inc:49
68+
msgid "Data Dictionary"
69+
msgstr "Data Dictionary"
70+
71+
#: modules/document_repository/php/module.class.inc:56
72+
#: modules/instrument_builder/php/module.class.inc:48
73+
#: modules/issue_tracker/php/module.class.inc:54
74+
#: modules/schedule_module/php/module.class.inc:49
75+
msgid "Tools"
76+
msgstr "Tools"
77+
78+
#: modules/behavioural_qc/php/module.class.inc:51
79+
#: modules/conflict_resolver/php/module.class.inc:83
80+
#: modules/examiner/php/module.class.inc:50
81+
#: modules/media/php/module.class.inc:33
82+
msgid "Clinical"
83+
msgstr "Clinical"
84+
85+
#: modules/dicom_archive/php/module.class.inc:115
86+
#: modules/imaging_browser/php/module.class.inc:40
87+
#: modules/imaging_qc/php/module.class.inc:50
88+
#: modules/imaging_uploader/php/module.class.inc:54
89+
#: modules/mri_violations/php/module.class.inc:53
90+
msgid "Imaging"
91+
msgstr "Imaging"
92+
93+
#: modules/candidate_list/php/module.class.inc:76
94+
#: modules/new_profile/php/module.class.inc:50
95+
msgid "Candidate"
96+
msgstr "Candidate"
97+
98+
#: modules/genomic_browser/php/module.class.inc:53
99+
msgid "Genomics"
100+
msgstr "Genomics"
101+
102+
#: modules/electrophysiology_browser/php/module.class.inc:54
103+
msgid "Electrophysiology"
104+
msgstr "Electrophysiology"
105+
106+
#: modules/dataquery/php/module.class.inc:33
107+
#: modules/dqt/php/module.class.inc:49
108+
#: modules/publication/php/module.class.inc:55
109+
#: modules/statistics/php/module.class.inc:49
110+
msgid "Reports"
111+
msgstr "Reports"
112+
113+
# Common loris terms. Consider moving these to their own textdomain?
114+
msgid "TimePoint"
115+
msgstr "TimePoint"
116+
117+
# Common select option labels
118+
msgid "Yes"
119+
msgstr "Yes"
120+
121+
msgid "No"
122+
msgstr "No"
123+
124+
msgid "Cancel"
125+
msgstr "Cancel"
126+
127+
# Common candidate terms
128+
msgid "PSCID"
129+
msgstr "PSCID"
130+
131+
msgid "DCCID"
132+
msgstr "DCCID"
133+
134+
msgid "Visit Label"
135+
msgstr "Visit Label"
136+
137+
msgid "Site"
138+
msgstr "Site"
139+
140+
msgid "Module"
141+
msgstr "Module"
142+
143+
msgid "Project"
144+
msgstr "Project"
145+
146+
msgid "Cohort"
147+
msgid_plural "Cohorts"
148+
msgstr[0] "Cohort"
149+
msgstr[1] "Cohorts"
150+
151+
msgid "Session"
152+
msgstr "Session"
153+
154+
msgid "Date of registration"
155+
msgstr "Date of registration"
156+
157+
msgid "Participant Status"
158+
msgstr "Participant Status"
159+
160+
msgid "DoB"
161+
msgstr "DoB"
162+
163+
msgid "Sex"
164+
msgstr "Sex"
165+
166+
msgid "Feedback"
167+
msgstr "Feedback"
168+
169+
msgid "Scans"
170+
msgstr "Scans"
171+
172+
msgid "Stage"
173+
msgstr "Stage"
174+
175+
msgid "Sent To DCC"
176+
msgstr "Sent To DCC"
177+
178+
msgid "Date of Birth"
179+
msgstr "Date of Birth"
180+
181+
msgid "Visits"
182+
msgstr "Visits"
183+
184+
msgid "An error occured while loading the page."
185+
msgstr "An error occured while loading the page."
186+
187+
msgid "Entity Type"
188+
msgstr "Entity Type"
189+
190+
msgid "Scan Done"
191+
msgstr "Scan Done"
192+
193+
msgid "Show Advanced Filters"
194+
msgstr "Show Advanced Fitlers"
195+
196+
msgid "Hide Advanced Filters"
197+
msgstr "Hide Advanced Filters"
198+
199+
# Data table strings
200+
msgid "{{pageCount}} rows displayed of {{totalCount}}."
201+
msgstr "{{pageCount}} rows displayed of {{totalCount}}."
202+
203+
msgid "Maximum rows per page:"
204+
msgstr "Maximum rows per page:"
205+
206+
msgid "Download Data as CSV"
207+
msgstr "Download Data as CSV"
208+
209+
# Dashboard panel strings
210+
msgid "Views"
211+
msgstr "Views"
212+
213+
# Common strings on widgets
214+
msgid "NEW"
215+
msgstr "NEW"
216+
217+
msgid "Updated"
218+
msgstr "Updated"
219+
220+
msgid "Uploaded"
221+
msgstr "Uploaded"
222+
223+
msgid "Total"
224+
msgstr "Total"
225+
226+
# Common timepoint and vist terms
227+
msgid "Not Started"
228+
msgstr "Not Started"
229+
230+
msgid "Screening"
231+
msgstr "Screening"
232+
233+
msgid "Visit"
234+
msgstr "Visit"
235+
236+
msgid "Approval"
237+
msgstr "Approval"
238+
239+
msgid "Subject"
240+
msgstr "Subject"
241+
242+
msgid "Recycling Bin"
243+
msgstr "Recycling Bin"
244+
245+
msgid "Pass"
246+
msgstr "Pass"
247+
248+
msgid "Failure"
249+
msgstr "Failure"
250+
251+
msgid "Withdrawal"
252+
msgstr "Withdrawal"
253+
254+
msgid "In Progress"
255+
msgstr "In Progress"

locale/ja/LC_MESSAGES/loris.po

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ msgstr ""
1717
"MIME-Version: 1.0\n"
1818
"Content-Type: text/plain; charset=UTF-8\n"
1919
"Content-Transfer-Encoding: 8bit\n"
20+
"Plural-Forms: nplurals=1; plural=0\n"
2021

2122
# Smarty template main.tpl strings
2223
msgid "LORIS"
@@ -122,6 +123,9 @@ msgstr "いいえ"
122123
msgid "Cancel"
123124
msgstr "取り消す"
124125

126+
msgid "N/A"
127+
msgstr "適用できない"
128+
125129
# Filters
126130
msgid "Selection Filter"
127131
msgstr "'選択フィルター"
@@ -155,10 +159,8 @@ msgid "Project"
155159
msgstr "プロジェクト"
156160

157161
msgid "Cohort"
158-
msgstr "コホート"
159-
160-
msgid "Cohorts"
161-
msgstr "コホート"
162+
msgid_plural "Cohorts"
163+
msgstr[0] "コホート"
162164

163165
msgid "Session"
164166
msgstr "セッション"
@@ -265,3 +267,13 @@ msgstr "撤退"
265267

266268
msgid "In Progress"
267269
msgstr "進行中"
270+
271+
# Age related terms
272+
msgid "Age"
273+
msgstr "年"
274+
275+
msgid "{{months}} months old"
276+
msgstr "{{months}}ヶ月"
277+
278+
msgid "{{years}} years old"
279+
msgstr "{{years}}歳"

locale/loris.pot

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ msgstr ""
123123
msgid "Cancel"
124124
msgstr ""
125125

126+
msgid "N/A"
127+
msgstr ""
128+
126129
# Common candidate terms
127130
msgid "PSCID"
128131
msgstr ""
@@ -143,11 +146,9 @@ msgid "Project"
143146
msgstr ""
144147

145148
msgid "Cohort"
146-
msgstr ""
147-
148-
msgid "Cohorts"
149-
msgstr ""
150-
149+
msgid_plural "Cohorts"
150+
msgstr[0] ""
151+
151152
msgid "Session"
152153
msgstr ""
153154

@@ -253,3 +254,13 @@ msgstr ""
253254

254255
msgid "In Progress"
255256
msgstr ""
257+
258+
# Age related terms
259+
msgid "Age"
260+
msgstr ""
261+
262+
msgid "{{months}} months old"
263+
msgstr ""
264+
265+
msgid "{{years}} years old"
266+
msgstr ""

modules/candidate_list/jsx/candidateListIndex.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class CandidateListIndex extends Component {
163163
);
164164
}
165165

166-
if (column === this.props.t('Cohort', {ns: 'loris'})) {
166+
if (column === this.props.t('Cohort', {ns: 'loris', count: 1})) {
167167
let result = (cell) ? <td>{cell}</td> : <td></td>;
168168
return result;
169169
}
@@ -230,7 +230,7 @@ class CandidateListIndex extends Component {
230230
},
231231
},
232232
{
233-
'label': this.props.t('Cohort', {ns: 'loris'}),
233+
'label': this.props.t('Cohort', {ns: 'loris', count: 1}),
234234
'show': true,
235235
'filter': {
236236
name: 'cohort',

modules/candidate_parameters/locale/ja/LC_MESSAGES/candidate_parameters.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ msgstr ""
2121
msgid "Candidate Parameters"
2222
msgstr "候補パラメータ"
2323

24+
msgid "Caveat"
25+
msgstr "警告"

0 commit comments

Comments
 (0)