Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat(site): Show the share card in the page's language when a link is shared

wquguru10cad54b313d
diff --git a/scripts/site-images.sh b/scripts/site-images.sh
index 246c09d..83bf85a 100755
--- a/scripts/site-images.sh
+++ b/scripts/site-images.sh
@@ -1,5 +1,6 @@
#!/bin/bash
-# Renders the website's raster images with Chrome: site/og.png (share card, from scripts/site-og.html)
+# Renders the website's raster images with Chrome: the share cards site/og.png (Chinese) and
+# site/og-{en,ja,ko}.png from scripts/site-og.html?lang=…,
# and site/icon.png (512 px, from site/icon.svg). Rerun after changing either source; commit the PNGs.
set -euo pipefail
cd "$(dirname "$0")/.."
@@ -7,9 +8,13 @@ CHROME="${CHROME:-/Applications/Google Chrome.app/Contents/MacOS/Google Chrome}"
[ -x "$CHROME" ] || { echo "needs Google Chrome (set CHROME=…)" >&2; exit 1; }
# Chrome often exits non-zero after writing the screenshot (display-link errors when headless); check the file instead.
shot() { rm -f "$3"; "$CHROME" --headless=new --disable-gpu --hide-scrollbars --force-device-scale-factor=1 "${@:4}" \
- --window-size="$2" --screenshot="$PWD/$3" "file://$PWD/$1" >/dev/null 2>&1 || true; [ -s "$3" ] || { echo "Chrome wrote no $3" >&2; exit 1; }; }
-shot scripts/site-og.html 1200,630 site/og.png
+ --window-size="$2" --screenshot="$PWD/$3" "file://$PWD/$1${QUERY:-}" >/dev/null 2>&1 || true; [ -s "$3" ] || { echo "Chrome wrote no $3" >&2; exit 1; }; }
+# The budget lets the web fonts load before the screenshot.
+for lang in zh en ja ko; do
+ out=site/og.png; [ "$lang" = zh ] || out=site/og-$lang.png
+ QUERY="?lang=$lang" shot scripts/site-og.html 1200,630 "$out" --virtual-time-budget=5000
+done
printf '<html><body style="margin:0"><img src="../site/icon.svg" width="512" height="512"></body></html>' > scripts/.icon.html
shot scripts/.icon.html 512,512 site/icon.png --default-background-color=00000000
rm -f scripts/.icon.html
-echo "wrote site/og.png site/icon.png"
+echo "wrote site/og.png site/og-{en,ja,ko}.png site/icon.png"
diff --git a/scripts/site-og.html b/scripts/site-og.html
index 92f2110..c75885a 100644
--- a/scripts/site-og.html
+++ b/scripts/site-og.html
@@ -1,37 +1,98 @@
<!doctype html>
-<!-- The website's share card (site/og.png, 1200×630). Rendered by scripts/site-images.sh. -->
+<!-- The website's share cards, 1200×630: site-og.html?lang=zh → site/og.png, ?lang=en|ja|ko → site/og-<lang>.png.
+ Rendered by scripts/site-images.sh. The right half shows what the app does (notes + a subtitle) rather than
+ leaving room empty; its wording follows the app's own UI strings in Resources/<lang>.lproj. -->
<html lang="zh-CN">
<head>
<meta charset="utf-8">
-<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&amp;family=Noto+Sans+SC:wght@500;700;900&amp;display=swap">
+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&amp;family=Noto+Sans+SC:wght@500;700;900&amp;family=Noto+Sans+JP:wght@500;700;900&amp;family=Noto+Sans+KR:wght@500;700;900&amp;display=swap">
<style>
html, body { margin: 0; }
-.card { width: 1200px; height: 630px; box-sizing: border-box; padding: 64px 72px; background: #F6F7F9; font-family: Inter, "Noto Sans SC", "PingFang SC", sans-serif; color: #15171C; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
+body { word-break: keep-all; } /* Korean wraps at spaces, not mid-word */
+.card { width: 1200px; height: 630px; box-sizing: border-box; padding: 64px 72px 72px; background: #F3F4F6; font-family: Inter, var(--cjk), sans-serif; color: #15171C; display: flex; gap: 40px; position: relative; overflow: hidden; }
+.left { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.top { display: flex; align-items: center; gap: 16px; }
-.top img { width: 64px; height: 64px; border-radius: 15px; }
-.name { font-size: 40px; font-weight: 900; }
-.en { font-size: 26px; font-weight: 700; color: #5A5F6B; }
-.pill { margin-left: auto; padding: 8px 14px; border-radius: 999px; background: #FFFFFF; border: 1px solid #E4E6EA; font-size: 17px; font-weight: 600; color: #5A5F6B; }
-.slogan { font-size: 72px; line-height: 1.1; font-weight: 900; letter-spacing: -0.03em; }
-.sub { margin-top: 14px; font-size: 26px; font-weight: 600; color: #3B3F48; }
-.bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
-.bar { padding: 16px 24px; border-radius: 18px; background: #15171C; color: #FFFFFF; min-width: 520px; }
-.bar .s { display: flex; align-items: center; gap: 10px; font-size: 17px; color: #A9AEB8; }
-.bar .s i { width: 9px; height: 9px; border-radius: 50%; background: #E8552B; }
-.bar .t { margin-top: 6px; font-size: 28px; font-weight: 700; }
-.apps { font-size: 17px; line-height: 1.6; color: #5A5F6B; font-weight: 600; text-align: right; }
+.top img { width: 60px; height: 60px; }
+.name { font-size: 38px; font-weight: 900; }
+.en { font-size: 24px; font-weight: 700; color: #5A5F6B; }
+.slogan { font-size: var(--slogan, 60px); line-height: 1.12; font-weight: 900; letter-spacing: -0.02em; }
+.sub { margin-top: 18px; font-size: 26px; font-weight: 700; }
+.sub b { color: #E8552B; font-weight: 700; }
+.foot { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; color: #5A5F6B; white-space: nowrap; }
+.pill { padding: 8px 14px; border-radius: 999px; background: #FFFFFF; color: #15171C; }
+.right { flex: 0 0 420px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
+.notes { background: #FFFFFF; border-radius: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px rgba(21,23,28,.06), 0 12px 32px rgba(21,23,28,.08); }
+.head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
+.head span:last-child { margin-left: auto; font-size: 14px; font-weight: 600; color: #6B7080; }
+.dot { width: 9px; height: 9px; border-radius: 50%; background: #E8552B; flex: none; }
+.label { font-size: 15px; font-weight: 700; color: #6B7080; }
+.decision { font-size: 19px; font-weight: 700; line-height: 1.45; }
+.todos { display: flex; flex-direction: column; gap: 8px; font-size: 17px; font-weight: 600; line-height: 1.4; }
+.todos div { display: flex; gap: 10px; align-items: center; }
+.todos div::before { content: ""; width: 16px; height: 16px; box-sizing: border-box; border: 2px solid #15171C; border-radius: 5px; flex: none; }
+.bar { background: #15171C; color: #FFFFFF; border-radius: 18px; padding: 16px 22px; }
+.bar .s { display: flex; align-items: center; gap: 10px; font-size: 16px; color: #A9AEB8; }
+.bar .s .dot { width: 8px; height: 8px; }
+.bar .t { margin-top: 6px; font-size: 24px; font-weight: 700; text-wrap: balance; }
.stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: #E8552B; }
</style>
</head>
<body>
<div class="card">
- <div class="top"><img src="../site/icon.svg" alt=""><span class="name">知了</span><span class="en">Cicada</span><span class="pill">免费开源 · macOS</span></div>
- <div><div class="slogan">任何会议、任何直播,<br>没有语言障碍。</div><div class="sub">听得懂,说得出,记得住。</div></div>
- <div class="bottom">
- <div class="bar"><div class="s"><i></i>So the launch moves to next Thursday, right?</div><div class="t">所以发布挪到下周四了,对吧?</div></div>
- <div class="apps">Zoom · Teams · 飞书 · 腾讯会议<br>X Spaces · YouTube 直播 · Discord</div>
+ <div class="left">
+ <div class="top"><img src="../site/icon.svg" alt=""><span class="name" id="name"></span><span class="en" id="en"></span></div>
+ <div><div class="slogan" id="slogan"></div><div class="sub" id="sub"></div></div>
+ <div class="foot"><span class="pill" id="pill"></span><span id="apps"></span></div>
+ </div>
+ <div class="right">
+ <div class="notes">
+ <div class="head"><span class="dot"></span><span id="notes"></span><span id="meeting"></span></div>
+ <div class="label" id="decisionLabel"></div>
+ <div class="decision" id="decision"></div>
+ <div class="label" id="todoLabel"></div>
+ <div class="todos" id="todos"></div>
+ </div>
+ <div class="bar"><div class="s"><span class="dot"></span><span id="heard"></span></div><div class="t" id="said"></div></div>
</div>
<div class="stripe"></div>
</div>
+<script>
+// sub is [before, accent, after]: 说得出 (speaking into the room) is the part only Cicada does.
+const CARDS = {
+ zh: { lang: "zh-CN", cjk: "'Noto Sans SC', 'PingFang SC'", name: "知了", en: "Cicada",
+ slogan: "任何会议、任何直播,<br>没有语言障碍。", sub: ["听得懂,", "说得出", ",记得住。"],
+ pill: "免费开源 · macOS", apps: "Zoom · Teams · 飞书 · 腾讯会议 · YouTube",
+ notes: "实时纪要", meeting: "发布同步会 · 23:14", decisionLabel: "结论", decision: "发布挪到下周四,周二前冻结功能。",
+ todoLabel: "待办", todos: ["Emma:周一前出发布说明", "我:确认日文字幕"],
+ heard: "So the launch moves to next Thursday, right?", said: "所以发布挪到下周四了,对吧?" },
+ en: { lang: "en", cjk: "'Noto Sans SC'", name: "Cicada", en: "", slogan: "Any call, any stream,<br>no language barrier.", size: "54px",
+ sub: ["Understand. ", "Speak up.", " Remember."],
+ pill: "Free · Open source · macOS", apps: "Zoom · Teams · Meet · YouTube",
+ notes: "Live notes", meeting: "Launch sync · 23:14", decisionLabel: "Conclusions", decision: "Launch moves to next Thursday; feature freeze by Tuesday.",
+ todoLabel: "To-dos", todos: ["Lin: release notes by Monday", "Me: check the Japanese subtitles"],
+ heard: "所以发布挪到下周四了,对吧?", said: "So the launch moves to next Thursday?" },
+ ja: { lang: "ja", cjk: "'Noto Sans JP'", name: "Cicada", en: "", slogan: "どんな会議も、<br>どんな配信も、<br>言葉の壁なく。", size: "54px",
+ sub: ["聞き取り、", "話し、", "記録する。"],
+ pill: "無料・オープンソース · macOS", apps: "Zoom · Teams · Meet · YouTube",
+ notes: "ライブ議事メモ", meeting: "ローンチ定例 · 23:14", decisionLabel: "結論", decision: "ローンチは来週木曜に延期、火曜に機能凍結。",
+ todoLabel: "ToDo", todos: ["Emma:月曜までにリリースノート", "自分:字幕の訳語を確認"],
+ heard: "So the launch moves to next Thursday, right?", said: "来週木曜に延期ですね?" },
+ ko: { lang: "ko", cjk: "'Noto Sans KR'", name: "Cicada", en: "", slogan: "어떤 회의도,<br>어떤 방송도<br>언어 장벽 없이", size: "54px",
+ sub: ["알아듣고, ", "말하고,", " 기록합니다"],
+ pill: "무료 오픈 소스 · macOS", apps: "Zoom · Teams · Meet · YouTube",
+ notes: "실시간 회의록", meeting: "출시 회의 · 23:14", decisionLabel: "결론", decision: "출시는 다음 주 목요일, 화요일까지 기능 동결.",
+ todoLabel: "할 일", todos: ["Emma: 월요일까지 릴리스 노트", "나: 자막 용어 확인"],
+ heard: "So the launch moves to next Thursday, right?", said: "출시가 다음 주 목요일로 미뤄지죠?" },
+};
+const c = CARDS[new URLSearchParams(location.search).get("lang")] || CARDS.zh;
+const $ = id => document.getElementById(id);
+document.documentElement.lang = c.lang;
+document.body.style.setProperty("--cjk", c.cjk);
+if (c.size) document.body.style.setProperty("--slogan", c.size);
+for (const k of ["name", "en", "pill", "apps", "notes", "meeting", "decisionLabel", "decision", "todoLabel", "heard", "said"]) $(k).textContent = c[k];
+$("slogan").innerHTML = c.slogan;
+$("sub").append(c.sub[0], Object.assign(document.createElement("b"), { textContent: c.sub[1] }), c.sub[2]);
+for (const t of c.todos) $("todos").appendChild(Object.assign(document.createElement("div"), { textContent: t }));
+</script>
</body>
</html>
diff --git a/scripts/site.py b/scripts/site.py
index 2a86b36..7ae54ef 100755
--- a/scripts/site.py
+++ b/scripts/site.py
@@ -29,7 +29,7 @@ REPO = "https://github.com/wquguru/cicada"
DOWNLOAD = REPO + "/releases/latest"
# The author on X: the app is not notarized yet, so a real person to ask helps people trust the first launch.
X = "https://x.com/wquguru"
-STATIC = ["style.css", "icon.svg", "icon.png", "og.png", "img", "audio"]
+STATIC = ["style.css", "icon.svg", "icon.png", "og.png", "og-en.png", "og-ja.png", "og-ko.png", "img", "audio"]
# The home page's meeting with sound, in the language its reader listens to (the English page's is
# Chinese): file, length in seconds, and who talks when as (person, start, end), one turn per
# subtitle. Both clips come from scripts/make-sample.sh; the English one is the app's onboarding
@@ -178,6 +178,7 @@ def main():
if alternates:
hreflang += f'\n<link rel="alternate" hreflang="x-default" href="{SITE}en/{kind}">'
v = dict(common, ROOT=root, HOME=root + prefix, LANG=code,
+ OG_IMAGE=SITE + ("og.png" if code == "zh" else f"og-{code}.png"), # share card in the page's language (scripts/site-og.html)
CHANGELOG=(root + "changelog/") if code == "zh" else REPO + "/releases",
START_CURRENT=' aria-current="page"' if current == "start" else "",
CANONICAL=SITE + rel, HREFLANG=hreflang, LANG_LINKS=links, LANG_LINKS_FOOT=foot_links,
diff --git a/site/changelog.html b/site/changelog.html
index 01ccaa5..a86566a 100644
--- a/site/changelog.html
+++ b/site/changelog.html
@@ -16,6 +16,8 @@
<meta property="og:description" content="最新版本 {{LATEST_VERSION}}:{{LATEST_TITLE}}">
<meta property="og:url" content="{{SITE}}changelog/">
<meta property="og:image" content="{{SITE}}og.png">
+<meta property="og:image:width" content="1200">
+<meta property="og:image:height" content="630">
<meta property="og:locale" content="zh_CN">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@wquguru">
diff --git a/site/index.html b/site/index.html
index 4d743ed..389d654 100644
--- a/site/index.html
+++ b/site/index.html
@@ -16,7 +16,10 @@
<meta property="og:title" content="{{t.og_title}}">
<meta property="og:description" content="{{t.og_desc}}">
<meta property="og:url" content="{{CANONICAL}}">
-<meta property="og:image" content="{{SITE}}og.png">
+<meta property="og:image" content="{{OG_IMAGE}}">
+<meta property="og:image:width" content="1200">
+<meta property="og:image:height" content="630">
+<meta property="og:image:alt" content="{{t.og_title}}">
<meta property="og:locale" content="{{t.og_locale}}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@wquguru">
diff --git a/site/og-en.png b/site/og-en.png
new file mode 100644
index 0000000..4bcfc17
Binary files /dev/null and b/site/og-en.png differ
diff --git a/site/og-ja.png b/site/og-ja.png
new file mode 100644
index 0000000..3e7f2f7
Binary files /dev/null and b/site/og-ja.png differ
diff --git a/site/og-ko.png b/site/og-ko.png
new file mode 100644
index 0000000..d40b4cb
Binary files /dev/null and b/site/og-ko.png differ
diff --git a/site/og.png b/site/og.png
index 19a192a..5096a6c 100644
Binary files a/site/og.png and b/site/og.png differ
diff --git a/site/start.html b/site/start.html
index d0bbf3a..4034ed4 100644
--- a/site/start.html
+++ b/site/start.html
@@ -15,7 +15,10 @@
<meta property="og:title" content="{{t.start_h1}}">
<meta property="og:description" content="{{t.start_desc}}">
<meta property="og:url" content="{{CANONICAL}}">
-<meta property="og:image" content="{{SITE}}og.png">
+<meta property="og:image" content="{{OG_IMAGE}}">
+<meta property="og:image:width" content="1200">
+<meta property="og:image:height" content="630">
+<meta property="og:image:alt" content="{{t.og_title}}">
<meta property="og:locale" content="{{t.og_locale}}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@wquguru">