Skip to content

Commit 0ffb168

Browse files
authored
[Instruments] Translates common Instruments module terms. (#10060)
- Translate common instruments terms ( Top tables showing state, etc and left Control Pannel). The instruments themselves should be translated at a database level, not as part of this PR. - Spanish language was use for demonstration purposes only. ( Also the only Spanish translations included in the loris.po file were the ones used in this module -- for simplicity and speeding the process) - Some entries were added to the general loris.pot file since they are used in other modules as well.
1 parent 23556a7 commit 0ffb168

File tree

8 files changed

+150
-47
lines changed

8 files changed

+150
-47
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ locales:
124124
msgfmt -o modules/instrument_list/locale/es/LC_MESSAGES/instrument_list.mo modules/instrument_list/locale/es/LC_MESSAGES/instrument_list.po
125125
msgfmt -o modules/instrument_manager/locale/ja/LC_MESSAGES/instrument_manager.mo modules/instrument_manager/locale/ja/LC_MESSAGES/instrument_manager.po
126126
msgfmt -o modules/instruments/locale/ja/LC_MESSAGES/instruments.mo modules/instruments/locale/ja/LC_MESSAGES/instruments.po
127+
msgfmt -o modules/instruments/locale/es/LC_MESSAGES/instruments.mo modules/instruments/locale/es/LC_MESSAGES/instruments.po
127128
msgfmt -o modules/issue_tracker/locale/ja/LC_MESSAGES/issue_tracker.mo modules/issue_tracker/locale/ja/LC_MESSAGES/issue_tracker.po
128129
msgfmt -o modules/login/locale/ja/LC_MESSAGES/login.mo modules/login/locale/ja/LC_MESSAGES/login.po
129130
msgfmt -o modules/media/locale/ja/LC_MESSAGES/media.mo modules/media/locale/ja/LC_MESSAGES/media.po

locale/es/LC_MESSAGES/loris.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ msgstr ""
113113
msgid "TimePoint"
114114
msgstr "Punto en el tiempo"
115115

116+
msgid "TimePoint %s Details"
117+
msgstr "Detalles del Punto en el Tiempo %s"
118+
116119
# Common select option labels
117120
msgid "Yes"
118121
msgstr "Sí"

locale/loris.pot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ msgstr ""
112112
msgid "TimePoint"
113113
msgstr ""
114114

115+
msgid "TimePoint %s Details"
116+
msgstr ""
117+
115118
# Common select option labels
116119
msgid "Yes"
117120
msgstr ""
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
msgid ""
9+
msgstr ""
10+
"Project-Id-Version: LORIS 27\n"
11+
"Report-Msgid-Bugs-To: https://github.com/aces/Loris/issues\n"
12+
"POT-Creation-Date: 2025-04-08 14:37-0400\n"
13+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15+
"Language-Team: LANGUAGE <[email protected]>\n"
16+
"Language: es\n"
17+
"MIME-Version: 1.0\n"
18+
"Content-Type: text/plain; charset=UTF-8\n"
19+
"Content-Transfer-Encoding: 8bit\n"
20+
21+
msgid "Instruments"
22+
msgstr "Instrumentos"
23+
24+
msgid "Incomplete form"
25+
msgstr "Formulario incompleto"
26+
27+
msgid "Incomplete forms"
28+
msgstr "Formularios incompletos"
29+
30+
msgid "Clear Instrument"
31+
msgstr "Limpiar Instrumento"
32+
33+
msgid "Validity"
34+
msgstr "Validez"
35+
36+
msgid "Valid"
37+
msgstr "Válido"
38+
39+
msgid "Questionable"
40+
msgstr "Questionable"
41+
42+
msgid "Invalid"
43+
msgstr "No válido"
44+
45+
msgid "Subtests"
46+
msgstr "Sub-exámenes"
47+
48+
msgid "Top"
49+
msgstr "Portada"

modules/instruments/locale/instruments.pot

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,24 @@ msgstr ""
2626

2727
msgid "Incomplete forms"
2828
msgstr ""
29+
30+
msgid "Clear Instrument"
31+
msgstr ""
32+
33+
msgid "Validity"
34+
msgstr ""
35+
36+
msgid "Valid"
37+
msgstr ""
38+
39+
msgid "Questionable"
40+
msgstr ""
41+
42+
msgid "Invalid"
43+
msgstr ""
44+
45+
msgid "Subtests"
46+
msgstr ""
47+
48+
msgid "Top"
49+
msgstr ""

php/libraries/NDB_BVL_Instrument.class.inc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ abstract class NDB_BVL_Instrument extends NDB_Page
384384
$current_date = new \DateTime();
385385
$dob_year = abs($current_date->diff($dob_date)->y);
386386
$dob_month = abs($current_date->diff($dob_date)->m);
387-
$dob_age = $dob_year . " y / " . $dob_month . " m";
387+
$dob_age = $dob_year . dgettext("timepoint_list", " y / ")
388+
. $dob_month . dgettext("timepoint_list", " m");
388389
$this->tpl_data['dob_age'] = $dob_age;
389390
}
390391
// EDC to EDC Age
@@ -394,7 +395,8 @@ abstract class NDB_BVL_Instrument extends NDB_Page
394395
$current_date = new DateTime();
395396
$edc_year = abs($current_date->diff($edc_date)->y);
396397
$edc_month = abs($current_date->diff($edc_date)->m);
397-
$edc_age = $edc_year . " y / " . $edc_month . " m";
398+
$edc_age = $edc_year . dgettext("timepoint_list", " y / ")
399+
. $edc_month . dgettext("timepoint_list", " m");
398400
$this->tpl_data['edc_age'] = $edc_age;
399401
}
400402
}
@@ -3208,15 +3210,16 @@ abstract class NDB_BVL_Instrument extends NDB_Page
32083210

32093211
return new \LORIS\BreadcrumbTrail(
32103212
new \LORIS\Breadcrumb(
3211-
'Access Profile',
3213+
dgettext("candidate_list", 'Access Profile'),
32123214
'/candidate_list'
32133215
),
32143216
new \LORIS\Breadcrumb(
3215-
"Candidate Profile $candid / $pscid",
3217+
dgettext("candidate_profile", "Candidate Profile")
3218+
. " $candid / $pscid",
32163219
"/$candid"
32173220
),
32183221
new \LORIS\Breadcrumb(
3219-
"TimePoint $visitlabel Details",
3222+
sprintf(dgettext("loris", "TimePoint %s Details"), $visitlabel),
32203223
"/instrument_list/?candID=$candid&sessionID=$sessionid"
32213224
),
32223225
new \LORIS\Breadcrumb(

smarty/templates/instrument_html.tpl

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,52 @@
1717
<thead>
1818
<tr class="info">
1919
<th>
20-
Derived Age
20+
{dgettext("timepoint_list", "Derived Age")}
2121
</th>
2222
<th>
23-
EDC Age
23+
{dgettext("timepoint_list", "EDC Age")}
2424
</th>
2525
<th>
26-
Biological Sex
26+
{dgettext("timepoint_list", "Biological Sex")}
2727
</th>
28-
{if $candidate.ProjectTitle != ""}
28+
{if $candidate.ProjectTitle == $candidate.ProjectName && $candidate.ProjectName != ""}
2929
<th>
30-
Project
30+
{dgettext("loris", "Project")}
3131
</th>
32+
{else}
33+
{if $candidate.ProjectTitle != ""}
34+
<th>
35+
{dgettext("loris", "Candidate Registration Project")}
36+
</th>
37+
{/if}
38+
{if $candidate.ProjectName != ""}
39+
<th>
40+
{dgettext("loris", "Timepoint Project")}
41+
</th>
42+
{/if}
3243
{/if}
3344
{foreach from=$candidate.DisplayParameters item=value key=name}
3445
<th>
3546
{$name}
3647
</th>
3748
{/foreach}
3849
<th>
39-
Visit Label
50+
{dgettext("loris", "Visit Label")}
4051
</th>
4152
<th>
42-
Visit to Site
53+
{dgettext("instrument_list", "Visit to Site")}
4354
</th>
4455
<th>
45-
Cohort
56+
{dgettext("loris", "Cohort")}
4657
</th>
4758
<th>
48-
MR Scan Done
59+
{dgettext("timepoint_list", "Imaging Scan Done")}
4960
</th>
5061
<th>
51-
Within Optimal
62+
{dgettext("instrument_list", "Within Optimal")}
5263
</th>
5364
<th>
54-
Within Permitted
65+
{dgettext("instrument_list", "Within Permitted")}
5566
</th>
5667
{if $SupplementalSessionStatuses }
5768
{foreach from=$timePoint.status item=status key=name}
@@ -100,23 +111,33 @@
100111
{$timePoint.CohortTitle}
101112
</td>
102113
<td>
103-
{$timePoint.Scan_done|default:"<img alt=\"Data Missing\" src=\"$baseurl/images/help2.gif\" width=\"12\" height=\"12\" />"}
114+
{if $timePoint.Scan_done != ""}
115+
{if $timePoint.Scan_done == 'Y'}
116+
{assign var="scan_done" value=dgettext("loris", "Yes")}
117+
{$scan_done}
118+
{else}
119+
{assign var="scan_done" value={dgettext("loris", "No")}}
120+
{$scan_done}
121+
{/if}
122+
{else}
123+
<img alt="Data Missing" src="{$baseurl|default}/images/help2.gif" border=0>
124+
{/if}
104125
</td>
105126
<td>
106-
{if $timePoint.WindowInfo.Optimum}
107-
Yes
127+
{if $display.WindowInfo.Optimum|default}
128+
{dgettext("loris", "Yes")}
108129
{else}
109-
No
130+
{dgettext("loris", "No")}
110131
{/if}
111132
</td>
112-
<td {if not $timePoint.WindowInfo.Optimum}class="error"{/if}>
113-
{if $timePoint.WindowInfo.Permitted}
114-
Yes
133+
<td {if not $display.WindowInfo.Optimum|default}class="error"{/if}>
134+
{if $display.WindowInfo.Permitted|default}
135+
{dgettext("loris", "Yes")}
115136
{else}
116-
No
137+
{dgettext("loris", "No")}
117138
{/if}
118139
</td>
119-
{if $SupplementalSessionStatuses }
140+
{if $SupplementalSessionStatuses|default}
120141
{foreach from=$timePoint.status item=status}
121142
<td>
122143
{$status}
@@ -133,20 +154,20 @@
133154
<thead>
134155
<tr class="info">
135156
<th nowrap="nowrap" colspan="3">
136-
Stage
157+
{dgettext("loris", "Stage")}
137158
</th>
138159
<th nowrap="nowrap" colspan="3">
139-
Status
160+
{dgettext("timepoint_list", "Stage Status")}
140161
</th>
141162
<th nowrap="nowrap" colspan="2">
142-
Date
163+
{dgettext("timepoint_list", "Date of Stage")}
143164
</th>
144165
</tr>
145166
</thead>
146167
<tbody>
147168
<tr>
148169
<td nowrap="nowrap" colspan="3">
149-
Screening
170+
{dgettext("loris", "Screening")}
150171
</td>
151172
<td nowrap="nowrap" colspan="3">
152173
{$timePoint.Screening}
@@ -157,18 +178,20 @@
157178
</tr>
158179
<tr>
159180
<td nowrap="nowrap" colspan="3">
160-
Visit
181+
{dgettext("loris", "Visit")}
161182
</td>
162183
<td nowrap="nowrap" colspan="3">
163-
{$timePoint.Visit}
184+
{if $timePoint.Visit != ""}
185+
{dgettext("loris", $timePoint.Visit)}
186+
{/if}
164187
</td>
165188
<td nowrap="nowrap" colspan="2">
166189
{$timePoint.Date_visit}
167190
</td>
168191
</tr>
169192
<tr>
170193
<td nowrap="nowrap" colspan="3">
171-
Approval
194+
{dgettext("loris", "Approval")}
172195
</td>
173196
<td nowrap="nowrap" colspan="3">
174197
{$timePoint.Approval}

smarty/templates/instrumentstatus_controlpanel.tpl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script type="text/javascript" src="{$baseurl}/js/instrument_controlpanel_control.js"></script>
22
{if $InstrumentResetting }
3-
<h3 class="controlPanelSection">Clear Instrument</h3>
3+
<h3 class="controlPanelSection">{dgettext("instruments", "Clear Instrument")}</h3>
44
<ul class="controlPanel">
55
<li><div id="deleteInstrumentBtn"></div></li>
66
</ul>
@@ -11,56 +11,56 @@
1111
).render(RControlpanelDeleteInstrumentData());
1212
</script>
1313
{/if}
14-
<h3 class="controlPanelSection">Administration</h3>
14+
<h3 class="controlPanelSection">{dgettext("loris", "Administration")}</h3>
1515
<ul class="controlPanel fa-ul">
1616
{section name=item loop=$administration}
1717
<li>
1818
<span class="fa-li"><i class="{$administration[item].icon|default:'far fa-square'}"></i></span>
1919
{if $access.administration and $administration[item].showlink}
20-
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setAdministration={$administration[item].label}&test_name={$test_name}">{$administration[item].label}</a>
20+
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setAdministration={$administration[item].label}&test_name={$test_name}">{dgettext("loris", $administration[item].label)}</a>
2121
{else}
22-
{$administration[item].label}
22+
{dgettext("loris", $administration[item].label)}
2323
{/if}
2424
</li>
2525
{/section}
2626
</ul>
2727
{if $validity}
28-
<h3 class="controlPanelSection">Validity</h3>
28+
<h3 class="controlPanelSection">{dgettext("instruments", "Validity")}</h3>
2929
<ul class="controlPanel fa-ul">
3030
{section name=item loop=$validity}
3131
<li>
3232
<span class="fa-li"><i class="{$validity[item].icon|default:'far fa-square'}"></i></span>
3333
{if $access.validity and $validity[item].showLink}
34-
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setValidity={$validity[item].label}&test_name={$test_name}">{$validity[item].label}</a>
34+
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setValidity={$validity[item].label}&test_name={$test_name}">{dgettext("instruments", $validity[item].label)}</a>
3535
{else}
36-
{$validity[item].label}
36+
{dgettext("instruments", $validity[item].label)}
3737
{/if}
3838
</li>
3939
{/section}
4040
</ul>
4141
{/if}
42-
<h3 class="controlPanelSection">Data Entry</h3>
42+
<h3 class="controlPanelSection">{dgettext("loris", "Data Entry")}</h3>
4343
<ul class="controlPanel fa-ul">
4444
{section name=item loop=$data_entry}
4545
<li>
4646
<span class="fa-li"><i class="{$data_entry[item].icon|default:'far fa-square'}"></i></span>
4747
{if $access.data_entry and $data_entry[item].showlink}
48-
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setDataEntry={$data_entry[item].label}&test_name={$test_name}">{$data_entry[item].label}</a>
48+
<a href="?commentID={$commentID}&candID={$candID}&sessionID={$sessionID}&setDataEntry={$data_entry[item].label}&test_name={$test_name}">{dgettext("loris", $data_entry[item].label)}</a>
4949
{else}
5050
{if $data_entry[item].tooltip}
5151
<span data-toggle="tooltip" data-placement="right" title="{$data_entry[item].tooltip}">
52-
{$data_entry[item].label}
53-
</span>
52+
{dgettext("loris", $data_entry[item].label)}
53+
</span>
5454
{else}
55-
{$data_entry[item].label}
55+
{dgettext("loris", $data_entry[item].label)}
5656
{/if}
5757
{/if}
5858
</li>
5959
{/section}
6060
</ul>
6161
{if $subtests != ""}
6262
<!-- instrument pages -->
63-
<h3 class="controlPanelSection">Subtests</h3>
63+
<h3 class="controlPanelSection">{dgettext("instruments", "Subtests")}</h3>
6464
<!-- top button -->
6565
{if $subtest != ""}
6666
{assign var=icon value="far fa-file-alt"}
@@ -71,9 +71,9 @@
7171
<li>
7272
<span class="fa-li"><i class="{$icon}" width="12" height="12"></i></span>
7373
{if $subtest != ""}
74-
<a href="{$baseurl}/instruments/{$test_name}/?candID={$candID}&sessionID={$sessionID}&commentID={$commentID}">Top</a>
74+
<a href="{$baseurl}/instruments/{$test_name}/?candID={$candID}&sessionID={$sessionID}&commentID={$commentID}">{dgettext("instruments", "Top")}</a>
7575
{else}
76-
Top
76+
{dgettext("instruments", "Top")}
7777
{/if}
7878
</li>
7979
<!-- subtest buttons -->

0 commit comments

Comments
 (0)