Skip to content

Commit 2b55823

Browse files
authored
Merge pull request #134 from slaveofcode/feat/i18n-privacy
feat(i18n): Bahasa Privacy page (completes public-site i18n)
2 parents 2d32676 + 537dfef commit 2b55823

4 files changed

Lines changed: 101 additions & 59 deletions

File tree

src/components/shell/LangSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { LOCALES, LOCALE_LABEL, LOCALE_NAME, localizePath, stripLocale, type Lan
33

44
// Public sections that exist in every locale. Other paths (about, settings…) fall
55
// back to the locale home when switching, so the switcher never lands on a 404.
6-
const LOCALIZED_PREFIXES = ['/tools/', '/category/', '/about'];
6+
const LOCALIZED_PREFIXES = ['/tools/', '/category/', '/about', '/privacy'];
77

88
/** The URL for the current page in `lang` — computed fresh from the live location. */
99
function targetFor(lang: Lang): string {
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
import { ChevronRight } from 'lucide-react';
3+
import Base from '@/layouts/Base.astro';
4+
import { REPO_URL } from '@/config';
5+
import { LOCALES, localeParam, localizePath, type Lang } from '@/i18n/config';
6+
7+
export function getStaticPaths() {
8+
return LOCALES.map(lang => ({ params: { locale: localeParam(lang) }, props: { lang } }));
9+
}
10+
11+
const { lang } = Astro.props as { lang: Lang };
12+
const homePath = localizePath('/', lang);
13+
14+
const P = {
15+
en: {
16+
title: 'Privacy', home: 'Home', crumb: 'Privacy',
17+
metaDesc: 'How GoodWebTools protects your privacy: files never leave your browser, and analytics are optional, anonymized, and only load with your consent.',
18+
h1: 'Privacy & Verifiability',
19+
s1H: 'No data leaves your device',
20+
s1P: 'All processing happens in your browser. No files, images, or documents are ever uploaded to a server.',
21+
s2H: 'Analytics & cookies',
22+
s2Pa: 'We use a single privacy-friendly analytics cookie (Google Analytics, with IP anonymization) to understand which tools people find useful. It ',
23+
s2Strong: 'only loads after you click “Accept”',
24+
s2Pb: ' in the cookie banner — decline and no analytics cookie is set. This never includes your files or their contents; your documents are always processed entirely on your device.',
25+
s2P2: "You can change your mind anytime by clearing this site's data in your browser settings, which resets the banner.",
26+
s3H: 'Verify it yourself',
27+
s3: ['Open Developer Tools (F12)', 'Go to the Network tab', 'Use any tool and process a file', 'Watch: zero network requests to external servers'],
28+
s4H: 'Works offline',
29+
s4P: 'After first use, tools work with your network completely off. This is the strongest proof that nothing leaves your device.',
30+
s5H: 'Open source',
31+
s5Pa: 'The code is open source on GitHub — you can audit it yourself or run it locally: ',
32+
},
33+
id: {
34+
title: 'Privasi', home: 'Beranda', crumb: 'Privasi',
35+
metaDesc: 'Bagaimana GoodWebTools melindungi privasi Anda: berkas tidak pernah meninggalkan browser, dan analitik bersifat opsional, dianonimkan, serta hanya dimuat dengan persetujuan Anda.',
36+
h1: 'Privasi & Keterverifikasian',
37+
s1H: 'Tidak ada data yang meninggalkan perangkat Anda',
38+
s1P: 'Semua pemrosesan terjadi di browser Anda. Tidak ada berkas, gambar, atau dokumen yang pernah diunggah ke server.',
39+
s2H: 'Analitik & cookie',
40+
s2Pa: 'Kami menggunakan satu cookie analitik yang ramah privasi (Google Analytics, dengan anonimisasi IP) untuk memahami tool mana yang bermanfaat bagi pengguna. Cookie ini ',
41+
s2Strong: 'hanya dimuat setelah Anda mengeklik “Terima”',
42+
s2Pb: ' pada banner cookie — jika menolak, tidak ada cookie analitik yang dipasang. Ini tidak pernah menyertakan berkas Anda atau isinya; dokumen Anda selalu diproses sepenuhnya di perangkat Anda.',
43+
s2P2: 'Anda dapat berubah pikiran kapan saja dengan menghapus data situs ini di pengaturan browser, yang akan mengatur ulang banner.',
44+
s3H: 'Verifikasi sendiri',
45+
s3: ['Buka Developer Tools (F12)', 'Buka tab Network', 'Gunakan tool apa pun dan proses sebuah berkas', 'Perhatikan: nol permintaan jaringan ke server eksternal'],
46+
s4H: 'Bekerja offline',
47+
s4P: 'Setelah pemakaian pertama, tool bekerja dengan jaringan Anda dimatikan sepenuhnya. Ini adalah bukti terkuat bahwa tidak ada yang meninggalkan perangkat Anda.',
48+
s5H: 'Sumber terbuka',
49+
s5Pa: 'Kode bersifat sumber terbuka di GitHub — Anda dapat mengauditnya sendiri atau menjalankannya secara lokal: ',
50+
},
51+
}[lang];
52+
---
53+
54+
<Base title={P.title} description={P.metaDesc} lang={lang} localized>
55+
<main class="page-container max-w-3xl py-8">
56+
<nav aria-label="Breadcrumb" class="mb-4">
57+
<ol class="flex items-center gap-1 text-sm font-bold uppercase tracking-wide text-muted-foreground">
58+
<li>
59+
<a href={homePath} class="border-2 border-border bg-muted px-2 py-1 text-foreground shadow-brutal-sm press-brutal">{P.home}</a>
60+
</li>
61+
<li aria-hidden="true"><ChevronRight className="h-3.5 w-3.5" /></li>
62+
<li aria-current="page" class="text-foreground">{P.crumb}</li>
63+
</ol>
64+
</nav>
65+
66+
<h1 class="mb-6 text-4xl font-bold">{P.h1}</h1>
67+
68+
<section class="mb-8">
69+
<h2 class="mb-4 text-2xl font-semibold">{P.s1H}</h2>
70+
<p class="text-muted-foreground">{P.s1P}</p>
71+
</section>
72+
73+
<section class="mb-8">
74+
<h2 class="mb-4 text-2xl font-semibold">{P.s2H}</h2>
75+
<p class="mb-4 text-muted-foreground">{P.s2Pa}<strong>{P.s2Strong}</strong>{P.s2Pb}</p>
76+
<p class="text-muted-foreground">{P.s2P2}</p>
77+
</section>
78+
79+
<section class="mb-8">
80+
<h2 class="mb-4 text-2xl font-semibold">{P.s3H}</h2>
81+
<ol class="list-inside list-decimal space-y-2 text-muted-foreground">
82+
{P.s3.map(step => <li>{step}</li>)}
83+
</ol>
84+
</section>
85+
86+
<section class="mb-8">
87+
<h2 class="mb-4 text-2xl font-semibold">{P.s4H}</h2>
88+
<p class="text-muted-foreground">{P.s4P}</p>
89+
</section>
90+
91+
<section>
92+
<h2 class="mb-4 text-2xl font-semibold">{P.s5H}</h2>
93+
<p class="text-muted-foreground">
94+
{P.s5Pa}
95+
<a href={REPO_URL} target="_blank" rel="noopener noreferrer" class="font-bold underline decoration-2 underline-offset-2">slaveofcode/goodwebtools</a>.
96+
</p>
97+
</section>
98+
</main>
99+
</Base>

src/pages/privacy.astro

Lines changed: 0 additions & 57 deletions
This file was deleted.

worker/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default {
7575
if (request.method === 'GET') {
7676
const accept = request.headers.get('accept') || '';
7777
const p = url.pathname;
78-
const isLocalized = p === '/' || p.startsWith('/tools/') || p.startsWith('/category/') || p === '/about' || p.startsWith('/about/');
78+
const isLocalized = p === '/' || p.startsWith('/tools/') || p.startsWith('/category/') || p === '/about' || p.startsWith('/about/') || p === '/privacy' || p.startsWith('/privacy/');
7979
const alreadyId = p === '/id' || p.startsWith('/id/');
8080
const cookie = request.headers.get('cookie') || '';
8181
const hasChoice = /(?:^|;\s*)gwt\.lang=/.test(cookie);

0 commit comments

Comments
 (0)