diff --git a/astro.config.mjs b/astro.config.mjs index 1b368a5..fda3d82 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,6 @@ +import tailwind from '@astrojs/tailwind' // @ts-check import { defineConfig } from 'astro/config' -import tailwind from '@astrojs/tailwind' import preact from '@astrojs/preact' @@ -8,6 +8,14 @@ import sitemap from '@astrojs/sitemap' // https://astro.build/config export default defineConfig({ - integrations: [tailwind(), preact({ compat: true }), sitemap({})], + integrations: [tailwind(), preact({ compat: true }), sitemap()], site: 'https://zen-browser.app', + i18n: { + defaultLocale: 'en', + locales: ['en'], + routing: { + fallbackType: 'rewrite', + prefixDefaultLocale: false, + }, + }, }) diff --git a/src/components/BackButton.astro b/src/components/BackButton.astro index df7c2c0..2397d41 100644 --- a/src/components/BackButton.astro +++ b/src/components/BackButton.astro @@ -1,5 +1,14 @@ --- import { ArrowLeft } from 'lucide-astro' +import { getLocale, getUI } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { + routes: { + mods: { slug }, + }, +} = getUI(locale) --- diff --git a/src/components/Button.astro b/src/components/Button.astro index b985cdc..b765973 100644 --- a/src/components/Button.astro +++ b/src/components/Button.astro @@ -1,4 +1,8 @@ --- +import { getLocale, getPath } from '~/utils/i18n' + +const locale = getLocale(Astro) +const getLocalePath = getPath(locale) const { class: className, isPrimary, @@ -15,7 +19,7 @@ const { - Our - Core - Values + + {community.title[0]} + + + {community.title[1]} + + + {community.title[2]} + - We make it not only a priority, but a necessity to ensure that Zen always - strikes the right balance between beauty, performance, and privacy. We are - committed to making Zen the most beautiful, productive, and - privacy-respecting browser out there — without compromising on your - experience. + {community.description}
- Simple yet powerful + {community.lists.simpleYetPowerful.title} - Private and always up-to-date + {community.lists.privateAndAlwaysUpToDate.title}
Community diff --git a/src/components/Features.astro b/src/components/Features.astro index 0da3e3c..bbbb7c9 100644 --- a/src/components/Features.astro +++ b/src/components/Features.astro @@ -1,20 +1,33 @@ --- -import Description from '../components/Description.astro' import { motion } from 'motion/react' -import { getTitleAnimation } from '../animations' +import { getTitleAnimation } from '~/animations' +import Description from '~/components/Description.astro' -import WorkspacesVideo from '../assets/Workspaces.webm' -import GlanceVideo from '../assets/Glance.webm' -import CompactModeVideo from '../assets/CompactMode.webm' -import SplitViewsVideo from '../assets/SplitViews.webm' +import CompactModeVideo from '~/assets/CompactMode.webm' +import GlanceVideo from '~/assets/Glance.webm' +import SplitViewsVideo from '~/assets/SplitViews.webm' +import WorkspacesVideo from '~/assets/Workspaces.webm' +import { getLocale, getUI } from '~/utils/i18n' import Video from './Video.astro' +const locale = getLocale(Astro) + const { - title1 = 'Productivity', - title2 = 'at', - title3 = 'its best', + routes: { + index: { features }, + }, +} = getUI(locale) + +const { + title1 = features.title1, + title2 = features.title2, + title3 = features.title3, } = Astro.props + +const descriptions = Object.values(features.featureTabs).map( + (tab) => tab.description, +) ---
- Zen Browser is packed with features that help you stay productive and - focused. Browsers should be tools that help you get things done, not - distractions that keep you from your work. + {features.description}
- Workspaces + {features.featureTabs.workspaces.title} - Compact Mode + {features.featureTabs.compactMode.title} - Glance + {features.featureTabs.glance.title} - Split View + {features.featureTabs.splitView.title}
@@ -82,37 +93,45 @@ const { className="feature" data-active="true" > - Workspaces + + {features.featureTabs.workspaces.title} + - Organize your tabs into Workspaces to keep your projects separate - and organized, and switch between them with ease. + {features.featureTabs.workspaces.description} - Compact Mode + + {features.featureTabs.compactMode.title} + - Zen's Compact Mode gives you more screen real estate by hiding the - tab bar when you don't need it, and showing it when you do. + {features.featureTabs.compactMode.description} - Glance + + {features.featureTabs.glance.title} + - Zen's Glance lets you preview tabs without switching to them, so you - can quickly find the page you're looking for. + {features.featureTabs.glance.description} - Split View + + {features.featureTabs.splitView.title} + - Zen's Split View lets you view up to 4 tabs side by side, so you can - compare information or multitask easily. + {features.featureTabs.splitView.description} -
+
+
@@ -160,17 +179,16 @@ const {
- + {redirect ? : null} diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..0f4e363 --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,5 @@ +--- +import NotFound from './[...locale]/404.astro' +--- + + diff --git a/src/pages/[...locale]/404.astro b/src/pages/[...locale]/404.astro new file mode 100644 index 0000000..b458086 --- /dev/null +++ b/src/pages/[...locale]/404.astro @@ -0,0 +1,31 @@ +--- +import Button from '~/components/Button.astro' +import Description from '~/components/Description.astro' +import Title from '~/components/Title.astro' +import Layout from '~/layouts/Layout.astro' +import { getLocale, getPath, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) +const getLocalePath = getPath(locale) +const { + routes: { notFound }, +} = getUI(locale) +--- + + +
+ 404 + + {notFound.title} + +

+ {notFound.description} +

+ +
+
diff --git a/src/pages/[...locale]/about.astro b/src/pages/[...locale]/about.astro new file mode 100644 index 0000000..c23a2a8 --- /dev/null +++ b/src/pages/[...locale]/about.astro @@ -0,0 +1,82 @@ +--- +import Button from "~/components/Button.astro"; +import Description from "~/components/Description.astro"; +import Layout from "~/layouts/Layout.astro"; +import { getLocale, getUI } from "~/utils/i18n"; +export { getStaticPaths } from "~/utils/i18n"; + +const locale = getLocale(Astro); + +const { + routes: { about }, + layout, +} = getUI(locale); +--- + + +
+
+ {about.title} + + {about.description} + + +
+
+ + +
+
{about.contributors.title}
+ + {about.contributors.description} + + Contributors + Contributors (website) +
+
+
+ diff --git a/src/pages/donate.astro b/src/pages/[...locale]/donate.astro similarity index 53% rename from src/pages/donate.astro rename to src/pages/[...locale]/donate.astro index 42a953b..cbee1e1 100644 --- a/src/pages/donate.astro +++ b/src/pages/[...locale]/donate.astro @@ -1,32 +1,34 @@ --- -import { ArrowRight, ChevronRight } from 'lucide-astro' -import Button from '../components/Button.astro' -import Description from '../components/Description.astro' -import Title from '../components/Title.astro' -import Layout from '../layouts/Layout.astro' +import { ArrowRight } from 'lucide-astro' +import Button from '~/components/Button.astro' +import Description from '~/components/Description.astro' +import Layout from '~/layouts/Layout.astro' +import { getLocale, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) +const { + routes: { donate }, + layout, +} = getUI(locale) --- - +
- Help us build a better browser! + {donate.title} - We are a small team of developers working hard to bring you the best - browsing experience. If you like what we do, please consider - supporting us. + {donate.description}
-
Patreon
+
{donate.patreon.title}
- Patreon allows you to support us with a monthly donation. You can - choose the level of support that works best for you. + {donate.patreon.description}
diff --git a/src/pages/download.astro b/src/pages/[...locale]/download.astro similarity index 68% rename from src/pages/download.astro rename to src/pages/[...locale]/download.astro index 841cef5..8da0b3b 100644 --- a/src/pages/download.astro +++ b/src/pages/[...locale]/download.astro @@ -1,20 +1,28 @@ --- -import Description from '../components/Description.astro' -import Title from '../components/Title.astro' -import Layout from '../layouts/Layout.astro' -import { getReleasesWithChecksums } from '../components/download/release-data.astro' -import PlatformDownload from '../components/download/PlatformDownload.astro' -import DownloadScript from '../components/download/DownloadScript.astro' -import { getChecksums } from '../utils/githubChecksums' +import Description from '~/components/Description.astro' +import DownloadScript from '~/components/download/DownloadScript.astro' +import PlatformDownload from '~/components/download/PlatformDownload.astro' +import { getReleasesWithChecksums } from '~/components/download/release-data.astro' +import Layout from '~/layouts/Layout.astro' +import { getChecksums } from '~/utils/githubChecksums' +import { getLocale, getUI } from '~/utils/i18n' -import { library, icon } from '@fortawesome/fontawesome-svg-core' +import { icon, library } from '@fortawesome/fontawesome-svg-core' import { - faWindows, - faLinux, faApple, faGithub, + faLinux, + faWindows, } from '@fortawesome/free-brands-svg-icons' -import { Lock, ExternalLink } from 'lucide-astro' +import { ExternalLink, Lock } from 'lucide-astro' + +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) +const { + routes: { download }, + layout, +} = getUI(locale) library.add(faWindows, faLinux, faApple, faGithub) const windowsIcon = icon({ prefix: 'fab', iconName: 'windows' }) @@ -24,21 +32,22 @@ const githubIcon = icon({ prefix: 'fab', iconName: 'github' }) const checksums = await getChecksums() const releases = getReleasesWithChecksums(checksums) + +const platformNames = download.platformNames +const platformDescriptions = download.platformDescriptions --- - -
+ +
Download Zen{download.title} - Download Zen Browser for your platform and experience a more mindful - internet browsing experience. All downloads include SHA256 checksums - for verification. + {download.description}
- - Twilight Mode: You're - currently in Twilight mode, this means you're downloading the latest - experimental features and updates. - +
@@ -77,7 +82,7 @@ const releases = getReleasesWithChecksums(checksums) > - macOS + {platformNames.mac}
@@ -109,16 +114,16 @@ const releases = getReleasesWithChecksums(checksums) @@ -126,16 +131,16 @@ const releases = getReleasesWithChecksums(checksums)
-

- Additional Resources +

+ {download.additionalResources.title}

@@ -145,10 +150,11 @@ const releases = getReleasesWithChecksums(checksums) >
-

Source Code

+

+ {download.additionalResources.sourceCode.title} +

- Explore Zen Browser's source code on GitHub. Contribute to the - project or build your own version. + {download.additionalResources.sourceCode.description}

-

Documentation

+

+ {download.additionalResources.documentation.title} +

- Access comprehensive documentation, guides, and tutorials for - Zen Browser. + {download.additionalResources.documentation.description}

-

Verified & Secure Downloads

-

- All Zen downloads are signed and verified for your security. We - recommend downloading directly from our official website or GitHub - repository. If your download seems broken or gets flagged by your - antivirus, please - report it to us. -

+

+ {download.securityNotice.title} +

+

diff --git a/src/pages/feed.xml.ts b/src/pages/[...locale]/feed.xml.ts similarity index 95% rename from src/pages/feed.xml.ts rename to src/pages/[...locale]/feed.xml.ts index cb10b28..acba185 100644 --- a/src/pages/feed.xml.ts +++ b/src/pages/[...locale]/feed.xml.ts @@ -1,6 +1,7 @@ import rss, { type RSSOptions } from '@astrojs/rss' -import { releaseNotes } from '../release-notes' -import type { ReleaseNote } from '../release-notes' +import { releaseNotes } from '~/release-notes' +import type { ReleaseNote } from '~/release-notes' +export { getStaticPaths } from '~/utils/i18n' /** The default number of entries to include in the RSS feed. */ const RSS_ENTRY_LIMIT = 20 @@ -73,14 +74,14 @@ function formatRssDate(dateStr: string) { */ function formatReleaseNote(releaseNote: ReleaseNote) { let content = `

- If you encounter any issues, please report them on the issues page. + If you encounter any issues, please report them on the issues page. Thanks everyone for your feedback! ❤️

` if (releaseNote.image) { - content += `Release Image for version ${releaseNote.version}` } diff --git a/src/pages/[...locale]/index.astro b/src/pages/[...locale]/index.astro new file mode 100644 index 0000000..1b4c38f --- /dev/null +++ b/src/pages/[...locale]/index.astro @@ -0,0 +1,41 @@ +--- +import Community from '~/components/Community.astro' +import Features from '~/components/Features.astro' +import Hero from '~/components/Hero.astro' +import Sponsors from '~/components/Sponsors.astro' +import Layout from '~/layouts/Layout.astro' +import { getLocale, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { layout } = getUI(locale) +--- + + +
+ + + + +
+
+ + diff --git a/src/pages/mods/[...slug].astro b/src/pages/[...locale]/mods/[...slug].astro similarity index 60% rename from src/pages/mods/[...slug].astro rename to src/pages/[...locale]/mods/[...slug].astro index d22e624..378d249 100644 --- a/src/pages/mods/[...slug].astro +++ b/src/pages/[...locale]/mods/[...slug].astro @@ -1,19 +1,37 @@ --- -import { getAbsoluteLocaleUrl } from 'astro:i18n' -import { getAllMods, getAuthorLink, getLocalizedDate } from '../../mods' -import Layout from '../../layouts/Layout.astro' -import Title from '../../components/Title.astro' -import Description from '../../components/Description.astro' -import Button from '../../components/Button.astro' -import BackButton from '../../components/BackButton.astro' import { ArrowRight, Info } from 'lucide-astro' +import BackButton from '~/components/BackButton.astro' +import Button from '~/components/Button.astro' +import Description from '~/components/Description.astro' +import Layout from '~/layouts/Layout.astro' +import { getAllMods, getAuthorLink, getLocalizedDate } from '~/mods' +import { getUI } from '~/utils/i18n' +import { getLocale, getOtherLocales } from '~/utils/i18n' export async function getStaticPaths() { const mods = await getAllMods() - return mods.map((mod) => ({ - params: { slug: mod.id }, - props: { ...mod }, - })) + return mods.flatMap((mod) => [ + ...getOtherLocales().map((locale) => ({ + params: { + slug: mod.id, + locale: locale, + }, + props: { + ...mod, + locale: locale, + }, + })), + { + params: { + slug: mod.id, + locale: undefined, + }, + props: { + ...mod, + locale: undefined, + }, + }, + ]) } // https://github.com/TeaClientMC/Website/blob/7faacc9f8b2c79c74f711d413b155c84faafc00d/src/pages/news/%5B...slug%5D.astro @@ -24,11 +42,19 @@ const dates = { createdAt: getLocalizedDate(mod.createdAt), updatedAt: getLocalizedDate(mod.updatedAt), } + +const locale = getLocale(Astro) + +const { + routes: { + mods: { slug }, + }, +} = getUI(locale) ---
@@ -40,7 +66,7 @@ const dates = {

- You need to have Zen Browser installed to install this theme.{' '} + {slug.alert.description}

@@ -64,18 +90,23 @@ const dates = { />
-

- Created by @{mod.author}v{mod.version} -

-

Creation date • {dates.createdAt}

+

+

{ dates.createdAt !== dates.updatedAt && ( -

- Latest update • {dates.updatedAt} -

+

) } { @@ -86,7 +117,7 @@ const dates = { rel="noopener noreferrer" class="zen-link" > - Visit mod homepage + {slug.visitModHomepage} ) } @@ -98,7 +129,7 @@ const dates = { extra={{ 'zen-theme-id': mod.id }} isPrimary > - Install Theme 🎉 + {slug.installMod}

-
diff --git a/src/pages/[...locale]/mods/index.astro b/src/pages/[...locale]/mods/index.astro new file mode 100644 index 0000000..05955af --- /dev/null +++ b/src/pages/[...locale]/mods/index.astro @@ -0,0 +1,40 @@ +--- +import Description from '~/components/Description.astro' +import ModsList from '~/components/ModsList' +import { CONSTANT } from '~/constants' +import Layout from '~/layouts/Layout.astro' +import { getAllMods } from '~/mods' +import { getLocale, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { + routes: { mods }, + layout, +} = getUI(locale) + +const allMods = (await getAllMods()) || [] +--- + + +
+
+
+
+ {mods.title} + + {mods.description} + +
+
+
+ + + +
+
diff --git a/src/pages/[...locale]/privacy-policy.astro b/src/pages/[...locale]/privacy-policy.astro new file mode 100644 index 0000000..dd552b4 --- /dev/null +++ b/src/pages/[...locale]/privacy-policy.astro @@ -0,0 +1,201 @@ +--- +import Title from '~/components/Title.astro' +import Layout from '~/layouts/Layout.astro' +import { getLocale, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { + routes: { privacyPolicy }, + layout, +} = getUI(locale) +--- + + +
+ {privacyPolicy.title} +
{privacyPolicy.lastUpdated}
+ + {privacyPolicy.sections.introduction.title} + +

{privacyPolicy.sections.introduction.body}

+
+ {privacyPolicy.sections.introduction.summary} +
+ + {privacyPolicy.sections.noCollect.title} + +

{privacyPolicy.sections.noCollect.body}

+

+ {privacyPolicy.sections.noTelemetry.title} +

+

{privacyPolicy.sections.noTelemetry.body}

+

{privacyPolicy.sections.noTelemetry.body2}

+

+ {privacyPolicy.sections.noPersonalData.title} +

+

{privacyPolicy.sections.noPersonalData.body}

+

+ {privacyPolicy.sections.noThirdParty.title} +

+

{privacyPolicy.sections.noThirdParty.body}

+

+ {privacyPolicy.sections.externalConnections.title} +

+

{privacyPolicy.sections.externalConnections.body}

+ + {privacyPolicy.sections.localStorage.title} + +

+ {privacyPolicy.sections.browsingData.title} +

+

{privacyPolicy.sections.browsingData.body}

+
    +
  • + {privacyPolicy.sections.cookies.title}: {privacyPolicy.sections.cookies.body} +
  • +
  • + {privacyPolicy.sections.cache.title}: { + privacyPolicy.sections.cache.body + } +
  • +
+

+ {privacyPolicy.sections.settings.title} +

+

{privacyPolicy.sections.settings.body}

+ + {privacyPolicy.sections.sync.title} + +

{privacyPolicy.sections.sync.body}

+ + + {privacyPolicy.sections.addons.title} + +

{privacyPolicy.sections.addons.body}

+ + {privacyPolicy.sections.security.title} + +

{privacyPolicy.sections.security.body}

+
    +
  • {privacyPolicy.sections.security.note}
  • +
+ + {privacyPolicy.sections.control.title} + +

+ {privacyPolicy.sections.control.deletionTitle} +

+

{privacyPolicy.sections.control.deletionBody}

+ + {privacyPolicy.sections.website.title} + +

{privacyPolicy.sections.website.body}

+ +

{privacyPolicy.sections.website.externalLinksBody}

+ + {privacyPolicy.sections.changes.title} + +

+ {privacyPolicy.sections.changes.body} +

+ + {privacyPolicy.sections.otherTelemetry.title} + +

+ {privacyPolicy.sections.otherTelemetry.body} +

+ + + {privacyPolicy.sections.contact.title} + +

+ {privacyPolicy.sections.contact.body} +

+ +
+
+ diff --git a/src/pages/[...locale]/release-notes/[...slug].astro b/src/pages/[...locale]/release-notes/[...slug].astro new file mode 100644 index 0000000..33d31f6 --- /dev/null +++ b/src/pages/[...locale]/release-notes/[...slug].astro @@ -0,0 +1,36 @@ +--- +import Layout from '~/layouts/Layout.astro' +import { releaseNotes } from '~/release-notes' +import { getStaticPaths as getI18nPaths, getLocale, getUI } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { + routes: { + releaseNotes: { slug }, + }, +} = getUI(locale) + +export async function getStaticPaths() { + const i18nPaths = getI18nPaths() + + return i18nPaths.flatMap(({ params: { locale } }) => [ + ...releaseNotes.map((release: any) => ({ + params: { slug: release.version, locale }, + props: { ...release }, + })), + { + params: { slug: 'latest', locale }, + props: { ...releaseNotes[0] }, + }, + ]) +} + +const release = Astro.props +--- + + +
+ {slug.redirect.replaceAll('{version}', release.version)} +
+
diff --git a/src/pages/release-notes/index.astro b/src/pages/[...locale]/release-notes/index.astro similarity index 77% rename from src/pages/release-notes/index.astro rename to src/pages/[...locale]/release-notes/index.astro index 5017e26..8ff2989 100644 --- a/src/pages/release-notes/index.astro +++ b/src/pages/[...locale]/release-notes/index.astro @@ -1,14 +1,26 @@ --- -import Layout from '../../layouts/Layout.astro' -import ReleaseNoteItem from '../../components/ReleaseNoteItem.astro' -import { releaseNotes, releaseNotesTwilight } from '../../release-notes' -import Description from '../../components/Description.astro' -import Button from '../../components/Button.astro' import { Modal, ModalBody, ModalHeader } from 'free-astro-components' import { ArrowUp } from 'lucide-astro' +import Button from '~/components/Button.astro' +import Description from '~/components/Description.astro' +import ReleaseNoteItem from '~/components/ReleaseNoteItem.astro' +import Layout from '~/layouts/Layout.astro' +import { + releaseNotes as releaseNotesData, + releaseNotesTwilight, +} from '~/release-notes' +import { getLocale, getUI } from '~/utils/i18n' +export { getStaticPaths } from '~/utils/i18n' + +const locale = getLocale(Astro) + +const { + routes: { releaseNotes }, + layout, +} = getUI(locale) --- - +
@@ -17,26 +29,24 @@ import { ArrowUp } from 'lucide-astro' class="py-42 flex min-h-screen flex-col justify-center px-10 lg:px-10 xl:px-10 2xl:w-3/5" > Release Notes -

- Stay up to date with the latest changes to Zen Browser! Since the first release till {releaseNotes[0].version}, we've been working hard to make Zen Browser the best it can be. - Thanks everyone for your feedback! ❤️ -

+

{ @@ -45,29 +55,25 @@ import { ArrowUp } from 'lucide-astro' ) : null } - {releaseNotes.map((notes: any) => )} + {releaseNotesData.map((notes: any) => )}
-
-

Choose version

+

{releaseNotes.chooseVersion}

{ - releaseNotes.map((note) => ( + releaseNotesData.map((note) => ( diff --git a/src/pages/about.astro b/src/pages/about.astro deleted file mode 100644 index e91a4c7..0000000 --- a/src/pages/about.astro +++ /dev/null @@ -1,142 +0,0 @@ ---- -import Button from '../components/Button.astro' -import Description from '../components/Description.astro' -import Title from '../components/Title.astro' -import Layout from '../layouts/Layout.astro' ---- - - -
-
- About Us - - We are simply a group of developers and designers who care about your - experience on the web. We believe that the internet should be a place - where you can explore, learn, and connect without worrying about your - data being collected. - - -
-
-
-
Main Team
- - This list shows the main team members who are working hard to bring - you the best browsing experience. - -
-
    -
  • - Mauro B. : Creator, Main Developer -
  • -
  • - Oscar Gonzalez - : Site Reliability Engineer (SRE) and code signing. -
  • -
  • - Jan Heres - : Active contributor and helps with MacOS builds -
  • -
  • - BrhmDev - : Active contributor with great contributions -
  • -
  • - Canoa - : Active contributor, and very active in issue handling and - website management -
  • -
  • - Adam : Branding and design -
  • -
  • - kristijanribaric : Active contributor -
  • -
  • - n7itro - : Active contributor and release notes writer -
  • -
  • - Bryan Galdámez - : Huge contributor on theme functionalities -
  • -
  • - Jafeth Garro : Documentation writer -
  • -
  • - Larvey : AUR maintainer -
  • -
  • - Daniel García - : MacOS certificate and app notarization maintainer -
  • -
-
-
- -
-
Contributors
- - Here are all the wonderful people that decided to contribute to the - project! The first set of images are from the desktop repository, and - the second set is from the website repository. - - Contributors - Contributors (website) -
-
-
-
diff --git a/src/pages/index.astro b/src/pages/index.astro deleted file mode 100644 index a09e6a0..0000000 --- a/src/pages/index.astro +++ /dev/null @@ -1,31 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro' -import Hero from '../components/Hero.astro' -import Community from '../components/Community.astro' -import Features from '../components/Features.astro' -import Sponsors from '../components/Sponsors.astro' ---- - - -
- - - - -
-
- - diff --git a/src/pages/mods/index.astro b/src/pages/mods/index.astro deleted file mode 100644 index 71b2d3e..0000000 --- a/src/pages/mods/index.astro +++ /dev/null @@ -1,30 +0,0 @@ ---- -import Description from '../../components/Description.astro' -import Title from '../../components/Title.astro' -import Layout from '../../layouts/Layout.astro' -import ModsList from '../../components/ModsList' -import { getAllMods } from '../../mods' - -const mods = (await getAllMods()) || [] ---- - - -
-
-
-
- Zen Mods - - Browse our diverse collection of Zen Mods, community-made plugins - and themes for Zen Browser. Discover a theme to match every mood, - and a plugin to fulfill every requirement. Start customizing your - browser experience today! - -
-
-
- - - -
-
diff --git a/src/pages/privacy-policy.astro b/src/pages/privacy-policy.astro deleted file mode 100644 index e54a57b..0000000 --- a/src/pages/privacy-policy.astro +++ /dev/null @@ -1,256 +0,0 @@ ---- -import Title from '../components/Title.astro' -import Layout from '../layouts/Layout.astro' ---- - - -
- Privacy Policy -
Last updated: 2025-02-5
- Introduction -

- Welcome to Zen Browser! Your privacy is our priority. This Privacy Policy - outlines the types of personal information we collect, how we use it, and - the steps we take to protect your data when you use Zen Browser. -

-
- We don't sell data - We don't collect data - We don't track you -
- 1. Information We Do Not Collect -

- Zen Browser is designed with privacy in mind. We do not collect, store, or - share any of your personal data. Here’s what that means: -

-

- 1.1. No Telemetry -

-

We do not collect any telemetry data or crash reports.

-

- Zen Browser has stripped out telemetry built into Mozilla Firefox. We have - removed all telemetry data collection and crash reports. -

-

- 1.2. No Personal Data Collection -

-

- Zen Browser does not collect any personal information such as your IP - address, browsing history, search queries, or form data. -

-

- 1.3. No Third-Party Tracking -

-

- We do not allow third-party trackers or analytics tools to operate within - Zen Browser. Your browsing activity remains entirely private and is not - shared with any third party. Mozilla is not considered a third party as it - is the base of Zen Browser. -

-

- 1.4. External connections made at startup -

-

- Zen Browser may make external connections at startup to check for updates - and ensure the browser is up to date on plugins, addons, check for - connectivity and Geolocation/push notifications services in order to - comply with web standards. We, at Zen, do not collect any data from these - connections, but they may be logged by third-party services or websites - you visit. These connections are necessary for the proper functioning of - the browser and are not used for tracking or profiling purposes. They can - be disabled through the browser flags (about:config). -

- 2. Information Stored Locally on Your Device -

- 2.1. Browsing Data -

-

- Zen Browser stores certain data locally on your device to enhance your - browsing experience. This includes: -

-
    -
  • - Cookies: Cookies are stored locally - on your device and are not shared with Zen Browser or any third party. - You have full control over the management of cookies through the - browser’s settings. -
  • -
  • - Cache and Temporary Files: Zen - Browser may store cache files and other temporary data locally to - improve performance. These files can be cleared at any time through the - browser’s settings. -
  • -
-

- 2.2. Settings and Preferences -

-

- Any customizations, settings, and preferences you make within Zen Browser - are stored locally on your device. We do not have access to or control - over this data. -

- 3. Sync Feature -

- Zen Browser offers a "Sync" feature, which is implemented using - Mozilla Firefox's Sync feature. This feature allows you to synchronize - your bookmarks, history, passwords, and other data across multiple - devices. For this feature to work, your data is encrypted and stored on - Mozilla’s servers and is treated in accordance with their Privacy Policy. - We, at Zen, cannot view any of this data. -

- - 4. Add-ons and "Mods" -

- You can install Add-ons from addons.mozilla.org. Zen Browser periodically - checks for updates to these Add-ons. -
- You can also install "Mods" from zen-browser.app/mods. These Mods - are hosted by our services and follow the same privacy policy our website. - We do not collect any data from these Mods, they are purely static content - that is downloaded to your device. -

- 5. Data Security -

- Although Zen Browser does not collect your data, we are committed to - protecting the information that is stored locally on your device and, if - you use the Sync feature, the encrypted data stored on Mozilla's - servers. We recommend that you use secure passwords, enable device - encryption, and regularly update your software to ensure your data remains - safe. -

-
    -
  • - Note that most of the security measures are taken care by Mozilla - Firefox. -
  • -
- 6. Your Control -

- 6.1. Data Deletion -

-

- You have full control over all data stored locally on your device by Zen - Browser. You can clear your browsing data, cookies, and cache at any time - using the browser’s settings. -

- 7. Our Website and Services -

- Zen Browser's website and services do not use any third-party analytics, - tracking, or CDN services. We do not collect any personal information from - users visiting our website. The website is hosted on Cloudflare but with - analytics and tracking disabled, Cloudflare may collect some analytics - data from HTTP requests in order to provide security and performance - improvements. However, this data is not linked to any personal information - and is not used for tracking purposes. -

- -

- Zen Browser may contain links to external websites or services that are - not owned or operated by us. We are not responsible for the content or - privacy practices of these sites. We recommend that you review the privacy - policies of these sites before providing them with any personal - information. -

- 8. Changes to This Privacy Policy -

- We may update this Privacy Policy from time to time to reflect changes in - our practices or legal requirements. We will notify you of any significant - changes by updating the effective date at the top of this policy. - Continued use of Zen Browser after such changes constitutes your - acceptance of the new terms. -

- 9. Other telemetry done by Mozilla Firefox -

- We try to disable all telemetry data collection in Zen Browser. But, we - may have missed some. Check the below links for more information. -

- - 10. Contact Us -

- If you have any questions or concerns about this Privacy Policy or Zen - Browser, please contact us at: -

- -
-
- diff --git a/src/pages/release-notes/[...slug].astro b/src/pages/release-notes/[...slug].astro deleted file mode 100644 index 2c66131..0000000 --- a/src/pages/release-notes/[...slug].astro +++ /dev/null @@ -1,25 +0,0 @@ ---- -import { releaseNotes } from '../../release-notes' -import Layout from '../../layouts/Layout.astro' - -export async function getStaticPaths() { - return [ - ...releaseNotes.map((release: any) => ({ - params: { slug: release.version }, - props: { ...release }, - })), - { - params: { slug: 'latest' }, - props: { ...releaseNotes[0] }, - }, - ] -} - -const release = Astro.props ---- - - -
- Redirecting to release notes for version {release.version}... -
-
diff --git a/src/pages/welcome.astro b/src/pages/welcome.astro deleted file mode 100644 index bf2c73a..0000000 --- a/src/pages/welcome.astro +++ /dev/null @@ -1,12 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro' -import Features from '../components/Features.astro' ---- - - -
- -
-
diff --git a/src/utils/githubChecksums.ts b/src/utils/githubChecksums.ts index 926cd05..5ddeff1 100644 --- a/src/utils/githubChecksums.ts +++ b/src/utils/githubChecksums.ts @@ -3,25 +3,29 @@ * Returns a mapping from filename to checksum. */ export async function getChecksums() { - const res = await fetch('https://api.github.com/repos/zen-browser/desktop/releases/latest', { - headers: { - 'Accept': 'application/vnd.github+json', - 'X-GitHub-Api-Version': '2022-11-28', - 'User-Agent': 'zen-browser-checksum-fetcher', + const res = await fetch( + 'https://api.github.com/repos/zen-browser/desktop/releases/latest', + { + headers: { + Accept: 'application/vnd.github+json', + 'X-GitHub-Api-Version': '2022-11-28', + 'User-Agent': 'zen-browser-checksum-fetcher', + }, }, - }); - if (!res.ok) throw new Error('Failed to fetch GitHub release: ' + res.statusText); - const data = await res.json(); - const body = data.body as string; + ) + if (!res.ok) + throw new Error('Failed to fetch GitHub release: ' + res.statusText) + const data = await res.json() + const body = data.body as string // Extract the checksum block - const match = body.match(/File Checksums \(SHA-256\)[\s\S]*?```([\s\S]*?)```/); - const checksums: Record = {}; + const match = body.match(/File Checksums \(SHA-256\)[\s\S]*?```([\s\S]*?)```/) + const checksums: Record = {} if (match && match[1]) { - match[1].split('\n').forEach(line => { - const [hash, filename] = line.trim().split(/\s+/, 2); - if (hash && filename) checksums[filename] = hash; - }); + match[1].split('\n').forEach((line) => { + const [hash, filename] = line.trim().split(/\s+/, 2) + if (hash && filename) checksums[filename] = hash + }) } - return checksums; -} \ No newline at end of file + return checksums +} diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts new file mode 100644 index 0000000..8c71f17 --- /dev/null +++ b/src/utils/i18n.ts @@ -0,0 +1,85 @@ +import type { GetStaticPaths } from 'astro' +import { CONSTANT } from '~/constants' +import UI_EN from '~/i18n/en/translation.json' + +export type Locale = (typeof locales)[number] + +export const getPath = (locale?: Locale) => (path: string) => { + if (locale && !path.startsWith(`/${locale}`)) { + return `/${locale}${path.startsWith('/') ? '' : '/'}${path}` + } + return path +} + +export const getLocale = (Astro: any) => { + if (Astro.params.locale) { + return Astro.params.locale as Locale + } +} + +export const locales = CONSTANT.I18N.LOCALES.map(({ value }) => value) + +const otherLocales = CONSTANT.I18N.LOCALES.filter( + ({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE, +) + +export const getOtherLocales = () => otherLocales + +export type UI = typeof UI_EN + +export const ui = { en: UI_EN } + +export const getUI = (locale?: Locale | string): UI => { + const validLocale = locales.includes(locale as Locale) + ? locale + : CONSTANT.I18N.DEFAULT_LOCALE + const defaultUI = ui[CONSTANT.I18N.DEFAULT_LOCALE] + const localeUI = ui[validLocale as Locale] + + function deepMerge(defaultObj: T, overrideObj: Partial): T { + if (typeof defaultObj !== 'object' || defaultObj === null) + return (overrideObj ?? defaultObj) as T + if (typeof overrideObj !== 'object' || overrideObj === null) + return (overrideObj ?? defaultObj) as T + const result: any = Array.isArray(defaultObj) + ? [...defaultObj] + : { ...defaultObj } + for (const key in defaultObj) { + if (Object.prototype.hasOwnProperty.call(defaultObj, key)) { + result[key] = deepMerge( + (defaultObj as any)[key], + (overrideObj as any)?.[key], + ) + } + } + for (const key in overrideObj) { + if (!(key in defaultObj)) { + result[key] = (overrideObj as any)[key] + } + } + return result as T + } + + return deepMerge(defaultUI, localeUI) +} + +export const getStaticPaths = (() => { + return [ + { + params: { locale: undefined }, + props: { locale: CONSTANT.I18N.DEFAULT_LOCALE }, + }, + ...CONSTANT.I18N.LOCALES.filter( + ({ value }) => value !== CONSTANT.I18N.DEFAULT_LOCALE, + ).map(({ value }) => ({ + params: { locale: value }, + props: { + locale: value, + }, + })), + ] +}) satisfies GetStaticPaths + +export const getLocales = () => { + return [...locales, ...otherLocales] +} diff --git a/tsconfig.json b/tsconfig.json index e43d02f..2254b19 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,10 @@ "extends": "astro/tsconfigs/strict", "compilerOptions": { "jsx": "react-jsx", - "jsxImportSource": "preact" + "jsxImportSource": "preact", + "baseUrl": ".", + "paths": { + "~/*": ["./src/*"] + } } }