Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Teilen",
"copyLink": "Link kopieren",
"englishOnly": "Dieser Beitrag ist nur auf Englisch verfügbar.",
"helpTranslate": "Hilf beim Übersetzen",
"historical": "Dieser datierte Artikel hält die Perry-Version und die Messwerte zum Zeitpunkt der Veröffentlichung fest. Für aktuelle Entscheidungen gelten die aktuellen Einschränkungen, der Plattform-Leitfaden und die Benchmark-Daten."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Share",
"copyLink": "Copy link",
"englishOnly": "This post is available in English only.",
"helpTranslate": "Help translate it",
"historical": "This dated article records the Perry version and measurements available when it was published. Use the current limitations, platform guide, and benchmark artifact for decisions today."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Compartir",
"copyLink": "Copiar enlace",
"englishOnly": "Este artículo solo está disponible en inglés.",
"helpTranslate": "Ayuda a traducirlo",
"historical": "Este artículo fechado recoge la versión de Perry y las mediciones disponibles cuando se publicó. Para decidir hoy, consulta las limitaciones actuales, la guía de plataformas y los datos de benchmarks."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Partager",
"copyLink": "Copier le lien",
"englishOnly": "Cet article est disponible uniquement en anglais.",
"helpTranslate": "Aidez à le traduire",
"historical": "Cet article daté reflète la version de Perry et les mesures disponibles à sa publication. Pour décider aujourd'hui, reportez-vous aux limitations actuelles, au guide des plateformes et aux données de benchmark."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "Bagikan",
"copyLink": "Salin tautan",
"englishOnly": "Artikel ini hanya tersedia dalam bahasa Inggris.",
"helpTranslate": "Bantu terjemahkan",
"historical": "Artikel bertanggal ini mencatat versi Perry dan hasil pengukuran saat diterbitkan. Untuk keputusan hari ini, lihat batasan terkini, panduan platform, dan data benchmark."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Condividi",
"copyLink": "Copia link",
"englishOnly": "Questo articolo è disponibile solo in inglese.",
"helpTranslate": "Aiuta a tradurlo",
"historical": "Questo articolo datato riporta la versione di Perry e le misurazioni disponibili al momento della pubblicazione. Per le decisioni di oggi, consulta le limitazioni attuali, la guida alle piattaforme e i dati dei benchmark."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "共有",
"copyLink": "リンクをコピー",
"englishOnly": "この記事は英語のみで提供されています。",
"helpTranslate": "翻訳に協力する",
"historical": "この記事は、公開時点の Perry のバージョンと計測値を記録したものです。現在の判断には、最新の制限事項、プラットフォームガイド、ベンチマークデータを参照してください。"
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "공유",
"copyLink": "링크 복사",
"englishOnly": "이 글은 영어로만 제공됩니다.",
"helpTranslate": "번역 돕기",
"historical": "이 글은 게시 시점의 Perry 버전과 측정값을 기록합니다. 현재 판단에는 최신 제한 사항, 플랫폼 가이드, 벤치마크 데이터를 참고하세요."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"share": "Compartilhar",
"copyLink": "Copiar link",
"englishOnly": "Este artigo está disponível apenas em inglês.",
"helpTranslate": "Ajude a traduzi-lo",
"historical": "Este artigo datado registra a versão do Perry e as medições disponíveis quando foi publicado. Para decidir hoje, consulte as limitações atuais, o guia de plataformas e os dados de benchmark."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "แชร์",
"copyLink": "คัดลอกลิงก์",
"englishOnly": "บทความนี้มีเฉพาะภาษาอังกฤษเท่านั้น",
"helpTranslate": "ช่วยแปลบทความนี้",
"historical": "บทความนี้บันทึกเวอร์ชันของ Perry และผลการวัด ณ เวลาที่เผยแพร่ หากต้องตัดสินใจในวันนี้ โปรดดูข้อจำกัดปัจจุบัน คู่มือแพลตฟอร์ม และข้อมูลเบนช์มาร์ก"
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "Paylaş",
"copyLink": "Bağlantıyı kopyala",
"englishOnly": "Bu yazı yalnızca İngilizce olarak mevcuttur.",
"helpTranslate": "Çevirisine yardım et",
"historical": "Bu tarihli yazı, yayımlandığı andaki Perry sürümünü ve ölçümleri kaydeder. Bugünkü kararlar için güncel sınırlamalara, platform kılavuzuna ve benchmark verilerine bakın."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "Chia sẻ",
"copyLink": "Sao chép liên kết",
"englishOnly": "Bài viết này chỉ có bằng tiếng Anh.",
"helpTranslate": "Giúp dịch bài này",
"historical": "Bài viết có ghi ngày này phản ánh phiên bản Perry và số liệu đo tại thời điểm xuất bản. Để ra quyết định hôm nay, hãy xem các giới hạn hiện tại, hướng dẫn nền tảng và dữ liệu benchmark."
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"share": "分享",
"copyLink": "复制链接",
"englishOnly": "本文仅提供英文版本。",
"helpTranslate": "帮助翻译",
"historical": "本文记录的是发布时的 Perry 版本和测量数据。如需做出当前决策,请参阅最新的限制说明、平台指南和基准测试数据。"
},
"compare": {
Expand Down
1 change: 1 addition & 0 deletions src/lib/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const links = {
limitations: "https://perryts.github.io/perry/language/limitations.html",
platforms: "https://perryts.github.io/perry/platforms/overview.html",
geisterhand: "https://geisterhand.io",
siteRepo: "https://github.com/PerryTS/perryts.com",
serverSource: "https://github.com/PerryTS/perryts.com/blob/main/native-entry/server.ts",
} as const;
50 changes: 43 additions & 7 deletions src/pages/[lang]/blog/[slug]/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
import { render } from "astro:content";
import Info from "@lucide/astro/icons/info";
import Languages from "@lucide/astro/icons/languages";
import GitPullRequest from "@lucide/astro/icons/git-pull-request";
import Calendar from "@lucide/astro/icons/calendar";
import Timer from "@lucide/astro/icons/timer";
import Base from "../../../../layouts/Base.astro";
Expand All @@ -14,6 +16,7 @@ import { messages, plural } from "../../../../i18n/messages.ts";
import { locales, localePath, type Locale } from "../../../../i18n/index.ts";
import { formatPostDate, getPosts, type Post } from "../../../../lib/blog.ts";
import { readingMinutes } from "../../../../lib/reading-time.ts";
import { links } from "../../../../lib/links.ts";
import { DEFAULT_SOCIAL_IMAGE, socialImageUrl } from "../../../../lib/seo.ts";

// Every post exists under every locale, like the previous site; untranslated ones show English with a notice.
Expand Down Expand Up @@ -46,6 +49,8 @@ const minutes = readingMinutes(entry.body ?? "", isFallback ? "en" : lang);
const path = `blog/${post.slug}`;
const url = new URL(localePath(lang, path), Astro.site).toString();
const contentLang = isFallback ? "en" : lang;
// GitHub's new-file editor; non-collaborators get a fork and a pull request automatically.
const translateUrl = `${links.siteRepo}/new/main/src/content/blog/${post.slug}?filename=${lang}.md`;
const published = entry.data.date.toISOString();
const blogPosting = {
"@context": "https://schema.org",
Expand Down Expand Up @@ -74,6 +79,15 @@ const blogPosting = {
publishedTime={published}
>
<JsonLd slot="head" data={blogPosting} />
{isFallback && (
<div class="translation">
<div class="wrap translation__inner">
<Languages size={16} stroke-width={1.75} aria-hidden="true" />
<p>{t.englishOnly}</p>
<a href={translateUrl}>{t.helpTranslate}<GitPullRequest size={14} stroke-width={1.75} aria-hidden="true" /></a>
</div>
</div>
)}
<PageHeader title={entry.data.title} back={{ href: localePath(lang, "blog"), label: t.back }}>
<ul slot="above" class="tags">{entry.data.tags.map((tag) => <li><Tag>{tag}</Tag></li>)}</ul>
<div class="meta t-mono muted">
Expand Down Expand Up @@ -101,9 +115,6 @@ const blogPosting = {
)}

<article class="article">
{isFallback && (
<p class="notice notice--accent"><Info size={16} stroke-width={1.75} aria-hidden="true" />{t.englishOnly}</p>
)}
<p class="notice"><Info size={16} stroke-width={1.75} aria-hidden="true" />{t.historical}</p>
<Prose lang={contentLang}><Content /></Prose>

Expand Down Expand Up @@ -234,6 +245,35 @@ const blogPosting = {
gap: 28px;
min-width: 0;
}
.translation {
background: var(--surface);
border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.translation__inner {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 12px;
padding-block: 14px;
font-size: 14px;
line-height: 1.5;
}
.translation__inner > :global(svg) {
flex: none;
color: var(--accent);
}
.translation p {
flex: 1;
min-width: 0;
font-weight: 500;
}
.translation a {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--accent);
font-weight: 500;
}
.notice {
display: flex;
gap: 12px;
Expand All @@ -249,10 +289,6 @@ const blogPosting = {
flex: none;
margin-top: 2px;
}
.notice--accent {
color: var(--text);
border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.pager {
display: grid;
grid-template-columns: 1fr 1fr;
Expand Down
Loading