Skip to content

Commit d345aaa

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/angular/compiler-20.3.16
2 parents c3d0118 + a8964fd commit d345aaa

44 files changed

Lines changed: 491088 additions & 106 deletions

Some content is hidden

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

.github/scripts/pull_and_clean_properties.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2+
3+
# ⚠️ DEPRECATED: This script is part of the old .properties translation workflow.
4+
# ⚠️ The project now uses XLIFF files with Transifex instead.
5+
# ⚠️ For the new workflow, see .github/workflows/pull-translations.yml
6+
# ⚠️ This file is kept for reference during the migration period.
7+
28
# Function to process each .properties file
39
process_file() {
410
local file=$1

.github/workflows/format_i18n.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: 'v20.x'
1919
cache: 'yarn'
2020
- run: yarn
21-
- run: yarn build:i18n:generate-testing
21+
- run: yarn build:i18n
2222

2323
- name: add and commit any files that have changed
2424
id: add_and_commit

.github/workflows/pull-and-clean-properties.yml renamed to .github/workflows/pull-translations.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull and clean properties
1+
name: Pull translations from Transifex
22

33
on:
44
workflow_dispatch: {}
@@ -10,11 +10,11 @@ permissions:
1010
pull-requests: write
1111

1212
concurrency:
13-
group: pull-and-clean-${{ github.ref }}
13+
group: pull-translations-${{ github.ref }}
1414
cancel-in-progress: false
1515

1616
jobs:
17-
pull-clean:
17+
pull-translations:
1818
runs-on: ubuntu-latest
1919
env:
2020
TX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}
@@ -40,17 +40,13 @@ jobs:
4040
git config user.name "github-actions[bot]"
4141
git config user.email "github-actions[bot]@users.noreply.github.com"
4242
43-
- name: Install Transifex CLI (Go)
43+
- name: Install Transifex CLI
4444
run: |
4545
curl -sSfL https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
46-
# Move the tx binary into a directory on PATH for subsequent steps
4746
mkdir -p "$HOME/bin"
48-
4947
install -m 0755 ./tx "$HOME/bin/tx"
5048
echo "$HOME/bin" >> "$GITHUB_PATH"
51-
command -v tx || true
52-
tx --version || true
53-
49+
tx --version
5450
5551
- name: Configure Transifex credentials
5652
run: |
@@ -67,15 +63,12 @@ jobs:
6763
chmod 600 "$HOME/.transifexrc"
6864
echo "Created ~/.transifexrc"
6965
70-
- name: Verify Transifex CLI
71-
run: tx --version
72-
7366
- name: Configure Git user
7467
run: |
7568
git config user.name "github-actions[bot]"
7669
git config user.email "github-actions[bot]@users.noreply.github.com"
7770
78-
- name: Prepare transifex branch (hard reset to main)
71+
- name: Prepare transifex branch
7972
id: prep
8073
run: |
8174
set -euo pipefail
@@ -115,11 +108,12 @@ jobs:
115108
git checkout -B transifex origin/main
116109
fi
117110
118-
- name: Make scripts executable
119-
run: chmod +x .github/scripts/pull_and_clean_properties.sh
120-
121-
- name: Run pull_and_clean_properties.sh
122-
run: bash .github/scripts/pull_and_clean_properties.sh
111+
- name: Pull translations from Transifex
112+
run: |
113+
set -euo pipefail
114+
echo "Pulling XLF translation files from Transifex..."
115+
TX_CONFIG=.tx/config tx pull -a -r orcid-angular.messages-xlf --force --minimum-perc=0
116+
echo "Translation pull complete"
123117
124118
- name: Commit and push changes (if any)
125119
id: commit
@@ -131,7 +125,7 @@ jobs:
131125
git checkout transifex
132126
fi
133127
git add -A
134-
git commit -m "Transifex: pull and normalize .properties via CI"
128+
git commit -m "Transifex: pull XLF translations via CI"
135129
git push -f origin transifex
136130
echo "Changes pushed to transifex branch."
137131
echo "changes=true" >> "$GITHUB_OUTPUT"
@@ -236,11 +230,11 @@ jobs:
236230
prevLine = 'Branch was created from main (no previous head).';
237231
}
238232
const body = [
239-
'Automated update of .properties files via CI.',
233+
'Automated update of XLF translation files via CI.',
240234
'',
241235
prevLine
242236
].join('\n');
243-
const created = await github.rest.pulls.create({ owner, repo, head, base, title: 'Transifex: update properties', body });
237+
const created = await github.rest.pulls.create({ owner, repo, head, base, title: 'Transifex: update translations', body });
244238
core.info('Opened PR from transifex to main.');
245239
core.setOutput('pr_state', 'created');
246240
core.setOutput('pr_number', String(created.data.number));

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ temp/**
88
/dist
99
/tmp
1010
/out-tsc
11-
src/locale/messages.xlf
1211

1312
# dependencies
1413
/node_modules
1514

1615
# have a persistent yarn cache in a single 'code' volume in a docker container
1716
/yarn_cache
17+
.yarn-cache
1818

1919
# IDEs and editors
2020
/.idea
@@ -49,7 +49,6 @@ testem.log
4949
Thumbs.db
5050
.vscode/settings.json
5151
src/locale/translate-file-generator.js
52-
*.xlf
5352
src/locale/messages.translation.log.json
5453
sripts/lighthouse/environment.ts.js
5554

.tx/config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
[main]
22
host = https://www.transifex.com
33

4+
[o:orcid-inc-1:p:orcid-angular:r:messages-xlf]
5+
file_filter = src/locale/messages.<lang>.xlf
6+
source_file = src/locale/messages.xlf
7+
source_lang = en
8+
type = XLIFF
9+
minimum_perc = 0
10+
replace_edited_strings = false
11+
keep_translations = false
12+
413
[o:orcid-inc-1:p:orcid-angular:r:environment-banner]
514
file_filter = src/locale/properties/environment-banner/environment-banner.<lang>.properties
615
source_file = src/locale/properties/environment-banner/environment-banner.en.properties

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## v2.128.6 - 2026-01-15
2+
3+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.128.5...v2.128.6)
4+
5+
## v2.128.5 - 2026-01-15
6+
7+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.128.4...v2.128.5)
8+
9+
- [#2717](https://github.com/ORCID/orcid-angular/pull/2717): Lmendoza PD-3909
10+
11+
## v2.128.4 - 2026-01-15
12+
13+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.128.3...v2.128.4)
14+
15+
- [#2713](https://github.com/ORCID/orcid-angular/pull/2713): PD-4733 - Bump @angular/core from 20.1.6 to 20.3.16
16+
117
## v2.128.3 - 2026-01-14
218

319
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.128.2...v2.128.3)

SUPPORTED_BROWSERS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
| ---------------- | --------------- |
77
| Android WebView | 142 or newer |
88
| Apple Safari | 16.4 or newer |
9-
| Google Chrome | 111 or newer |
10-
| Microsoft Edge | 111 or newer |
11-
| Mozilla Firefox | 114 or newer |
12-
| Opera | 97 or newer |
9+
| Google Chrome | 112 or newer |
10+
| Microsoft Edge | 112 or newer |
11+
| Mozilla Firefox | 115 or newer |
12+
| Opera | 98 or newer |
1313
| Opera Mobile | 80 or newer |
14-
| Samsung Internet | 22 or newer |
14+
| Samsung Internet | 23 or newer |

angular.json

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,86 @@
55
"projects": {
66
"ng-orcid": {
77
"i18n": {
8+
"sourceLocale": "en",
89
"locales": {
9-
"en": {
10-
"translation": "src/locale/messages.static.en.xlf",
11-
"baseHref": "/"
12-
},
1310
"fr": {
14-
"translation": "src/locale/messages.static.fr.xlf",
11+
"translation": "src/locale/messages.fr.xlf",
1512
"baseHref": "/"
1613
},
1714
"ar": {
18-
"translation": "src/locale/messages.static.ar.xlf",
15+
"translation": "src/locale/messages.ar.xlf",
1916
"baseHref": "/"
2017
},
2118
"ca": {
22-
"translation": "src/locale/messages.static.ca.xlf",
19+
"translation": "src/locale/messages.ca.xlf",
2320
"baseHref": "/"
2421
},
2522
"cs": {
26-
"translation": "src/locale/messages.static.cs.xlf",
23+
"translation": "src/locale/messages.cs.xlf",
2724
"baseHref": "/"
2825
},
2926
"de": {
30-
"translation": "src/locale/messages.static.de.xlf",
27+
"translation": "src/locale/messages.de.xlf",
3128
"baseHref": "/"
3229
},
3330
"es": {
34-
"translation": "src/locale/messages.static.es.xlf",
31+
"translation": "src/locale/messages.es.xlf",
3532
"baseHref": "/"
3633
},
3734
"it": {
38-
"translation": "src/locale/messages.static.it.xlf",
35+
"translation": "src/locale/messages.it.xlf",
3936
"baseHref": "/"
4037
},
4138
"ja": {
42-
"translation": "src/locale/messages.static.ja.xlf",
39+
"translation": "src/locale/messages.ja.xlf",
4340
"baseHref": "/"
4441
},
4542
"ko": {
46-
"translation": "src/locale/messages.static.ko.xlf",
43+
"translation": "src/locale/messages.ko.xlf",
4744
"baseHref": "/"
4845
},
4946
"lr": {
50-
"translation": "src/locale/messages.static.lr.xlf",
47+
"translation": "src/locale/messages.lr.xlf",
5148
"baseHref": "/"
5249
},
5350
"pl": {
54-
"translation": "src/locale/messages.static.pl.xlf",
51+
"translation": "src/locale/messages.pl_PL.xlf",
5552
"baseHref": "/"
5653
},
5754
"pt": {
58-
"translation": "src/locale/messages.static.pt.xlf",
55+
"translation": "src/locale/messages.pt.xlf",
5956
"baseHref": "/"
6057
},
6158
"rl": {
62-
"translation": "src/locale/messages.static.rl.xlf",
59+
"translation": "src/locale/messages.rl.xlf",
6360
"baseHref": "/"
6461
},
6562
"ru": {
66-
"translation": "src/locale/messages.static.ru.xlf",
63+
"translation": "src/locale/messages.ru.xlf",
6764
"baseHref": "/"
6865
},
6966
"tr": {
70-
"translation": "src/locale/messages.static.tr.xlf",
67+
"translation": "src/locale/messages.tr_TR.xlf",
7168
"baseHref": "/"
7269
},
7370
"uk": {
74-
"translation": "src/locale/messages.static.uk.xlf",
71+
"translation": "src/locale/messages.uk.xlf",
7572
"baseHref": "/"
7673
},
7774
"xx": {
78-
"translation": "src/locale/messages.static.xx.xlf",
75+
"translation": "src/locale/messages.xx.xlf",
7976
"baseHref": "/"
8077
},
8178
"src": {
82-
"translation": "src/locale/messages.static.source.xlf",
79+
"translation": "src/locale/messages.source.xlf",
8380
"baseHref": "/"
8481
},
8582
"zh-CN": {
86-
"translation": "src/locale/messages.static.zh_CN.xlf",
83+
"translation": "src/locale/messages.zh_CN.xlf",
8784
"baseHref": "/"
8885
},
8986
"zh-TW": {
90-
"translation": "src/locale/messages.static.zh_TW.xlf",
87+
"translation": "src/locale/messages.zh_TW.xlf",
9188
"baseHref": "/"
9289
}
9390
}
@@ -112,7 +109,7 @@
112109
"crossOrigin": "use-credentials",
113110
"outputHashing": "all",
114111
"outputPath": "dist",
115-
"i18nMissingTranslation": "error",
112+
"i18nMissingTranslation": "warning",
116113
"assets": [
117114
{
118115
"glob": "**/*",

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
"prebuild": "rimraf dist && yarn build:i18n && yarn build:browserslist && npm run build-runtime-env",
2020
"build": "ng build --configuration production --localize",
2121
"postbuild": "ts-node -P scripts/tsconfig.json scripts/postbuild.ts",
22-
"build:i18n:clone": "ts-node -P scripts/tsconfig.json scripts/properties-clone.postbuild.ts",
23-
"build:i18n:generate-testing": "ts-node -P scripts/tsconfig.json scripts/properties-test-generator.postbuild.ts",
24-
"build:i18n:extract": "ng extract-i18n --format=xlf2 --output-path src/locale",
25-
"build:i18n:generate": "ts-node -P scripts/tsconfig.json scripts/translate-file-generator.prebuild.ts",
26-
"build:i18n": "yarn build:i18n:extract && yarn build:i18n:generate",
22+
"build:i18n:clone": "echo '⚠️ DEPRECATED: Cloning .properties files. This is part of the deprecated .properties workflow.' && ts-node -P scripts/tsconfig.json scripts/properties-clone.postbuild.ts",
23+
"build:i18n:generate-testing": "echo '⚠️ DEPRECATED: Generating test languages from .properties. This is part of the deprecated .properties workflow.' && ts-node -P scripts/tsconfig.json scripts/properties-test-generator.postbuild.ts",
24+
"build:i18n:extract": "ng extract-i18n --format=xlf --output-path src/locale --out-file messages.xlf && tsx scripts/normalize-xlf.prebuild.ts",
25+
"build:i18n:generate": "echo '⚠️ DEPRECATED: Generating XLF from .properties files. Use Transifex for translations instead.' && ts-node -P scripts/tsconfig.json scripts/translate-file-generator.prebuild.ts",
26+
"build:i18n": "yarn build:i18n:extract",
27+
"build-with-properties": "echo '⚠️ DEPRECATED: This build regenerates XLF files from .properties (deprecated workflow). Prefer using tx pull to get translations from Transifex.' && rimraf dist && yarn build:i18n:extract && yarn build:i18n:generate && yarn build:browserslist && npm run build-runtime-env && ng build --configuration production --localize && npm run postbuild",
2728
"build:prod": "yarn build",
2829
"build:sandbox": "yarn build",
2930
"build:qa": "yarn build",
@@ -45,8 +46,8 @@
4546
"@angular/animations": "^20.1.6",
4647
"@angular/cdk": "^20.1.5",
4748
"@angular/common": "^20.1.6",
48-
"@angular/compiler": "^20.3.16",
49-
"@angular/core": "^20.1.6",
49+
"@angular/compiler": "^20.1.6",
50+
"@angular/core": "^20.3.16",
5051
"@angular/elements": "20.1.6",
5152
"@angular/forms": "^20.1.6",
5253
"@angular/localize": "^20.1.6",

scripts/normalize-xlf.prebuild.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import * as fs from 'fs'
2+
import { parseString, Builder } from 'xml2js'
3+
4+
function normalizeText(input: string): string {
5+
return input
6+
.replace(/\r/g, '')
7+
.replace(/\n/g, ' ')
8+
.replace(/\s\s+/g, ' ')
9+
.trim()
10+
}
11+
12+
function normalizeXlf12Sources(path: string) {
13+
const xml = fs.readFileSync(path, 'utf8')
14+
parseString(xml, (error, data) => {
15+
if (error) {
16+
throw error
17+
}
18+
19+
const fileNode = data?.xliff?.file?.[0]
20+
const transUnits = fileNode?.body?.[0]?.['trans-unit']
21+
22+
if (!Array.isArray(transUnits)) {
23+
throw new Error('No trans-units found in XLF 1.2 file')
24+
}
25+
26+
transUnits.forEach((tu) => {
27+
// Provide a stable key for Transifex (some parsers rely on resname over id/source)
28+
if (tu?.$?.id) {
29+
tu.$.resname = tu.$.id
30+
}
31+
const src = tu?.source?.[0]
32+
if (typeof src === 'string') {
33+
tu.source[0] = normalizeText(src)
34+
}
35+
})
36+
37+
const builder = new Builder()
38+
let out = builder.buildObject(data)
39+
// Match tx pull header formatting (xml decl + <xliff ...> on same line)
40+
out = out.replace(
41+
/<xliff[^>]*>/,
42+
'<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">'
43+
)
44+
out = out.replace(/^<\?xml[^>]*\?>/, '<?xml version="1.0" ?>')
45+
out = out.replace(
46+
/^<\?xml version="1\.0" \?>\s*\n\s*<xliff/,
47+
'<?xml version="1.0" ?><xliff'
48+
)
49+
fs.writeFileSync(path, out, { encoding: 'utf8' })
50+
})
51+
}
52+
53+
normalizeXlf12Sources('./src/locale/messages.xlf')

0 commit comments

Comments
 (0)