Skip to content

Commit ebd15eb

Browse files
authored
Merge branch 'main' into settings-component
2 parents 63855be + 7d7f0f5 commit ebd15eb

File tree

1,043 files changed

+4035
-665
lines changed

Some content is hidden

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

1,043 files changed

+4035
-665
lines changed

.github/actions/translation-tracker/index.js

Lines changed: 242 additions & 186 deletions
Large diffs are not rendered by default.

.github/actions/translation-tracker/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"dependencies": {
2323
"@actions/core": "^1.10.0",
2424
"@actions/github": "^5.1.1",
25-
"@octokit/rest": "^19.0.5"
25+
"@octokit/rest": "^19.0.5",
26+
"js-yaml": "^4.1.0"
2627
}
27-
}
28+
}

.github/workflows/translation-sync.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@ name: Translation Sync Tracker
22

33
on:
44
push:
5-
branches: [staging]
5+
branches: [main]
66
paths:
77
- 'src/content/examples/en/**'
8+
- 'src/content/reference/en/**'
9+
- 'src/content/tutorials/en/**'
10+
- 'src/content/text-detail/en/**'
11+
- 'src/content/events/en/**'
12+
- 'src/content/libraries/en/**'
13+
pull_request:
14+
branches: [main]
15+
paths:
16+
- 'src/content/examples/en/**'
17+
- 'src/content/reference/en/**'
18+
- 'src/content/tutorials/en/**'
19+
- 'src/content/text-detail/en/**'
20+
- 'src/content/events/en/**'
21+
- 'src/content/libraries/en/**'
822
workflow_dispatch:
923

1024
jobs:
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
interface Props {
3+
englishUrl?: string;
4+
contributeUrl?: string;
5+
title?: string;
6+
message?: string;
7+
locale?: string;
8+
}
9+
10+
const {
11+
englishUrl = '/en',
12+
contributeUrl = 'https://github.com/processing/p5.js-website/tree/main?tab=readme-ov-file#content-changes',
13+
title,
14+
message,
15+
locale = 'en',
16+
} = Astro.props as Props;
17+
18+
const copyByLocale: Record<string, { title: string; message: string; viewEnglish: string; contribute: string; }> = {
19+
'hi': {
20+
title: 'यह अनुवाद पुराना हो सकता है',
21+
message: 'यह पृष्ठ अंग्रेज़ी संस्करण की तुलना में अद्यतन नहीं है।',
22+
viewEnglish: 'अंग्रेज़ी संस्करण देखें',
23+
contribute: 'अनुवाद में योगदान दें',
24+
},
25+
'es': {
26+
title: 'Esta traducción podría estar desactualizada',
27+
message: 'Esta página no está actualizada en comparación con la versión en inglés.',
28+
viewEnglish: 'Ver versión en inglés',
29+
contribute: 'Contribuir a la traducción',
30+
},
31+
'ko': {
32+
title: '이 번역은 오래되었을 수 있습니다',
33+
message: '이 페이지는 영어 버전과 비교하여 최신 상태가 아닙니다.',
34+
viewEnglish: '영어 페이지 보기',
35+
contribute: '번역에 기여하기',
36+
},
37+
'zh-Hans': {
38+
title: '此翻译可能已过期',
39+
message: '与英文版本相比,此页面不是最新的。',
40+
viewEnglish: '查看英文页面',
41+
contribute: '参与翻译',
42+
},
43+
};
44+
45+
const fallback = {
46+
title: 'This translation might be outdated',
47+
message: 'This page is not updated compared to the English version.',
48+
viewEnglish: 'View English page',
49+
contribute: 'Contribute to translation',
50+
};
51+
52+
const copy = copyByLocale[locale] || fallback;
53+
const resolvedTitle = title ?? copy.title;
54+
const resolvedMessage = message ?? copy.message;
55+
---
56+
57+
<section class="outdated-banner" role="status" aria-live="polite">
58+
<div class="icon" aria-hidden="true">⚠️</div>
59+
<div class="content">
60+
<div class="title">{resolvedTitle}</div>
61+
<p class="desc">
62+
{resolvedMessage}
63+
<a class="link" href={englishUrl}>{copy.viewEnglish}</a>
64+
·
65+
<a class="link" href={contributeUrl} target="_blank" rel="noopener noreferrer">{copy.contribute}</a>
66+
</p>
67+
</div>
68+
69+
<style>
70+
.outdated-banner {
71+
display: flex;
72+
align-items: flex-start;
73+
gap: 16px;
74+
padding: 16px 20px;
75+
border-radius: 12px;
76+
background: #d8f532;
77+
color: #000;
78+
margin: 16px 0 24px;
79+
}
80+
.icon { font-size: 22px; line-height: 1; margin-top: 2px; }
81+
.content { flex: 1; }
82+
.title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
83+
.desc { margin: 0; font-size: 14px; }
84+
.link { color: inherit; font-weight: 700; text-underline-offset: 2px; }
85+
.link:hover { text-decoration: underline; }
86+
</style>
87+
</section>
88+

src/content/examples/en/01_Shapes_And_Color/00_Shape_Primitives/description.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ primitive functions
1717
<a href="https://p5js.org/reference/p5/arc" target="_blank">arc()</a>,
1818
<a href="https://p5js.org/reference/p5/line" target="_blank">line()</a>,
1919
<a href="https://p5js.org/reference/p5/triangle" target="_blank">triangle()</a>,
20-
and <a href="https://p5js.org/reference/p5/quad" target="_blank">quad()</a>.
20+
and <a href="https://p5js.org/reference/p5/quad" target="_blank">quad()</a>.

src/content/reference/en/p5.Amplitude/getLevel.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# This file was auto-generated. Please do not edit it manually!
3+
# To make changes, edit the comments in the corresponding source file:
4+
# https://github.com/processing/p5.js/blob/v1.11.10/lib/addons/p5.sound.js#L3209
25
title: getLevel
36
module: p5.sound
47
submodule: p5.sound

src/content/reference/en/p5.Amplitude/setInput.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# This file was auto-generated. Please do not edit it manually!
3+
# To make changes, edit the comments in the corresponding source file:
4+
# https://github.com/processing/p5.js/blob/v1.11.10/lib/addons/p5.sound.js#L3117
25
title: setInput
36
module: p5.sound
47
submodule: p5.sound

src/content/reference/en/p5.Amplitude/smooth.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# This file was auto-generated. Please do not edit it manually!
3+
# To make changes, edit the comments in the corresponding source file:
4+
# https://github.com/processing/p5.js/blob/v1.11.10/lib/addons/p5.sound.js#L3293
25
title: smooth
36
module: p5.sound
47
submodule: p5.sound

src/content/reference/en/p5.Amplitude/toggleNormalize.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# This file was auto-generated. Please do not edit it manually!
3+
# To make changes, edit the comments in the corresponding source file:
4+
# https://github.com/processing/p5.js/blob/v1.11.10/lib/addons/p5.sound.js#L3264
25
title: toggleNormalize
36
module: p5.sound
47
submodule: p5.sound

src/content/reference/en/p5.AudioIn/amp.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# This file was auto-generated. Please do not edit it manually!
3+
# To make changes, edit the comments in the corresponding source file:
4+
# https://github.com/processing/p5.js/blob/v1.11.10/lib/addons/p5.sound.js#L6257
25
title: amp
36
module: p5.sound
47
submodule: p5.sound

0 commit comments

Comments
 (0)