🌐 Basic i18n setup

This commit is contained in:
LittleSheep 2024-12-19 00:23:46 +08:00
parent 9ca513f91d
commit ee33a43ac8
13 changed files with 357 additions and 118 deletions

View File

@ -5,10 +5,18 @@ import tailwind from '@astrojs/tailwind'
import icon from 'astro-icon'
import mdx from '@astrojs/mdx';
import mdx from '@astrojs/mdx'
// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), icon(), mdx()],
prefetch: true,
})
i18n: {
locales: ['en', 'zh-cn'],
defaultLocale: 'en',
routing: {
fallbackType: 'rewrite',
prefixDefaultLocale: true,
},
},
})

View File

@ -1,19 +1,24 @@
---
export const prerender = false
import { Image } from 'astro:assets'
import { version } from '../../package.json'
import CompanyLogo from '../assets/images/company-logo.png'
import { getRelativeLocaleUrl } from 'astro:i18n'
interface Props {
title?: string
}
const { title } = Astro.props
const locale = Astro.currentLocale ?? 'en'
---
<!doctype html>
<html lang="en">
<html lang={Astro.currentLocale ?? 'en'}>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
@ -93,13 +98,24 @@ const { title } = Astro.props
</nav>
<nav>
<h6 class="footer-title">Legal</h6>
<a class="link link-hover" href="/terms/user-agreements">
<a
class="link link-hover"
href={getRelativeLocaleUrl(locale, '/terms/user-agreements')}
>
User Agreements
</a>
<a class="link link-hover" href="/terms/privacy-policy">
<a
class="link link-hover"
href={getRelativeLocaleUrl(locale, '/terms/privacy-policy')}
>
Privacy Policy
</a>
<a class="link link-hover" href="/terms">All Terms & Conditions</a>
<a
class="link link-hover"
href={getRelativeLocaleUrl(locale, '/terms')}
>
All Terms & Conditions
</a>
</nav>
</div>
</footer>

110
src/pages/en/index.astro Normal file
View File

@ -0,0 +1,110 @@
---
import { Image } from 'astro:assets'
import { Icon } from 'astro-icon/components'
import Layout from '@/layouts/Layout.astro'
import CompanyAsideImage from '@/assets/images/company-aside.webp'
import AppStoreGetImage from '@/assets/images/app-store/get-it-on-black.svg'
import ProductSnPreviewImage from '@/assets/images/products/solar-network.webp'
---
<Layout>
<div class="section container mx-auto grid-cols-1 lg:grid-cols-3" id="intro">
<div
class="sub-section flex flex-col items-end justify-center lg:col-span-1"
>
<h1 class="text-4xl font-bold text-right">Solsynth LLC</h1>
<p class="text-lg text-right">
A vibrant creating wonderful software and hope the future will be
brighter.
</p>
<a class="link flex items-center gap-1 mt-2" href="#work-featured">
<span>See some of our works</span>
<Icon name="material-symbols:arrow-downward" />
</a>
</div>
<div class="sub-section flex items-center lg:col-span-2">
<Image
src={CompanyAsideImage}
alt="galaxy"
class="rounded-lg shadow-xl"
/>
</div>
</div>
<div class="section-flex py-12 shadow-lg bg-base-300" id="work-featured">
<div class="section container mx-auto grid-cols-1 lg:grid-cols-3">
<div
class="sub-section flex flex-col items-start lg:items-end justify-center lg:col-span-1"
>
<div class="badge badge-primary flex gap-1 items-center mb-2">
<Icon name="material-symbols:star" />
<span>Featured Project</span>
</div>
<h2 class="text-3xl font-bold lg:text-right">Solar Network</h2>
<p class="text-lg lg:text-right">
The next generation social network. But not only for social media.
</p>
<blockquote
class="text-md lg:text-right bg-neutral text-neutral-content px-7 py-5 rounded-xl font-mono mt-2"
>
Social Network, Redefined.
</blockquote>
<div class="flex gap-3 mt-4 items-center text-right">
<span
class="opacity-75 text-xs max-lg:order-last"
style="line-height: 1"
>
Also supports Android, Windows, and any modern web browser
</span>
<a
href="https://apps.apple.com/us/app/solian/id6499032345?itscg=30200&itsct=apps_box_link&mttnsubad=6499032345"
>
<Image src={AppStoreGetImage} alt="get it on app store" />
</a>
</div>
<a
class="link flex items-center gap-1 mt-3"
href="/products/solar-network"
>
<span>Learn more about Solar Network</span>
<Icon name="material-symbols:arrow-right-alt" />
</a>
</div>
<div class="sub-section flex items-center lg:col-span-2">
<Image
src={ProductSnPreviewImage}
alt="solar network cross-platform preview"
class="rounded-lg shadow-xl"
/>
</div>
</div>
</div>
</Layout>
<style>
html,
body {
scroll-behavior: smooth;
}
.section {
min-height: 90vh;
width: 100%;
gap: 0 2rem;
padding: 0 1rem;
display: grid;
}
.section-flex {
width: 100%;
}
.sub-section {
padding: 1rem;
}
</style>

View File

@ -5,9 +5,9 @@ import sanitizeHtml from 'sanitize-html'
import { Icon } from 'astro-icon/components'
import { marked } from 'marked'
import Layout from '../../layouts/Layout.astro'
import AttachmentRenderer from '../../components/AttachmentRenderer.astro'
import { getAttachmentUrl, fetchAttachmentMeta } from '../../scripts/attachment'
import Layout from '@/layouts/Layout.astro'
import AttachmentRenderer from '@/components/AttachmentRenderer.astro'
import { getAttachmentUrl, fetchAttachmentMeta } from '@/scripts/attachment'
const { slug } = Astro.params

View File

@ -2,7 +2,7 @@
import { Image } from 'astro:assets'
import { Icon } from 'astro-icon/components'
import Layout from '../../layouts/Layout.astro'
import Layout from '@/layouts/Layout.astro'
import ProductSnPreviewImage from '../../assets/images/products/solar-network-alpha.webp'
---

View File

@ -1,5 +1,5 @@
---
import Layout from '../../layouts/Layout.astro'
import Layout from '@/layouts/Layout.astro'
---
<Layout title="Terms & Conditions">
@ -15,8 +15,8 @@ import Layout from '../../layouts/Layout.astro'
<p>
We're trying to make it as simple as possible. And it's good for both of
us. You do not need care about this in normal. Just makes our laywers
happy. <i>Do we really have a laywer?</i>
us. You do not need care about this in normal. Just makes our lawyers
happy. <i>Do we really have a lawyer?</i>
</p>
<p>

View File

@ -1,5 +1,5 @@
---
import Layout from '../../layouts/Layout.astro'
import Layout from '@/layouts/Layout.astro'
---
<Layout title="User Agreements">

View File

@ -1,5 +1,5 @@
---
import Layout from '../../layouts/Layout.astro'
import Layout from '@/layouts/Layout.astro'
---
<Layout title="User Agreements">

View File

@ -1,107 +1,12 @@
---
import { Image } from 'astro:assets'
import { Icon } from 'astro-icon/components'
import Layout from '../layouts/Layout.astro'
import CompanyAsideImage from '../assets/images/company-aside.webp'
import AppStoreGetImage from '../assets/images/app-store/get-it-on-black.svg'
import ProductSnPreviewImage from '../assets/images/products/solar-network.webp'
import Layout from '@/layouts/Layout.astro'
---
<Layout>
<div class="section container mx-auto grid-cols-1 lg:grid-cols-3" id="intro">
<div
class="sub-section flex flex-col items-end justify-center lg:col-span-1"
>
<h1 class="text-4xl font-bold text-right">Solsynth LLC</h1>
<p class="text-lg text-right">
A vibrant creating wonderful software and hope the future will be
brighter.
</p>
<a class="link flex items-center gap-1 mt-2" href="#work-featured">
<span>See some of our works</span>
<Icon name="material-symbols:arrow-downward" />
</a>
</div>
<div class="sub-section flex items-center lg:col-span-2">
<Image
src={CompanyAsideImage}
alt="galaxy"
class="rounded-lg shadow-xl"
/>
</div>
</div>
<div class="section-flex py-12 shadow-lg bg-base-300" id="work-featured">
<div class="section container mx-auto grid-cols-1 lg:grid-cols-3">
<div
class="sub-section flex flex-col items-start lg:items-end justify-center lg:col-span-1"
>
<div class="badge badge-primary flex gap-1 items-center mb-2">
<Icon name="material-symbols:star" />
<span>Featured Project</span>
</div>
<h2 class="text-3xl font-bold lg:text-right">Solar Network</h2>
<p class="text-lg lg:text-right">
The next generation social network. But not only for social media.
</p>
<blockquote
class="text-md lg:text-right bg-neutral text-neutral-content px-7 py-5 rounded-xl font-mono mt-2"
>
Social Network, Redefined.
</blockquote>
<div class="flex gap-3 mt-4 items-center text-right">
<span class="opacity-75 text-xs max-lg:order-last" style="line-height: 1">
Also supports Android, Windows, and any modern web browser
</span>
<a
href="https://apps.apple.com/us/app/solian/id6499032345?itscg=30200&itsct=apps_box_link&mttnsubad=6499032345"
>
<Image src={AppStoreGetImage} alt="get it on app store" />
</a>
</div>
<a
class="link flex items-center gap-1 mt-3"
href="/products/solar-network"
>
<span>Learn more about Solar Network</span>
<Icon name="material-symbols:arrow-right-alt" />
</a>
</div>
<div class="sub-section flex items-center lg:col-span-2">
<Image
src={ProductSnPreviewImage}
alt="solar network cross-platform preview"
class="rounded-lg shadow-xl"
/>
</div>
<Layout title="Redirecting...">
<div class="w-full h-full flex justify-center items-center text-center">
<div class="text-center">
<h1 class="text-4xl font-bold">You will be redirected soon.</h1>
<p>You should not see this page...</p>
</div>
</div>
</Layout>
<style>
html,
body {
scroll-behavior: smooth;
}
.section {
min-height: 90vh;
width: 100%;
gap: 0 2rem;
padding: 0 1rem;
display: grid;
}
.section-flex {
width: 100%;
}
.sub-section {
padding: 1rem;
}
</style>

View File

@ -0,0 +1,39 @@
---
import Layout from '@/layouts/Layout.astro'
---
<Layout title="Terms & Conditions">
<div
class="container max-w-[85ch] mx-auto mt-[25vh] px-2 flex flex-col gap-4"
>
<h1 class="text-2xl font-bold">条款和条件</h1>
<p>这里罗列了您使用我们的产品将需要同意的所有条款和条件。</p>
<p>
我们正努力让事情尽可能简单。这对我们双方都有好处。通常情况下你不需要关心这件事。只是为了让我们的律师高兴。
<i>我们真的有律师吗?</i>
</p>
<p>此处的信息可能会不时更改。请刷新 查看此页面以获取最新版本。</p>
<div class="flex flex-col gap-4 mt-4 mx-[-16px]">
<a href="/terms/user-agreements">
<div class="card bg-base-100 w-full border-neutral border">
<div class="card-body">
<h2 class="card-title">用户协议</h2>
<p>使用 Solar Network 和 我们其他产品的用户须遵守的用户协议。</p>
</div>
</div>
</a>
<a href="/terms/privacy-policy">
<div class="card bg-base-100 w-full border-neutral border">
<div class="card-body">
<h2 class="card-title">隐私政策</h2>
<p>隐私政策向我们展示了如何处理和处理您提供的数据。</p>
</div>
</div>
</a>
</div>
</div>
</Layout>

View File

@ -0,0 +1,49 @@
---
import Layout from '@/layouts/Layout.astro'
---
<Layout title="User Agreements">
<div class="container max-w-[85ch] mx-auto mt-[25vh] flex flex-col gap-4">
<h1 class="text-4xl font-bold">隐私政策</h1>
<article class="prose prose-lg max-w-none mt-5">
<h2 id="introduction">简介</h2>
<p>
我们非常重视您的隐私。本隐私政策概述了我们收集的个人信息类型、使用方式以及我们采取的保护措施。
</p>
<h2 id="information-collection">信息收集</h2>
<p>
我们仅在提供服务时收集必要的个人信息。这可能包括您的姓名、电子邮件地址以及其他相关信息。
</p>
<h2 id="use-of-information">信息使用</h2>
<p>我们使用您的个人信息来:</p>
<ul>
<li>提供和改进我们的服务</li>
<li>与您沟通更新或重要信息</li>
<li>确保遵守法律义务</li>
</ul>
<h2 id="data-sharing">数据共享</h2>
<p>我们不会出售、交易或与第三方分享您的个人信息,法律要求除外。</p>
<h2 id="data-security">数据安全</h2>
<p>
我们实施了强有力的安全措施,以保护您的个人信息免受未经授权的访问、更改、披露或销毁。
</p>
<h2 id="your-rights">您的权利</h2>
<p>您有权:</p>
<ul>
<li>访问我们持有的关于您的个人信息</li>
<li>请求更正您的个人信息</li>
<li>请求删除您的个人信息</li>
</ul>
<h2 id="contact-us">联系我们</h2>
<p>
如果您对本隐私政策或我们的数据处理方式有任何疑问或顾虑,请通过
lily@solsynth.dev 与我们联系。
</p>
<h2 id="changes-to-this-policy">政策变更</h2>
<p>
我们可能会不时更新本隐私政策。任何更改将发布在此页面上,且我们会通知您任何重大更改。
</p>
</article>
</div>
</Layout>

View File

@ -0,0 +1,100 @@
---
import Layout from '@/layouts/Layout.astro'
---
<Layout title="User Agreements">
<div class="container max-w-[85ch] mx-auto mt-[25vh] flex flex-col gap-4">
<h1 class="text-4xl font-bold">用户协议</h1>
<article class="prose prose-lg max-w-none mt-5">
<p>
本协议适用于所有 Solsynth LLC 的产品,包括但不限于 Solar
Network、Solian、DietaryGuard、AceField。
</p>
<h2 id="provision-and-discontinuance-of-service">服务的提供和停止</h2>
<p>
Solsynth LLC 将向世界上所有的生物提供同等的服务,包括草履虫。
同时也保留向任意用户停止提供服务的权利。关于停止部分用户的服务,我们不需要提前通知。
</p>
<h2 id="user-generated-content">用户生成内容</h2>
<p>
任意发布在 Solar Network
上的内容(包括但不限于帖子、文章、附件)都默认授权 Solsynth LLC
予以展示的权利。
除非用户特别声明,所有内容均为原帖主保留所有权利,转载请先向原帖主授权。
</p>
<h3 id="reproduction-recognition">转载的认定</h3>
<p>无帖主特别声明,所有内容均适用本条转载的定义。</p>
<p>
转载指将原帖的内容原封不动或略作改动上传到别的平台或 Solar
Network。但同时转帖、嵌入式组件与展示展开的链接不构成转载。
转载即时在原帖主授权的情况下也需表明出处。
</p>
<h3 id="freedom-of-speech">言论的自由</h3>
<p>
除滥用资源的情况,我们不会将用户生成内容进行删除。也不会做出要求任何用户删除任何内容的要求。
</p>
<p>
但 Solsynth LLC
始终保留对于违反社区准则的内容(如淫秽、暴力、血腥、反社会、恐怖组织等)限制与停止向公众展示的权利。
</p>
<p>
尽管在 Solar Network 上你拥有 100%
的言论自由。但还请清楚,言论自由不代表不用对自己的言论负责。
</p>
<h4 id="restriction-and-discontinuation">限制展示与停止展示</h4>
<ul>
<li>
<p>
限制展示:停止相关的推送,但是任保留直接通过资源标识符和分享连接访问的权利
</p>
</li>
<li><p>停止展示:全面停止除作者之外任何人访问该资源的权利</p></li>
</ul>
<h2 id="resource-misuse-prevention-policy">防止资源滥用条例</h2>
<p>
尽管使用 Solar Network
的数据托管服务并无任何的容量限制,但经过判定的滥用资源将会被取消使用部分功能的权利。
并且之前上传的资源 Solsynth LLC 有权对其进行删除空间回收。
</p>
<h3 id="determination-of-misuse">滥用的认定</h3>
<ul>
<li>
传而不用:例如在 Solar Network 的 Interactive
附件池中过度上传附件并不将附件与帖子连接
</li>
<li>无意义帖:无意义洗版或浪费 Solar Network 的存储资源</li>
<li>
走错片场:将 Solar Network
公有资源当作自己的专用资源池使用(详见维基《专用资源池》页面)
</li>
</ul>
<p>滥用的认定最终解释权归属于 Solsynth Trust &amp; Safety Team</p>
<h2 id="secondary-releases">二次发布</h2>
<p>二次发布指将我们的资产下载并重新托管到别站。</p>
<h3 id="product-secondary-release">制品二次发布</h3>
<p>
除特殊声明Solsynth LLC
的产品均不允许二次发布,请勿将我们的产品构建下载并二次上传于其他站点。
<strong>二次作为商用发布更是不允许的。</strong>
</p>
<p>
你应该做的是将我们的产品链接贴上他站。或使用嵌入式组件。并且表明
Solsynth LLC 版权所有。
</p>
<p>若您想搭建我们制品的镜像站,请与我们取得联系以豁免此条例。</p>
<h3 id="secondary-distribution-of-source-code">源码二次发布</h3>
<pre><code>我们不允许任何形式的源码二次发布Fork 除外)。
</code></pre><p
>
包括但不限于,将 GitHub 或 Solsynth Code Repository 上的代码仓库镜像于
GitLab、Gitee 等其他 Git 提供者。
<strong>二次售卖源码更是不允许的。</strong>
</p>
<p>关于更多的源码使用条例,请遵循项目使用的开源许可证。</p>
<p>若您想搭建我们源码的镜像站,请与我们取得联系以豁免此条例。</p>
<hr />
<p>Solsynth LLC 保留对此协议的最终解释权</p>
</article>
</div>
</Layout>

View File

@ -1,5 +1,17 @@
{
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
"include": [
".astro/types.d.ts",
"**/*",
"src/**/*.d.ts",
"src/**/*.ts",
"src/**/*.astro"
],
"exclude": ["dist"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}