Skip to content

Commit 369dd6d

Browse files
authored
Merge branch 'main' into fix/docker-build-projects-dir-missing
2 parents 7b45c92 + a1b84f9 commit 369dd6d

141 files changed

Lines changed: 19776 additions & 4989 deletions

File tree

Some content is hidden

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

‎CHANGELOG.md‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
1+
## v3.23.1 - 2026-09-18
2+
3+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.23.0...v3.23.1)
4+
5+
## v3.23.0 - 2026-09-18
6+
7+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.23...v3.23.0)
8+
9+
## v3.0.23 - 2026-09-14
10+
11+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.22...v3.0.23)
12+
13+
## v3.0.22 - 2026-09-07
14+
15+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.21...v3.0.22)
16+
17+
- [#2925](https://github.com/ORCID/orcid-angular/pull/2925): PD-13050 don't show the affiliation interstitial without a matching ROR
18+
19+
## v3.0.21 - 2026-09-07
20+
21+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.20...v3.0.21)
22+
23+
## v3.0.20 - 2026-09-03
24+
25+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.19...v3.0.20)
26+
27+
## v3.0.19 - 2026-09-03
28+
29+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.18...v3.0.19)
30+
31+
## v3.0.18 - 2026-09-03
32+
33+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.17...v3.0.18)
34+
35+
## v3.0.17 - 2026-08-31
36+
37+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.16...v3.0.17)
38+
39+
## v3.0.16 - 2026-08-27
40+
41+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.15...v3.0.16)
42+
43+
## v3.0.15 - 2026-08-27
44+
45+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.14...v3.0.15)
46+
47+
## v3.0.14 - 2026-08-27
48+
49+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.13...v3.0.14)
50+
51+
## v3.0.13 - 2026-08-27
52+
53+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.12...v3.0.13)
54+
55+
## v3.0.12 - 2026-08-21
56+
57+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.11...v3.0.12)
58+
59+
- [#2907](https://github.com/ORCID/orcid-angular/pull/2907): PD-5900
60+
61+
## v3.0.11 - 2026-08-18
62+
63+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.10...v3.0.11)
64+
65+
## v3.0.10 - 2026-08-18
66+
67+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.9...v3.0.10)
68+
69+
## v3.0.9 - 2026-08-18
70+
71+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.8...v3.0.9)
72+
73+
## v3.0.8 - 2026-08-18
74+
75+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.7...v3.0.8)
76+
77+
## v3.0.7 - 2026-08-18
78+
79+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.6...v3.0.7)
80+
181
## v3.0.6 - 2026-08-12
282

383
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v3.0.5...v3.0.6)

‎scripts/normalize-xlf.prebuild.ts‎

Lines changed: 119 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,35 @@ const TEST_LANGUAGES = [
1515
// hardcoded list to drift out of sync.
1616
const PRINT_VIEW_SOURCE_FILE = './src/assets/print-view/fetch-orcid.js'
1717

18+
// Sentinels used to carry XLIFF <x/> placeholder elements through the xml2js
19+
// Builder, which escapes any markup it finds in a text node. We emit the
20+
// sentinels as plain text and swap them for real elements in formatXmlOutput().
21+
const PH_START = '@@XPH_START@@'
22+
const PH_MID = '@@XPH_MID@@'
23+
const PH_END = '@@XPH_END@@'
24+
25+
// Matches a $localize template placeholder: `${expression}:NAME:`.
26+
// NAME deliberately accepts any case: fetch-orcid.js uses camelCase names, and
27+
// $localize matches placeholder names verbatim.
28+
const LOCALIZE_PLACEHOLDER_RE = /\$\{([^}]*)\}:([A-Za-z0-9_]+):/g
29+
30+
// Non-global twin of the above, for stateless `.test()` checks (a shared /g
31+
// regex carries lastIndex between calls).
32+
const HAS_LOCALIZE_PLACEHOLDER_RE = new RegExp(LOCALIZE_PLACEHOLDER_RE.source)
33+
1834
interface PrintViewUnit {
1935
id: string
2036
source: string
2137
}
2238

39+
function escapeXmlAttr(value: string): string {
40+
return value
41+
.replace(/&/g, '&amp;')
42+
.replace(/</g, '&lt;')
43+
.replace(/>/g, '&gt;')
44+
.replace(/"/g, '&quot;')
45+
}
46+
2347
function parsePrintViewUnits(path: string): PrintViewUnit[] {
2448
const js = fs.readFileSync(path, 'utf8')
2549
// Matches $localize tagged templates of the form `:@@printView.someId:Source text`
@@ -33,11 +57,18 @@ function parsePrintViewUnits(path: string): PrintViewUnit[] {
3357
continue
3458
}
3559
seen.add(id)
36-
// Convert $localize template placeholders `${expression}:NAME:` into the
37-
// canonical $localize message form `{$NAME}` so the XLF source matches the
38-
// runtime message and stays stable regardless of the JS expression.
60+
// Convert $localize template placeholders `${expression}:NAME:` into XLIFF
61+
// <x id="NAME"/> elements (emitted as sentinels here, see formatXmlOutput).
62+
// Plain-text forms such as `{$NAME}` do NOT work: Xliff1TranslationParser
63+
// only recognises real <x/> elements, so a text placeholder is parsed as
64+
// literal content and the message ends up with zero placeholders — the
65+
// translation is then silently truncated at the first `$`.
3966
const source = normalizeText(
40-
rawSource.replace(/\$\{[^}]*\}:([A-Z0-9_]+):/g, '{$$$1}')
67+
rawSource.replace(
68+
LOCALIZE_PLACEHOLDER_RE,
69+
(_match, expression: string, name: string) =>
70+
`${PH_START}${name}${PH_MID}\${${expression}}${PH_END}`
71+
)
4172
)
4273
units.push({ id, source })
4374
}
@@ -54,6 +85,13 @@ function normalizeText(input: string): string {
5485

5586
function formatXmlOutput(xml: string): string {
5687
let out = xml
88+
// Restore XLIFF placeholder elements that were emitted as sentinels so the
89+
// xml2js Builder would not escape them into plain text.
90+
out = out.replace(
91+
new RegExp(`${PH_START}(.*?)${PH_MID}(.*?)${PH_END}`, 'g'),
92+
(_match, name: string, equivText: string) =>
93+
`<x id="${name}" equiv-text="${escapeXmlAttr(equivText)}"/>`
94+
)
5795
// Match tx pull header formatting (xml decl + <xliff ...> on same line)
5896
out = out.replace(
5997
/<xliff[^>]*>/,
@@ -97,6 +135,69 @@ function generateTestingLanguages(baseData: any) {
97135
})
98136
}
99137

138+
/** Extracts the ordered <x id="..."/> names inside an XLF element body. */
139+
function placeholderIds(fragment: string): string[] {
140+
return Array.from(fragment.matchAll(/<x\s+id="([^"]+)"/g)).map((m) => m[1])
141+
}
142+
143+
/**
144+
* Warns when a translated printView.* target has lost one of the placeholders
145+
* its source declares.
146+
*
147+
* Such a target still inlines cleanly — @angular/localize reports no error — but
148+
* renders with the value silently dropped, e.g. a peer review count vanishing
149+
* from the heading. That silence is what let this class of bug ship before, so
150+
* surface it at build time. Read-only: translations are never rewritten here.
151+
*/
152+
function checkLocalePlaceholders(localeDir: string) {
153+
const files = fs
154+
.readdirSync(localeDir)
155+
.filter((name) => name.startsWith('messages.') && name.endsWith('.xlf'))
156+
// The generated test languages replace every target with a marker, so their
157+
// placeholders are legitimately absent.
158+
.filter(
159+
(name) =>
160+
!TEST_LANGUAGES.some(({ code }) => name === `messages.${code}.xlf`)
161+
)
162+
163+
files.forEach((name) => {
164+
const xlf = fs.readFileSync(`${localeDir}/${name}`, 'utf8')
165+
166+
// Transifex holds the <x/> form of these strings, so a pull should never
167+
// bring back the legacy `${expression}:name:` text. If it does, the source
168+
// there has gone stale and every locale would render the heading truncated
169+
// at the first `$` with no other symptom — fail rather than ship that.
170+
if (HAS_LOCALIZE_PLACEHOLDER_RE.test(xlf)) {
171+
throw new Error(
172+
`[normalize-xlf] ${name} contains legacy raw placeholder syntax ` +
173+
`(\${expression}:name:). Push the current messages.xlf to Transifex ` +
174+
`so translations come back with <x id="..."/> placeholders.`
175+
)
176+
}
177+
178+
Array.from(
179+
xlf.matchAll(/<trans-unit id="(printView\.[^"]*)"[\s\S]*?<\/trans-unit>/g)
180+
).forEach(([unit, id]) => {
181+
const target = unit.match(/<target[^>]*>([\s\S]*?)<\/target>/)
182+
if (!target) {
183+
return
184+
}
185+
const expected = placeholderIds(
186+
unit.match(/<source[^>]*>([\s\S]*?)<\/source>/)?.[1] ?? ''
187+
)
188+
const actual = placeholderIds(target[1])
189+
const missing = expected.filter((p) => !actual.includes(p))
190+
if (missing.length) {
191+
console.warn(
192+
`[normalize-xlf] ${name}: "${id}" target is missing placeholder(s) ${missing.join(
193+
', '
194+
)} — their values will be dropped from the rendered string.`
195+
)
196+
}
197+
})
198+
})
199+
}
200+
100201
function normalizeXlf12Sources(path: string) {
101202
const xml = fs.readFileSync(path, 'utf8')
102203
parseString(xml, (error, data) => {
@@ -111,11 +212,24 @@ function normalizeXlf12Sources(path: string) {
111212
throw new Error('No trans-units found in XLF 1.2 file')
112213
}
113214

215+
const printViewUnits = parsePrintViewUnits(PRINT_VIEW_SOURCE_FILE)
216+
const printViewById = new Map(printViewUnits.map((u) => [u.id, u]))
217+
114218
transUnits.forEach((tu) => {
115219
// Provide a stable key for Transifex (some parsers rely on resname over id/source)
116220
if (tu?.$?.id) {
117221
tu.$.resname = tu.$.id
118222
}
223+
const generated = tu?.$?.id ? printViewById.get(tu.$.id) : undefined
224+
if (generated) {
225+
// fetch-orcid.js is the source of truth for printView.* units, so
226+
// always regenerate the source rather than keeping what is on disk.
227+
// Re-parsing a unit that already contains <x/> elements yields mixed
228+
// content, which the Builder cannot round-trip; replacing the whole
229+
// node with a freshly built string keeps placeholders correct.
230+
tu.source = [generated.source]
231+
return
232+
}
119233
const src = tu?.source?.[0]
120234
if (typeof src === 'string') {
121235
tu.source[0] = normalizeText(src)
@@ -127,7 +241,6 @@ function normalizeXlf12Sources(path: string) {
127241
// will also stamp X / LR / RL for these strings, and so Transifex can
128242
// discover them for real locales. We use a stable @@-prefixed id so
129243
// $localize can match by explicit id.
130-
const printViewUnits = parsePrintViewUnits(PRINT_VIEW_SOURCE_FILE)
131244
const existingIds = new Set(transUnits.map((tu: any) => tu?.$?.id))
132245
const printViewBody = fileNode?.body?.[0]
133246
printViewUnits.forEach(({ id, source }) => {
@@ -145,3 +258,4 @@ function normalizeXlf12Sources(path: string) {
145258
}
146259

147260
normalizeXlf12Sources('./src/locale/messages.xlf')
261+
checkLocalePlaceholders('./src/locale')

‎src/app/app-routing.module.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,20 @@ const routes: Routes = [
174174
loadChildren: () =>
175175
import('./sms-poc/sms-poc.module').then((m) => m.SmsPocModule),
176176
},
177+
{
178+
// Legacy URL kept alive: the reverse proxy deliberately excludes it from the
179+
// /about redirect to the info site.
180+
path: ApplicationRoutes.recordCorrectionsLegacy,
181+
redirectTo: '/' + ApplicationRoutes.recordCorrections,
182+
pathMatch: 'full',
183+
},
184+
{
185+
path: ApplicationRoutes.recordCorrections,
186+
loadChildren: () =>
187+
import('./record-corrections/record-corrections.module').then(
188+
(m) => m.RecordCorrectionsModule
189+
),
190+
},
177191
{
178192
path: '404',
179193
loadChildren: () =>

0 commit comments

Comments
 (0)