-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
150 lines (141 loc) · 9.91 KB
/
Copy pathapp.js
File metadata and controls
150 lines (141 loc) · 9.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
const translations = {
zh: {
page_home: "WWDC Pioneer | 主页",
page_activities: "WWDC Pioneer | 活动",
page_contact: "WWDC Pioneer | 联系",
nav_home: "主页",
nav_activities: "活动",
nav_contact: "联系",
join_cta: "加入社区",
badge: "APPLE DEVELOPER RECOMMEND",
footer: "© 2026 WWDC Pioneer. 本活动为第三方社区组织,与 Apple Inc. 无官方关联。",
home_title: "为年轻开发者和爱好者准备",
home_copy: `
<p>WWDC Pioneer 是首个被 Apple Developer 官方推荐的中国 WWDC 在线社区。</p>
<p>我们相信在线社区能够扩展可及性,让不同地域的开发者都有机会与顶级 Apple 开发者交流。</p>
<p>今年的 WWDC Pioneer 希望帮助所有年轻开发者和爱好者。</p>
<p>无论你还没有接触过 SwiftUI、亦或是正在准备参加 Swift Student Challenge,或是已经发布了自己的 App,这里都有适合你的讨论空间和志同道合的朋友。</p>
<p>在这里,我们不限于文字讨论,更会开展一系列的社群分享,邀请到 Swift Student Challenge 的获奖者、Apple Developer 计划的活跃成员,以及各路技术大咖,带来第一手的 WWDC 解读和技术交流。</p>
`,
primary_cta: "查看活动",
secondary_cta: "联系组织者",
community_title: "选择适合你的社区",
community_copy: "每年的 WWDC 都会带来大量新技术和新产品,吸引了不同兴趣和需求的开发者与爱好者参与讨论,我们希望技术深聊与兴趣共鸣都能拥有各自舞台:开发者可以高密度交流实战问题,爱好者也能轻松参与 Apple 生态讨论,我们希望每个人都能找到合适的社区,去讨论如何利用 Apple 的新产品、新技术去实现自己的创意。",
dev_title: "Pioneer.DeveloperScene",
dev_desc: "适合 SwiftUI、Framework、架构、性能优化、App 发布和 WWDC 技术解读。",
fans_title: "Pioneer.FansScene",
fans_desc: "适合新品体验、系统尝鲜、创意玩法、活动共看和 Apple 生态分享。",
news_title: "活动资讯",
news_wwdc26_title: "与 WWDC 26 同频",
news_wwdc26_copy: `
<p>今年,WWDC Pioneer 面向年轻开发者和爱好者开放。无论是刚接触 SwiftUI、准备参加 Swift Student Challenge,还是 App 构建者,都可以在这里找到交流空间和同好。</p>
<p>除了文字讨论,社区还会组织系列分享,邀请 Swift Student Challenge 获奖者、Apple Developer 计划活跃成员及技术嘉宾,带来 WWDC 解读与技术交流。</p>
<p>在去年的 WWDC 25 期间,WWDC Pioneer 第一次作为 Apple Developer 官方推荐社区,在 WWDC 25 后举办了小范围的交流活动。</p>
<p>在今年,我们正在邀请更多 Swift Student Challenge 获奖者、独立开发者,围绕 WWDC26 的各个方向展开深度交流。</p>
`,
news_wwdc25_title: "回顾 WWDC 25",
news_wwdc25_copy: `
<p>在 WWDC25 期间,社区反馈超出预期,近 800 人表达了参与意愿,113 位参与者加入了线上研讨。</p>
<p>WWDC25 后,我们还举办了 Workshop: 25.Recap,社区成员围绕 Liquid Glass 设计语言、SwiftUI 性能提升及其他重磅更新展开了热烈讨论。</p>
`,
metric_interest: "参与意愿",
metric_session: "线上研讨",
activities_kicker: "活动页面",
activities_title: "活动列表",
activities_copy: "当前活动列表页面正在搭建中,后续会发布详细日程与报名入口。",
activities_pending: "正在准备……",
contact_kicker: "联系我们",
contact_title: "让我们在WWDC Pioneer中相遇",
contact_copy: "想加入社区、报名分享、共办活动或咨询合作,都可以直接联系",
contact_card_title: "联系方式",
contact_card_copy: "欢迎通过以下方式联系",
wechat: "微信:",
email: "邮箱:",
qr_title: "扫码加入",
qr_desc: "用微信扫描二维码,进入 WWDC Pioneer 社区入口。"
},
en: {
page_home: "WWDC Pioneer | Home",
page_activities: "WWDC Pioneer | Activities",
page_contact: "WWDC Pioneer | Contact",
nav_home: "Home",
nav_activities: "Activities",
nav_contact: "Contact",
join_cta: "Join",
badge: "APPLE DEVELOPER RECOMMEND",
footer: "© 2026 WWDC Pioneer. This is a third-party community event and is not affiliated with Apple Inc.",
home_title: "Built for young developers and Apple enthusiasts",
home_copy: `
<p>WWDC Pioneer is the first China-based WWDC online community recommended by Apple Developer.</p>
<p>We believe online communities expand access, giving developers across regions more opportunities to exchange ideas with experienced Apple developers.</p>
<p>This year, WWDC Pioneer is here for young developers and enthusiasts.</p>
<p>Whether you are new to SwiftUI, preparing for Swift Student Challenge, or already shipping your own app, you can find the right discussion space and aligned friends here.</p>
<p>Beyond text discussions, we will host a series of community talks with Swift Student Challenge winners, active Apple Developer Program members, and technical guests for first-hand WWDC interpretation and technical exchange.</p>
`,
primary_cta: "View activities",
secondary_cta: "Contact host",
community_title: "Choose the right community for you",
community_copy: "Each WWDC brings new technologies and products, drawing developers and enthusiasts with different interests into the conversation. We want technical deep dives and shared enthusiasm to each have their own stage: developers can discuss practical problems at high density, Apple fans can join ecosystem conversations more easily, and everyone can find the right community to explore how Apple's new products and technologies can bring their ideas to life.",
dev_title: "Pioneer.DeveloperScene",
dev_desc: "For SwiftUI, frameworks, architecture, performance, app releases, and WWDC technical interpretation.",
fans_title: "Pioneer.FansScene",
fans_desc: "For new product experiences, system previews, creative play, watch parties, and Apple ecosystem sharing.",
news_title: "Activity updates",
news_wwdc26_title: "In sync with WWDC 26",
news_wwdc26_copy: `
<p>This year, WWDC Pioneer opens to young developers and Apple enthusiasts. Whether you are learning SwiftUI, preparing for Swift Student Challenge, or building apps, you can find peers and conversation here.</p>
<p>Alongside text discussion, the community will organize talk series with Swift Student Challenge winners, active Apple Developer Program members, and technical guests.</p>
<p>During WWDC 25 last year, WWDC Pioneer first appeared as an Apple Developer recommended community and hosted a small-scale exchange after WWDC 25.</p>
<p>We are inviting more winners and independent developers to host deep conversations around WWDC26 topics.</p>
`,
news_wwdc25_title: "Looking back at WWDC 25",
news_wwdc25_copy: `
<p>During WWDC25, community response exceeded expectations. Nearly 800 people expressed interest, and 113 participants joined the online session.</p>
<p>After WWDC25, Workshop: 25.Recap continued the conversation around Liquid Glass, SwiftUI performance improvements, and other major updates.</p>
`,
metric_interest: "interested",
metric_session: "online session",
activities_kicker: "Activities",
activities_title: "Activity list",
activities_copy: "The activity list is being built. Detailed schedules and registration links will be published later.",
activities_pending: "Preparing...",
contact_kicker: "Contact us",
contact_title: "Meet us through WWDC Pioneer",
contact_copy: "Join the community, propose a talk, co-host an activity, or ask about collaboration.",
contact_card_title: "Contact",
contact_card_copy: "Reach us through the following channels",
wechat: "WeChat:",
email: "Email:",
qr_title: "Scan to join",
qr_desc: "Scan with WeChat to enter the WWDC Pioneer community gateway."
}
};
const languageToggle = document.getElementById("language-toggle");
const languageLabel = document.querySelector("[data-language-label]");
function setLanguage(language) {
const lang = language === "en" ? "en" : "zh";
const dict = translations[lang];
const page = document.body.dataset.page;
document.documentElement.lang = lang === "en" ? "en" : "zh-CN";
if (page && dict[`page_${page}`]) {
document.title = dict[`page_${page}`];
}
document.querySelectorAll("[data-i18n]").forEach((node) => {
const key = node.getAttribute("data-i18n");
if (dict[key]) node.textContent = dict[key];
});
document.querySelectorAll("[data-i18n-html]").forEach((node) => {
const key = node.getAttribute("data-i18n-html");
if (dict[key]) node.innerHTML = dict[key];
});
if (languageToggle) {
if (languageLabel) languageLabel.textContent = lang === "zh" ? "中文" : "EN";
languageToggle.setAttribute("aria-label", lang === "zh" ? "Switch to English" : "切换到中文");
}
localStorage.setItem("wwdcpioneer_language", lang);
}
languageToggle?.addEventListener("click", () => {
const currentLanguage = localStorage.getItem("wwdcpioneer_language") === "en" ? "en" : "zh";
setLanguage(currentLanguage === "en" ? "zh" : "en");
});
setLanguage(localStorage.getItem("wwdcpioneer_language") === "en" ? "en" : "zh");