From c4fe6d9d8ff98c8a3094220d4937a8195d7efee8 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 5 May 2023 01:07:32 +0100 Subject: [PATCH] feat: init app router --- next-env.d.ts | 1 + next.config.js | 1 + package.json | 1 + pnpm-lock.yaml | 9 + src/app/(home)/EntranceButton.tsx | 32 ++ src/app/(home)/ShowcaseList.tsx | 66 +++ src/app/(home)/layout.tsx | 108 +++++ src/app/(home)/page.tsx | 491 ++++++++++++++++++++++ src/app/i18n/index.ts | 31 ++ src/app/i18n/locales/en/common.json | 5 + src/app/i18n/locales/en/dashboard.json | 5 + src/app/i18n/locales/en/index.json | 29 ++ src/app/i18n/locales/en/site.json | 4 + src/app/i18n/locales/ja/common.json | 59 +++ src/app/i18n/locales/ja/dashboard.json | 124 ++++++ src/app/i18n/locales/ja/index.json | 26 ++ src/app/i18n/locales/ja/site.json | 10 + src/app/i18n/locales/zh-TW/common.json | 87 ++++ src/app/i18n/locales/zh-TW/dashboard.json | 198 +++++++++ src/app/i18n/locales/zh-TW/index.json | 61 +++ src/app/i18n/locales/zh-TW/site.json | 18 + src/app/i18n/locales/zh/common.json | 87 ++++ src/app/i18n/locales/zh/dashboard.json | 204 +++++++++ src/app/i18n/locales/zh/index.json | 61 +++ src/app/i18n/locales/zh/site.json | 19 + src/app/i18n/settings.ts | 15 + src/app/layout.tsx | 43 ++ src/app/providers.tsx | 87 ++++ src/pages/_app.tsx | 5 +- src/pages/{index.tsx => index_b.tsx} | 0 tsconfig.json | 30 +- 31 files changed, 1908 insertions(+), 9 deletions(-) create mode 100644 src/app/(home)/EntranceButton.tsx create mode 100644 src/app/(home)/ShowcaseList.tsx create mode 100644 src/app/(home)/layout.tsx create mode 100644 src/app/(home)/page.tsx create mode 100644 src/app/i18n/index.ts create mode 100644 src/app/i18n/locales/en/common.json create mode 100644 src/app/i18n/locales/en/dashboard.json create mode 100644 src/app/i18n/locales/en/index.json create mode 100644 src/app/i18n/locales/en/site.json create mode 100644 src/app/i18n/locales/ja/common.json create mode 100644 src/app/i18n/locales/ja/dashboard.json create mode 100644 src/app/i18n/locales/ja/index.json create mode 100644 src/app/i18n/locales/ja/site.json create mode 100644 src/app/i18n/locales/zh-TW/common.json create mode 100644 src/app/i18n/locales/zh-TW/dashboard.json create mode 100644 src/app/i18n/locales/zh-TW/index.json create mode 100644 src/app/i18n/locales/zh-TW/site.json create mode 100644 src/app/i18n/locales/zh/common.json create mode 100644 src/app/i18n/locales/zh/dashboard.json create mode 100644 src/app/i18n/locales/zh/index.json create mode 100644 src/app/i18n/locales/zh/site.json create mode 100644 src/app/i18n/settings.ts create mode 100644 src/app/layout.tsx create mode 100644 src/app/providers.tsx rename src/pages/{index.tsx => index_b.tsx} (100%) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03d..fd36f949 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/next.config.js index 5c42f6aa..98d2e7c7 100644 --- a/next.config.js +++ b/next.config.js @@ -63,6 +63,7 @@ module.exports = withBundleAnalyzer( }, experimental: { scrollRestoration: true, + appDir: true, }, output: "standalone", productionBrowserSourceMaps: true, diff --git a/package.json b/package.json index 78d35f1e..52f3fdc3 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "hast-util-to-html": "^8.0.4", "hast-util-to-text": "^3.1.2", "i18next": "^22.4.15", + "i18next-resources-to-backend": "^1.1.3", "idb-keyval": "6.2.0", "immer": "10.0.1", "ioredis": "5.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4af1e37b..639d6c0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -136,6 +136,9 @@ dependencies: i18next: specifier: ^22.4.15 version: 22.4.15 + i18next-resources-to-backend: + specifier: ^1.1.3 + version: 1.1.3 idb-keyval: specifier: 6.2.0 version: 6.2.0 @@ -8978,6 +8981,12 @@ packages: resolution: {integrity: sha512-FTnj+UmNgT3YRml5ruRv0jMZDG7odOL/OP5PF5mOqvXud2vHrPOOs68Zdk6iqzL47cnnM0ZVkK2BAvpFeDJToA==} dev: false + /i18next-resources-to-backend@1.1.3: + resolution: {integrity: sha512-iDJITrMHoKLUa3B2wippgH62yM4f4wCEofeTj55rML9i7QrMDGKdr8FGCnSNNxRQzvW4546Qx6v2/xY3dAhvUA==} + dependencies: + '@babel/runtime': 7.21.5 + dev: false + /i18next@22.4.15: resolution: {integrity: sha512-yYudtbFrrmWKLEhl6jvKUYyYunj4bTBCe2qIUYAxbXoPusY7YmdwPvOE6fx6UIfWvmlbCWDItr7wIs8KEBZ5Zg==} dependencies: diff --git a/src/app/(home)/EntranceButton.tsx b/src/app/(home)/EntranceButton.tsx new file mode 100644 index 00000000..57aa745d --- /dev/null +++ b/src/app/(home)/EntranceButton.tsx @@ -0,0 +1,32 @@ +"use client" + +import { useRouter } from "next/navigation" + +import { useAccountState } from "@crossbell/connect-kit" + +import { Button } from "~/components/ui/Button" + +export default function EntranceButton() { + const router = useRouter() + const isConnected = useAccountState((s) => !!s.computed.account) + + return ( + + ) +} diff --git a/src/app/(home)/ShowcaseList.tsx b/src/app/(home)/ShowcaseList.tsx new file mode 100644 index 00000000..e2fb4241 --- /dev/null +++ b/src/app/(home)/ShowcaseList.tsx @@ -0,0 +1,66 @@ +"use client" + +import { CharacterEntity } from "crossbell.js" +import { useState } from "react" + +import { CharacterFloatCard } from "~/components/common/CharacterFloatCard" +import { Image } from "~/components/ui/Image" +import { UniLink } from "~/components/ui/UniLink" +import { getSiteLink } from "~/lib/helpers" + +export default function ShowcaseList({ sites }: { sites?: CharacterEntity[] }) { + const [showcaseMore, setShowcaseMore] = useState(false) + + return ( +
    +
    setShowcaseMore(true)} + > + {/* {t("Show more")} */} + Show more +
    + {sites?.map((site) => ( +
  • + + + + {site.handle} + + + + + {site.metadata?.content?.name} + + {site.metadata?.content?.bio && ( + + {site.metadata.content?.bio} + + )} + + +
  • + ))} +
+ ) +} diff --git a/src/app/(home)/layout.tsx b/src/app/(home)/layout.tsx new file mode 100644 index 00000000..ec790ddb --- /dev/null +++ b/src/app/(home)/layout.tsx @@ -0,0 +1,108 @@ +import { useTranslation } from "next-i18next" +import { usePathname } from "next/navigation" + +import { ConnectButton } from "~/components/common/ConnectButton" +import { DarkModeSwitch } from "~/components/common/DarkModeSwitch" +import { Logo } from "~/components/common/Logo" +import { Image } from "~/components/ui/Image" +import { UniLink } from "~/components/ui/UniLink" +import { APP_NAME, DISCORD_LINK, GITHUB_LINK, TWITTER_LINK } from "~/lib/env" +import { getSiteLink } from "~/lib/helpers" +import { cn } from "~/lib/utils" + +const tabs = [ + { + name: "Home", + link: "/", + }, + { + name: "Activities", + link: "/activities", + }, + { + name: ( + github stars + ), + link: GITHUB_LINK, + }, +] + +export function HomeLayout({ children }: { children?: React.ReactNode }) { + const { t } = useTranslation("index") + const pathname = usePathname() + + return ( + <> +
+
+ +
+ +
+ xLog +
+
+ {tabs?.map((tab, index) => ( + + ))} + +
+
+
+ {children} +
+
+ + {GITHUB_LINK && ( + + + + )} + {DISCORD_LINK && ( + + + + )} + {TWITTER_LINK && ( + + + + )} + + + + + ©{" "} + + {APP_NAME} + + + +
+
+ + ) +} diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx new file mode 100644 index 00000000..9953ee36 --- /dev/null +++ b/src/app/(home)/page.tsx @@ -0,0 +1,491 @@ +import { Trans, useTranslation } from "next-i18next" +import { useRouter } from "next/navigation" +import { Element, Link } from "react-scroll" + +import { + CrossbellChainLogo, + XCharLogo, + XFeedLogo, + XShopLogo, + XSyncLogo, +} from "@crossbell/ui" +import { RssIcon } from "@heroicons/react/24/outline" + +import { FollowAllButton } from "~/components/common/FollowAllButton" +import { Logo } from "~/components/common/Logo" +import { Button } from "~/components/ui/Button" +import { Image } from "~/components/ui/Image" +import { Tooltip } from "~/components/ui/Tooltip" +import { UniLink } from "~/components/ui/UniLink" +import { APP_DESCRIPTION, APP_NAME, CSB_SCAN, GITHUB_LINK } from "~/lib/env" +import { getSiteLink } from "~/lib/helpers" +import { useGetShowcase } from "~/queries/home" + +import EntranceButton from "./EntranceButton" +import ShowcaseList from "./ShowcaseList" + +export const metadata = { + title: APP_NAME, + description: APP_DESCRIPTION, +} + +function Home() { + const router = useRouter() + const showcaseSites = useGetShowcase() + const { t } = useTranslation("index") + + const tryNow = () => { + router.push("/dashboard") + } + + const features: { + title: string + subfeatures: { + screenshot?: { + src: string + } + icon: string + title: string + }[] + extra?: boolean + }[] = [ + { + title: "Write", + subfeatures: [ + { + screenshot: { + src: "/assets/easy.png", + }, + icon: "🤪", + title: "Easy to get started", + }, + { + screenshot: { + src: "/assets/experience.png", + }, + icon: "😆", + title: "Elegant experience", + }, + { + screenshot: { + src: "/assets/fast.png", + }, + icon: "🚀", + title: "Fast", + }, + ], + }, + { + title: "Own", + subfeatures: [ + { + screenshot: { + src: "/assets/safe.png", + }, + icon: "🔒", + title: "Safe", + }, + { + screenshot: { + src: "/assets/customizable.png", + }, + icon: "🎨", + title: "Customizable", + }, + { + screenshot: { + src: "/assets/open.png", + }, + icon: "🌐", + title: "Open", + }, + ], + extra: true, + }, + { + title: "Earn", + subfeatures: [ + { + icon: "🪙", + title: "Creator Incentives", + }, + { + icon: "🏟️", + title: "DAO", + }, + ], + }, + ] + + const integrations = [ + { + name: "RSS", + icon: , + url: + getSiteLink({ + subdomain: "xlog", + }) + "/feed?format=xml", + }, + { + name: "JSON Feed", + icon: JSON Feed, + url: + getSiteLink({ + subdomain: "xlog", + }) + "/feed", + }, + { + name: "xChar", + icon: , + url: "https://xchar.app/", + }, + { + name: "xFeed", + icon: , + url: "https://crossbell.io/feed", + }, + { + name: "xSync", + icon: , + url: "https://xsync.app/", + }, + { + name: "xShop", + icon: , + text: "Coming soon", + }, + { + name: "Crossbell Scan", + icon: , + url: "https://scan.crossbell.io/", + }, + { + name: "Crossbell Faucet", + icon: , + url: "https://faucet.crossbell.io/", + }, + { + name: "Crossbell Export", + icon: , + url: "https://export.crossbell.io/", + }, + { + name: "Crossbell SDK", + icon: , + url: "https://crossbell-box.github.io/crossbell.js/", + }, + { + name: "RSS3", + icon: ( + RSS3 + ), + url: "https://rss3.io/", + }, + { + name: "Hoot It", + icon: ( + Hoot It + ), + url: "https://hoot.it/search/xLog", + }, + { + name: "Raycast", + icon: Raycast, + url: "https://www.raycast.com/Songkeys/crossbell", + }, + { + name: "Obsidian", + icon: ( + Obsidian + ), + text: "Coming soon", + }, + ] + + return ( +
+
+

+ {features.map((feature) => ( + + {t(feature.title)} + {t(".")} + + ))} +

+

+ + xLog is the best{" "} + + on-chain + {" "} + and{" "} + + open-source + {" "} + blogging community for everyone. + +

+
+ + +
+
+ {t("Explore the xLog way")} + +
+
+
+ + {features.map((feature, index) => ( +
+
+
+
+ {index + 1} +
+

+ {t(feature.title)} +

+

+ {t(`features.${feature.title}.subtitle`)} +

+

+ + . + + ), + }} + ns="index" + /> +

+
+
    + {feature.subfeatures.map((item) => ( +
  • + {item.screenshot?.src && ( +
    + {item.title} +
    + )} +

    + {item.icon} + + {t(item.title)} + +

    +

    + , + axfm: ( + + . + + ), + aincentive: ( + + . + + ), + }} + ns="index" + /> +

    +
  • + ))} +
+ {feature.extra && ( +
+
+ 🤫{" "} + + {t(`features.${feature.title}.extra.title`)} + +
+
{t(`features.${feature.title}.extra.description`)}
+ +
+ )} +
+ ))} +
+ +
+ {t("Showcase")} +
+
+

+ {t( + "Discover these awesome teams and creators on xLog (sorted by update time)", + )} +

+ s.characterId) + .filter(Boolean) + .map(Number)} + siteIds={showcaseSites.data?.map( + (s: { handle: string }) => s.handle, + )} + /> + +
+
+ +
+ {t("Integration")} +
+
+

+ {t( + "xLog's open design allows it to integrate with many other open protocols and applications without friction.", + )} +

+
    + {integrations.map((item, index) => ( +
  • + {item.url ? ( + +
    + {item.icon} +
    +
    + {item.name} +
    +
    + ) : ( + +
    +
    + {item.icon} +
    +
    + {item.name} +
    +
    +
    + )} +
  • + ))} +
  • + +
  • +
+
+
+
+
+
+ +
+ {/* {isConnected ? ( + + + + ) : ( + + )} */} + +
+
+ ) +} + +export default Home diff --git a/src/app/i18n/index.ts b/src/app/i18n/index.ts new file mode 100644 index 00000000..5bc9f30a --- /dev/null +++ b/src/app/i18n/index.ts @@ -0,0 +1,31 @@ +import { createInstance } from "i18next" +import resourcesToBackend from "i18next-resources-to-backend" +import { initReactI18next } from "react-i18next/initReactI18next" + +import { getOptions } from "./settings" + +const initI18next = async (lng: string, ns: string) => { + const i18nInstance = createInstance() + await i18nInstance + .use(initReactI18next) + .use( + resourcesToBackend( + (language: string, namespace: string) => + import(`./locales/${language}/${namespace}.json`), + ), + ) + .init(getOptions(lng, ns)) + return i18nInstance +} + +export async function useTranslation( + lng: string, + ns: string, + options: { keyPrefix?: string } = {}, +) { + const i18nextInstance = await initI18next(lng, ns) + return { + t: i18nextInstance.getFixedT(lng, ns, options.keyPrefix), + i18n: i18nextInstance, + } +} diff --git a/src/app/i18n/locales/en/common.json b/src/app/i18n/locales/en/common.json new file mode 100644 index 00000000..34fbe517 --- /dev/null +++ b/src/app/i18n/locales/en/common.json @@ -0,0 +1,5 @@ +{ + "intlDateTime": "{{val, datetime}}", + "ago": "{{time}} ago", + "joined ago": "Joined {{time}} ago" +} \ No newline at end of file diff --git a/src/app/i18n/locales/en/dashboard.json b/src/app/i18n/locales/en/dashboard.json new file mode 100644 index 00000000..7a21d580 --- /dev/null +++ b/src/app/i18n/locales/en/dashboard.json @@ -0,0 +1,5 @@ +{ + "link post-vs-page" : "https://wordpress.com/zh-cn/support/post-vs-page/", + "delete_confirmation_post": "Are you sure you want to DELETE this post?", + "delete_confirmation_page": "Are you sure you want to DELETE this page?" +} \ No newline at end of file diff --git a/src/app/i18n/locales/en/index.json b/src/app/i18n/locales/en/index.json new file mode 100644 index 00000000..4ef89d59 --- /dev/null +++ b/src/app/i18n/locales/en/index.json @@ -0,0 +1,29 @@ +{ + "features": { + "Write": { + "subtitle": "Write when inspiration strikes", + "description": "Frees you from time-consuming, unnecessary processes that slow your writing, so you and your team can focus on creating." + }, + "Own": { + "subtitle": "Own content on the blockchain", + "description": "You own your content by publishing content on the Crossbell blockchain. xLog won't store any data and can't take away or modify your rights and content, even if xLog wanted to. Learn how Crossbell works.", + "extra": { + "title": "Don't Trust, Verify", + "description": "It's a good habit not to trust anyone easily on the Internet, including xLog. Therefore, we strongly recommend that you visit any site on xLog, check the transaction history at the bottom of the page, read the blockchain contract code, and verify for yourself what xLog claims.", + "button": "Verify it" + } + }, + "Earn": { + "subtitle": "Earn tokens and rights", + "description": "Great content deserves to be rewarded, and a blockchain offers the wonderful opportunity for creators to be rewarded transparently and fairly. An xLog DAO will further promote the growth of our community." + } + }, + "Easy to get started text": "xLog supports web3 wallets and email connections, allowing you to quickly create a customized blog with features like a custom domain, subscriptions, comments, NFT minting, RSS feeds, and AI enhancements in just 5 minutes - with no application or costs required.", + "Elegant experience text": "xLog offers a dual-pane editor with real-time preview for an excellent writing experience, using standard Markdown syntax with support for HTML, audio/video, and math expressions. The elegantly designed page provides a comfortable reading experience for readers.", + "Fast text": "Blockchain doesn't always mean low efficiency. xLog operates at peak performance thanks to its efficient caching mechanism and numerous optimizations. The site also supports PWA for local installation and use.", + "Safe text": "All blog data, including configs, posts, subscriptions, comments, etc., are signed and securely stored on the blockchain with your own hands, with control only accessible through the private key held by yourself. No one else, including xLog, can make any changes.", + "Customizable text": "You're free to use your own domain, customize your website, and design it in any way you like. This is your website, with no restrictions. xLog encourage and will provide a rich system of themes and plugins to help you customize it.", + "Open text": "xLog offers import and export tools, as well as rich APIs and third-party integrations. All code is open source on GitHub, and all data is transparent on the blockchain. xLog has nothing to hide.", + "Creator Incentives text": "In the early stages, xLog provides incentives in MIRA. We are actively constructing the tokenomics to ensure xLog remain the best place to publish high-quality content.", + "DAO text": "An xLog DAO will be in place, where creators vote with tokens." +} diff --git a/src/app/i18n/locales/en/site.json b/src/app/i18n/locales/en/site.json new file mode 100644 index 00000000..0fe088ce --- /dev/null +++ b/src/app/i18n/locales/en/site.json @@ -0,0 +1,4 @@ +{ + "load more": "There are {{count}} more {{name}}, click to load more", + "signed and stored on the blockchain": "Ownership of this {{name}} data is guaranteed by blockchain and smart contracts to the creator alone." +} \ No newline at end of file diff --git a/src/app/i18n/locales/ja/common.json b/src/app/i18n/locales/ja/common.json new file mode 100644 index 00000000..2dd0cc98 --- /dev/null +++ b/src/app/i18n/locales/ja/common.json @@ -0,0 +1,59 @@ +{ + "Connect": "接続", + "Followers": "フォロワー", + "Following": "フォロー中", + "Followings": "フォロー済", + "Follow": "フォローする", + "Unfollow": "フォローを外す", + "intlDateTime": "{{val, datetime}}", + "post": "文章", + "posts": "文章", + "page": "ページ", + "pages": "ページ", + "comment": "コメント", + "comments": "コメント", + "Comment": "コメント", + "Comments": "コメント", + "reply": "返信", + "replies": "返信", + "like": "いいね", + "likes": "いいね", + "blog": "ブログ", + "Owner": "所有者", + "Transaction Hash": "取引ハッシュ", + "IPFS Address": "IPFS アドレス", + "Creation": "作成", + "Last Update": "最後更新", + "Create Character": "新規キャラクター", + "Submit": "送信", + "Reply": "返信", + "Cancel Reply": "キャンセル", + "ago": "{{time}}前", + "joined ago": "{{time}}に参加した", + "Mint to an NFT": "NFTとしてミント", + "Like successfully": "いいね済", + "Mint successfully": "ミント済", + "like stored": "いいねは安全にブロックチェーンに保存されました。 <2>Crossbell Scan で確認できます。", + "mint stored": "この記事をNFTとしてミントしました。 <2>xChar または <6>Crossbell Scan で確認できます。", + "Got it, thanks!": "了解しました、ありがとうございます!", + "Like List": "いいねリスト", + "Mint List": "ミントリスト", + "Revert": "退会済み", + "Confirm to revert": "退会確認", + "like revert": "このライクアクションを撤回したい場合は、チェックしてください。", + "Cancel": "キャンセル", + "Confirm": "確認", + "No Content Yet.": "まだ何もありません。", + "Close": "閉じる", + "Dashboard": "ダッシュボード", + "Copied!": "コピーしました!", + "Operator Sign": "オペレーター署名", + "Switch Characters": "キャラクターを切り替える", + "Upgrade to Wallet": "ウォレットにアップグレード", + "Disconnect": "中断する", + "Loading": "読み込み中", + "Showcase": "ショーケース", + "AI-generated summary": "AIが生成した要約", + "Generating": "生成中", + "Show more": "もっと表示する" +} diff --git a/src/app/i18n/locales/ja/dashboard.json b/src/app/i18n/locales/ja/dashboard.json new file mode 100644 index 00000000..e33daacd --- /dev/null +++ b/src/app/i18n/locales/ja/dashboard.json @@ -0,0 +1,124 @@ +{ + "Dashboard": "ダッシュボード", + "Posts": "文章", + "Pages": "ページ", + "Notifications": "通知", + "Unread notifications": "未読の通知", + "Settings": "設定", + "Site Stats": "サイトの統計情報", + "Total Posts": "記事数", + "Total Comments": "コメント数", + "Total Followers": "フォロワー数", + "Total Views": "閲覧数", + "Site Duration": "サイトの運営期間", + "days": "日", + "Deleted!": "削除されました!", + "Fail to Deleted.": "削除できませんでした。", + "Converted!": "変換されました!", + "Failed to convert.": "変換に失敗しました。", + "All Posts": "すべての記事", + "All Pages": "すべてのページ", + "Published": "公開済み", + "published": "公開済み", + "Draft": "下書き", + "draft": "下書き", + "Scheduled": "予約済み", + "scheduled": "予約済み", + "published and local modified": "公開済みで、ローカルでの編集あり", + "link post-vs-page": "https://wordpress.com/ja/support/post-vs-page/", + "posts description": "記事は、時間順に表示されます。読者に新しいコンテンツを提供し続けることで、ブログのフォローワが増えるでしょう。<2>記事", + "pages description": "ページは日付に影響を受けることがありません。「私たちについて」「お問い合わせ」などのようにページを活用しましょう。<2>ページ", + "pages add": "ページを作成した後、<2>ナビゲーションメニューに追加することができます。ナビゲーションメニューに追加することで訪問者がそれを見つけやすくなります。", + "New Post": "新しい記事", + "New Page": "新しいページ", + "Import": "インポート", + "Import markdown file with front matter supported": "Markdown ファイル(Front Matter)をインポートします。", + "View Site": "サイトを表示", + "hello": { + "welcome": "

こんにちは、

xLog をご利用いただきありがとうございます!

xLog を使い始めるためのいくつかの便利なリンクが以下にあります。

", + "community": "

コミュニティに参加して、新しい友達を作ったり、xLog を一緒に作り上げたりしましょう。

" + }, + "Convert to Page": "ページに変換", + "Convert to Post": "記事に変換", + "Select All": "すべて選択", + "Deselect All": "選択解除", + "Delete": "削除", + "Heading": "見出し", + "Bold": "太字", + "Italic": "斜体", + "Strikethrough": "取り消し線", + "Underline": "下線", + "Quote": "引用", + "Inline Code": "インラインコード", + "Code Block": "コードブロック", + "Unordered List": "箇条書き", + "Ordered List": "番号付きリスト", + "Link": "リンク", + "Image": "画像", + "Upload Image": "画像をアップロード", + "Tip: xLog Flavored Markdown": "ヒント:xLog 風のマークダウン", + "Preview": "プレビュー", + "Publish": "公開", + "Update": "更新", + "Discard Changes": "変更を破棄", + "Publish at": "公開日時", + "This post will be accessible from this time": "この記事は、この時間からアクセス可能になります", + "This page will be accessible from this time": "このページは、この時間からアクセス可能になります", + "Post slug": "記事スラッグ", + "Page slug": "ページスラッグ", + "This post will be accessible at": "この記事は以下のリンクからアクセス可能になります", + "This page will be accessible at": "このページは以下のリンクからアクセス可能になります", + "Tags": "タグ", + "Separate multiple tags with English commas": "複数のタグを半角のコンマ(,)で区切って入力してください", + "Excerpt": "抜粋", + "Leave it blank to use auto-generated excerpt": "自動生成された抜粋を使用する場合は空白のままにしてください", + "General": "一般", + "Social Platforms": "ソーシャルプラットフォーム", + "Navigation": "ナビゲーション", + "Domains": "ドメイン", + "Custom CSS": "カスタム CSS", + "Operators": "オペレーター", + "Export data": "データのエクスポート", + "Site Settings": "サイト設定", + "Icon": "アイコン", + "Banner": "バナー", + "Supports both pictures and videos.": "画像と動画の両方に対応しています。", + "Name": "名前", + "Description": "説明", + "Integrate Google Analytics": "Google Analytics と紐付けします。Measurement ID の検索方法については、<2>こちらの文章をご覧ください。", + "Integrate Umami Cloud Analytics": "Umami Cloud Analytics と紐付けします。Website ID の検索方法については、<2>こちらの文章をご覧ください。", + "Save": "保存", + "Tips": "ヒント", + "social tips": { + "p1": "紐付けしたプラットフォームの標識は、画面の右下隅に表示されます。", + "p2": "xLog は<2>こちらのプラットフォームと紐付け可能です。(紐付けに成功すると自動的にそのロゴとリンクが表示されます。)その他のプラットフォームの場合、デフォルトのロゴが表示されます。もしサポートして欲しいプラットフォームがありましたら、是非 Issue あるいは PR を作成して、xLog をより完成度の高いプラットフォームにさせましょう。", + "p3": "<2>xSyncを使用して、Twitter、Telegram、Medium、Substack などのプラットフォームに紐付けし、コンテンツを自動的に同期することもできます。同期設定を行った場合、ここにも表示されます。" + }, + "Platform": "プラットフォーム", + "Identity": "アイデンティティ", + "Remove": "削除", + "New Item": "新しいアイテム", + "xLog provides some out-of-the-box built-in pages": "xLog にはいくつすぐ使えるページテンプレートがあります。", + "Home page": "ホームページ", + "Archives page": "アーカイブページ", + "Tag page": "タグページ", + "NFT Showcase page": "NFT ショーケースページ", + "Label": "ラベル", + "URL": "URL", + "subdomain": "サブドメイン", + "Custom Domain": "カスタムドメイン", + "Set the following record on your DNS provider to active your custom domain": "カスタムドメインを有効にするには、DNS プロバイダーに次のレコードを設定してください。", + "Scope: These styles will be applied to your entire blog, including this dashboard.": "適用範囲:これらのスタイルは、このダッシュボードを含むブログ全体に適用されます。", + "Support": "サポート", + "CSS variables: xLog provides some built-in CSS variables": "CSS 変数:xLog はいくつかのビルトイン CSS 変数を提供しています。", + "Address": "住所", + "Character": "キャラクター", + "New operator": "新しいオペレーター", + "Operator Address": "オペレーターアドレス", + "Operator Character Check": "オペレーターキャラクターチェック", + "Warning": "警告", + "Operators have permissions to enter your dashboard, change your settings(excluding xLog subdomain) and post, modify, delete contents on your site.": "シャドー認証では、ダッシュボードへのアクセス、設定の変更(xLog サブドメインを除く)、サイトのコンテンツの公開・修正・削除が可能です。", + "Add": "新規", + "delete_confirmation_post": "この記事を削除してもよろしいですか?", + "delete_confirmation_page": "このページを削除してもよろしいですか?" +} \ No newline at end of file diff --git a/src/app/i18n/locales/ja/index.json b/src/app/i18n/locales/ja/index.json new file mode 100644 index 00000000..057af974 --- /dev/null +++ b/src/app/i18n/locales/ja/index.json @@ -0,0 +1,26 @@ +{ + "Blog Free": "自由に創作する", + "description": "<0>xLogは、誰でもが利用できる<3>ブロックチェーン上の<7>オープンソースのブログコミュニティです。", + "Get my xLog in 5 minutes": "5分で自分のxLogを手に入れよう", + "Features": "特徴", + "Showcase": "ショーケース", + "Integration": "統合", + "Source Code": "ソースコード", + "Visit": "訪問", + "Easy": "簡単", + "Easy description": "Web3ウォレットまたはメールアドレスで接続し、カスタムドメイン、サブスクリプション、いいね、コメント、NFT鋳造、RSSなどの機能を備えた個人のウェブサイトを簡単に構築できます。料金や制限は一切ありません。", + "Safe": "安全", + "Safe description": "構成、記事、サブスクリプション、コメントなど、すべてのブログデータは、あなた自身が署名してブロックチェーンに安全に保存されます。あなた以外の誰も変更できないようになっています。", + "Fast": "高速", + "Fast description": "ブロックチェーンが低速を意味するわけではありません。xLogは、高速なキャッシュメカニズムと多数の最適化措置を採用し、極限のパフォーマンスを発揮します。", + "Customizable": "カスタマイズ可能", + "Customizable description": "自分のドメインを使用し、ウェブサイトのスタイルをカスタマイズし、完全に自由にウェブサイトを作成できます。これはあなたのウェブサイトであり、何の制限もありません。", + "Open": "オープン", + "Open description": "標準的なMarkdown構文を採用し、インポート/エクスポートツールと豊富なAPIを提供することで、移行が簡単になりました。すべてのコードはGitHubでオープンソースであり、すべてのデータが透明にブロックチェーンに保存されます。", + "Discover these awesome teams and creators on xLog (sorted by update time)": "xLogでこれらの素晴らしいチームやクールな人たちを発見しましょう(更新時間順)", + "Follow All!": "すべてをフォローする!", + "Show more": "もっと表示する", + "Submit yours": "自分のを投稿する", + "xLog's open design allows it to integrate with many other open protocols and applications without friction.": "xLogのオープンな設計により、他の多くのオープンプロトコルやアプリケーションとスムーズに統合することができます。", + "Dashboard": "ダッシュボード" +} \ No newline at end of file diff --git a/src/app/i18n/locales/ja/site.json b/src/app/i18n/locales/ja/site.json new file mode 100644 index 00000000..626c40f4 --- /dev/null +++ b/src/app/i18n/locales/ja/site.json @@ -0,0 +1,10 @@ +{ + "Home": "ホーム", + "Archives": "アーカイブ", + "About": "紹介", + "Tags": "タグ", + "load more": "まだ{{count}}件の{{name}}があります。", + "signed and stored on the blockchain": "{{name}}は、創作者によって署名され、ブロックチェーンに安全に保存されています。", + "Write a comment on the blockchain": "ブロックチェーンでコメントする", + "powered by": "このサイトは  によって作動します" +} diff --git a/src/app/i18n/locales/zh-TW/common.json b/src/app/i18n/locales/zh-TW/common.json new file mode 100644 index 00000000..37245f2e --- /dev/null +++ b/src/app/i18n/locales/zh-TW/common.json @@ -0,0 +1,87 @@ +{ + "Connect": "連線", + "Followers": "粉絲", + "Following": "追蹤中", + "Followings": "追蹤中", + "Follow": "追蹤", + "Unfollow": "取消追蹤", + "intlDateTime": "{{val, datetime}}", + "post": "文章", + "posts": "文章", + "page": "頁面", + "pages": "頁面", + "comment": "留言", + "comments": "留言", + "Comment": "留言", + "Comments": "留言", + "reply": "回覆", + "replies": "回覆", + "like": "讚", + "likes": "讚", + "blog": "部落格", + "Owner": "擁有者", + "Transaction Hash": "交易雜湊值", + "IPFS Address": "IPFS 位址", + "BNB Greenfield Address": "BNB Greenfield 位址", + "Creation": "創建", + "Last Update": "最後更新", + "Create Character": "創建身份", + "Submit": "提交", + "Reply": "回覆", + "Cancel Reply": "取消回覆", + "Edit": "編輯", + "Cancel Edit": "取消編輯", + "Confirm Modification": "確認編輯", + "ago": "{{time}}前", + "joined ago": "{{time}}前加入", + "obtained ago": "{{time}}前獲得", + "Like": "點讚", + "Mint to an NFT": "珍藏為 NFT", + "Like successfully": "點讚成功", + "Mint successfully": "珍藏完成~", + "like stored": "你的點讚已被安全地儲存在區塊鏈上,可以在 <2>Crossbell Scan 上查看", + "mint stored": "你已將這篇文章珍藏成 NFT,可以在 <2>xChar 或 <6>Crossbell Scan 上查看", + "Got it, thanks!": "知道啦,感恩的心~", + "Like List": "按讚列表", + "Mint List": "珍藏列表", + "Revert": "收回", + "Confirm to revert": "確定收回", + "like revert": "請確定是否想要收回這個點讚操作?", + "Cancel": "算了", + "Confirm": "確定", + "No Content Yet.": "什麼都沒", + "Close": "關閉", + "Dashboard": "主控臺", + "Copied!": "拷貝完成", + "Operator Sign": "簽名授權", + "Switch Characters": "切換身份", + "Upgrade to Wallet": "升級為錢包認證", + "Disconnect": "中斷連線", + "Loading": "載入中...", + "Showcase": "展示櫃", + "AI-generated summary": "AI 生成的摘要", + "Generating": "生成中...", + "Show more": "顯示更多", + "Patron": "贊助", + "Become a patron of {{name}}": "成為 {{name}} 的贊助者", + "Latest patrons": "最新贊助者", + "Latest tipper": "最新贊助者", + "You are here to be the first patron.": "你是第一位贊助者。", + "You are here to be the first tipper.": "你是第一位贊助者。", + "Select a tier": "選擇一個等級", + "One-time": "一次性", + "Monthly and NFT Rewards": "每月和 NFT 獎勵", + "Coming soon": "即將推出", + "What is MIRA? Where can I get some?": "MIRA 是什麼?能吃嗎?我在哪裡可以獲得?", + "Tip": "贊助", + "Tip the post: {{name}}": "贊助文章:{{name}}", + "Custom": "自訂", + "Mintable": "Mintable", + "Successfully followed": "嘿!你已經開始<2>追蹤他們的最新動態囉。", + "Enable AI Filtering": "AI 過濾", + "Filter out possible low-quality content based on AI ratings.": "基於 AI 評分過濾可能不佳的內容", + "Refreshing": "重新載入中", + "Search for your interest": "搜你所想", + "results": "項結果", + "My xLog": "你的 xLog" +} \ No newline at end of file diff --git a/src/app/i18n/locales/zh-TW/dashboard.json b/src/app/i18n/locales/zh-TW/dashboard.json new file mode 100644 index 00000000..514b3dc3 --- /dev/null +++ b/src/app/i18n/locales/zh-TW/dashboard.json @@ -0,0 +1,198 @@ +{ + "Dashboard": "洞察", + "Posts": "文章", + "Pages": "頁面", + "Notifications": "通知", + "Unread notifications": "未讀通知", + "Settings": "設定", + "Events": "活動", + "New Events": "新活動", + "Site Stats": "網站統計", + "Published posts": "文章", + "Received comments": "留言", + "Followers": "粉絲", + "Viewed": "瀏覽量", + "Received tips": "Donate", + "Site Duration": "Blog 誕生", + "days": "天", + "Deleted!": "刪掉了哦!", + "Fail to Deleted.": "删除失败", + "Converted!": "轉換成功!", + "Failed to convert.": "轉換失敗。", + "All Posts": "所有文章", + "All Pages": "所有頁面", + "Published": "已發佈", + "published": "已發佈", + "Draft": "草稿", + "draft": "草稿", + "Scheduled": "定時發佈", + "scheduled": "定時發佈", + "published and local modified": "已發佈且有尚未更新的內容", + "link post-vs-page": "https://wordpress.com/zh-tw/support/post-vs-page/", + "posts description": "文章是按時間倒序在你的網站上列出的條目。可以將它們看作是更新,以提供新內容給讀者。<2>文章與頁面。", + "pages description": "頁面是靜態的,不受日期影響。它們更像是你網站上的永久元素,比如“關於我們”、“聯繫我們”等。 <2>文章與頁面。", + "pages add": "創建頁面後,你可以將其<2>添加到你網站的導航菜單中,以便瀏覽者可以找到它。", + "New Post": "新建文章", + "New Page": "新建頁面", + "Import": "匯入", + "Import markdown file with front matter supported": "匯入 Markdown 文件(支持 Front Matter)", + "View Site": "查看網站", + "hello": { + "welcome": "

👋 你好哇,

歡迎使用 xLog!

以下是一些有用的連結,幫助你開始使用 xLog:

", + "hidden": "👋 你好哇", + "community": "

加入我們的社區,認識新朋友或給予 xLog 協助:

" + }, + "Edit": "編輯 ", + "Convert to Page": "轉換為頁面", + "Convert to Post": "轉換為文章", + "Select All": "全部選擇", + "Deselect All": "取消選擇", + "Delete": "刪除", + "Heading": "標題", + "Bold": "粗體", + "Italic": "斜體", + "Strikethrough": "刪除線", + "Underline": "底線", + "Quote": "引用", + "Inline Code": "行內程式碼", + "Code Block": "程式碼區塊", + "Unordered List": "無序列表", + "Ordered List": "有序列表", + "Link": "連結", + "Image": "圖片", + "Upload Image": "上傳圖片", + "Help: xLog Flavored Markdown": "幫助:xLog 風格的 Markdown", + "Preview": "預覽", + "Publish": "發布", + "Update": "更新", + "Discard Changes": "捨棄變更", + "Publish at": "發布時間", + "This post will be accessible from this time": "此文章將從此時間開始可瀏覽", + "This page will be accessible from this time": "此頁面將從此時間開始可瀏覽", + "Post slug": "文章短連結", + "Page slug": "頁面短連結", + "This post will be accessible at": "此文章將可通過以下連結瀏覽", + "This page will be accessible at": "此頁面將可通過以下連結瀏覽", + "Tags": "標籤", + "Separate multiple tags with English commas": "多個標籤請用英文逗號分隔", + "Excerpt": "摘要", + "Leave it blank to use auto-generated excerpt": "留空則使用自動生成的摘要", + "General": "一般", + "Social Platforms": "社交媒體", + "Navigation": "導航", + "Domains": "網域", + "Custom CSS": "自定義 CSS", + "Operators": "身份授權", + "Export data": "匯出資料", + "Site Settings": "網站設置", + "Icon": "圖標", + "Banner": "橫幅", + "Supports both pictures and videos.": "支持圖片和影片。", + "Name": "名稱", + "Description": "自我介紹", + "Integrate Google Analytics": "將 Google Analytics 整合至你的網站中。請按照<2>這裡的說明查找你的 Measurement ID。", + "Integrate Umami Cloud Analytics": "將 Umami Cloud Analytics 整合至你的網站中。請按照<2>這裡的說明查找你的 Website ID。", + "Save": "儲存", + "Tips": "提示", + "social tips": { + "p1": "這些社交平台會顯示在你的 xLog 的右下角。", + "p2": "我們支援<2>這些平台,自動顯示其標誌和連結。對於其他平台,將顯示預設標誌。如果你有其他需求,請隨時向我們提交問題或PR,以支援更多的平台。", + "p3": "你還可以在 <2>xSync 上連接到 Twitter、Telegram 頻道、Medium、Substack 等平台,並自動同步內容。當你在那裡設置同步後,它也會顯示在這裡。" + }, + "Platform": "平台", + "Identity": "身份", + "Remove": "移除", + "New Item": "新建項目", + "xLog provides some out-of-the-box built-in pages": "xLog 提供了一些開箱即用的內建頁面", + "Home page": "首頁", + "Archives page": "封存頁面", + "Tag page": "標籤頁面", + "NFT Showcase page": "NFT 展示頁面", + "Label": "標籤", + "URL": "連結", + "subdomain": "子網域", + "Custom Domain": "自訂網域", + "Set the following record on your DNS provider to active your custom domain": "在你的 DNS 提供商上設定以下紀錄以啟用自訂網域", + "Scope: These styles will be applied to your entire blog, including this dashboard.": "範圍:這些樣式將套用至你的整個部落格,包括此儀表板。", + "Support": "支援", + "CSS variables: xLog provides some built-in CSS variables": "CSS 變數:xLog 提供了一些內建的 CSS 變數", + "Address": "地址", + "Character": "身份", + "New operator": "新建授權", + "Operator Address": "授權地址", + "Operator Character Check": "身份授權檢查", + "Warning": "警告", + "Operators have permissions to enter your dashboard, change your settings(excluding xLog subdomain) and post, modify, delete contents on your site.": "授權者可以進入你的儀表板,更改你的設定(不包括 xLog 子網域)並在你的網站上發佈、修改、刪除內容。", + "Add": "新增", + "xLog News": "xLog 新聞", + "More": "更多", + "Meet New Friends": "認識新朋友", + "Need help?": "需要幫助?", + "Your post has been securely stored on the blockchain. Now you may want to": "你的文章已經安全地存儲在區塊鏈上。現在你可能想要", + "View the post": "查看文章", + "View the transaction": "查看交易", + "Share to Twitter": "分享到 Twitter", + "Got it, thanks!": "知道了,謝謝!", + "Published!": "已發佈!", + "Title goes here...": "標題在這裡...", + "Start writing...": "開始寫作...", + "Slug can only contain letters, numbers, hyphens, and underscores.": "短網址只能包含字母、數字、連字符和底線。", + "Date": "日期", + "Prize": "獎金", + "Winners": "獲獎者", + "Learn more": "進一步了解", + "Ended": "已結束", + "Upcoming": "即將開始", + "Ongoing": "進行中", + "Import from Markdown files": "從 Markdown 檔案匯入", + "Import from Mirror.xyz": "從 Mirror.xyz 匯入", + "Select Markdown Files": "選擇 Markdown 檔案", + "No files chosen": "未選擇檔案", + "No entries": "無項目", + "Preview your Mirror.xyz entries": "預覽你的 Mirror.xyz 項目", + "Please select .md files, multiple files are supported, and front matter is supported.": "請選擇 .md 檔案,支援多個檔案,並支援 front matter。", + "Achievements": "成就", + "Tokens": "虛擬貨幣", + "$MIRA is a valuable token in the Crossbell world, and can be easily exchanged on the Crosschain Bridge and Uniswap.": "$MIRA 是 Crossbell 世界中的一種有珍貴的代幣,可在跨鏈橋和 Uniswap 上輕鬆兌換。", + "In the early stage, xLog will use $MIRA to motivate creators.": "在早期階段,xLog 將使用 $MIRA 激勵創作者。", + "You can obtain $MIRA through the following ways:": "你可以透過以下方式獲得 $MIRA:", + "Creator incentive program.": "創作者激勵計畫。", + "Participate in events.": "參加活動。", + "Swap from USDC.": "從 USDC 兌換。", + "Received tips and sponsorships from readers.": "從讀者收到打賞和贊助。", + "Swap to USDC": "兌換成 USDC", + "Free Claim": "免費領取", + "$XLOG is related to xLog DAO, but it's too early now, please stay tuned.": "$XLOG 與 xLog DAO 相關,但現在還為時尚早,敬請期待。", + "Stay tuned": "敬請期待", + "This is a token used for interaction on the Crossbell blockchain, which can be claimed for free from the faucet, so there's no need to worry about its balance.": "這是一個用於 Crossbell 區塊鏈上互動的虛擬貨幣,可以從水龍頭免費領取,因此不用擔心其餘額。", + "Balance": "餘額", + "Swap Tutorial": "兌換教學", + "DNS Checking": "DNS 檢查中", + "DNS check passed.": "DNS 檢查通過。", + "DNS check failed.": "DNS 檢查失敗。", + "Recheck": "重新檢查", + "Hottest": "熱門", + "Latest": "最新", + "Following": "追蹤", + "Create a Post": "新增文章", + "Change Site Icon or domain": "變更網站圖示或域名", + "Join xLog's Discord channel": "加入 xLog 的 Discord 頻道", + "Participate in the development of xLog": "參與 xLog 的發展", + "Follow xLog's Twitter": "追蹤 xLog 的 Twitter", + "Check out the updates of other bloggers": "看看其他 Blogger 的更新", + "You have already imported them, please enter the post page to create a new post!": "已經匯入完成了哦,請到文章頁面新增新的內容!", + "Today": "今天", + "This month": "本月", + "This week": "本周", + "All time": "全部", + "delete_confirmation_post": "你確認要刪除這篇文章嗎?", + "delete_confirmation_page": "你確認要刪除這個頁面嗎?", + "Confirm": "確認", + "Cancel": "取消", + "Published a new post on my blockchain blog: {{title}}. Check it out now!": "我在我的區塊鏈部落格發佈了一片新的文章《{{title}}》,快來看看吧!", + "Comments": "留言", + "You can subscribe to comments through an RSS reader to receive timely reminders.": "你可以通過 RSS 閱讀器訂閱留言,以便及時收到通知。", + "Subscription address:": "訂閱地址:", + "comment on your": "回覆了你的 {{type}}「{{toTitle}}」", + "{{newCount}} new comments": "{{newCount}} 條新留言" +} \ No newline at end of file diff --git a/src/app/i18n/locales/zh-TW/index.json b/src/app/i18n/locales/zh-TW/index.json new file mode 100644 index 00000000..ea31bccc --- /dev/null +++ b/src/app/i18n/locales/zh-TW/index.json @@ -0,0 +1,61 @@ +{ + "Write": "Write", + "Own": "Own", + "Earn": "Earn", + ".": ".", + "Look at others'": "看看別人", + "description": "<0>xLog。最佳 <7>開源 <3>區塊鏈 部落格社群。", + "Get my xLog in 5 minutes": "五分鐘撰寫自我", + "Explore the xLog way": "探索 xLog 之路", + "features": { + "Write": { + "subtitle": "靈感來臨,牢牢抓住", + "description": "釋放創造力,成為時間管理大師!讓寫作更順暢,專注創造未來。" + }, + "Own": { + "subtitle": "鏈上內容,安全無憂", + "description": "通過 Crossbell 區塊鏈發佈你的內容,完全掌控你的權利與安全。
xLog 不存儲任何資料,無法剝奪或修改你的內容和權利,即使 xLog 想這樣做。了解 Crossbell 是如何工作的。", + "extra": { + "title": "不要輕信,堅持驗證", + "description": "不輕信任何人,包括 xLog。建議檢查交易歷史與區塊鏈合約代碼,驗證事實是否符合 xLog 所聲明。", + "button": "揭開 xLog 的神秘面紗" + } + }, + "Earn": { + "subtitle": "賺取虛擬貨幣和權益", + "description": "區塊鏈為優秀的內容創作者提供透明公正的獎勵機會,xLog DAO 更進一步促進社群發展。" + } + }, + "Home": "首頁", + "Activities": "文章流", + "Source Code": "原始碼", + "Features": "特色", + "Showcase": "展示櫃", + "Integration": "整合", + "Visit": "訪問", + "Easy to get started": "讓寫作更簡單", + "Easy to get started text": "xLog 支持 Web3 錢包電子郵件 連接,讓你輕鬆創建定制化部落格,享有自定義域名、訂閱、留言、NFT 鑄造、RSS 訂閱和 AI 增強等功能。只需 5 分鐘即可完成,無需申請或費用。", + "Elegant experience": "優雅永不過時", + "Elegant experience text": "雙欄編輯器,實時預覽,創作無壓力,使用標準的 Markdown 語法 ,支持 HTML音視頻數學公式。頁面設計優雅,為讀者提供舒適的閱讀體驗。", + "Fast": "一切精彩的背後", + "Fast text": "區塊鏈低效?不!高效緩存機制和多種優化方案,激發區塊鏈的 極致性能 ,同時提供 PWA 讓您輕鬆本地安裝和使用,加速實現目標!", + "Safe": "資安,我最在行", + "Safe text": "所有資料,包括配置、文章、訂閱、留言等,都被安全地存儲在 區塊鏈 上。只有您持有的 私鑰 才能掌控和訪問這些資料,確保您的隱私得到最大程度的保護。", + "Customizable": "創意,自由揮灑", + "Customizable text": "您可以自由地使用 自己的域名 ,在自己喜愛的風格下自定義網站,xLog 提供豐富的主題和插件系統,讓您 隨心所欲 地打造屬於自己的個性化網站。展現您的獨特風采!", + "Open": "開放,運用自如", + "Open text": "xLog 提供導入和導出工具,豐富的 API第三方 整合,讓您更加自由地管理和使用網站。所有代碼都在 GitHub 上 開源 ,所有資料都在區塊鏈上 透明存儲 ,沒有任何隱瞞。", + "Creator Incentives": "創作者激勵", + "Creator Incentives text": "在早期階段,xLog 以 MIRA 提供激勵。我們正積極構建代幣經濟模型,力求讓 xLog 成為發布高質量內容的最佳平台。我們希望為您提供最好的體驗和最大的價值回報,讓您在創作、分享和社交中感到更加自由和快樂。", + "DAO": "去中心化自治組織", + "DAO text": "我們將建立一個 xLog DAO,讓創作者可以使用 虛擬貨幣 進行投票。我們相信,這將使我們的社區更加開放、公平和民主化,讓每個人都能發揮自己的影響力和貢獻價值。我們期待與您攜手打造一個更加繁榮和有活力的社區!", + "Discover these awesome teams and creators on xLog (sorted by update time)": "在 xLog 上發現這些超棒的團隊和創作者們(按更新時間排序)", + "Follow All!": "追蹤所有人!", + "Already Followed All!": "已追蹤所有人!", + "Show more": "顯示更多", + "Submit yours": "看看你的👀", + "xLog's open design allows it to integrate with many other open protocols and applications without friction.": "我們相信,只有在開放、互聯、共享的基礎上才能有更大的價值和創新。", + "Dashboard": "主控臺", + "Suggested creators for you": "推薦給你一些優質創作者", + "Hot Topics": "流行話題" +} diff --git a/src/app/i18n/locales/zh-TW/site.json b/src/app/i18n/locales/zh-TW/site.json new file mode 100644 index 00000000..c2710677 --- /dev/null +++ b/src/app/i18n/locales/zh-TW/site.json @@ -0,0 +1,18 @@ +{ + "Home": "首頁", + "Archives": "封存", + "About": "關於", + "Tags": "標籤", + "load more": "還有{{count}}篇{{name}},點選載入更多文章", + "signed and stored on the blockchain": "此{{name}}數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。", + "Write a comment on the blockchain": "在區塊鏈上留言。", + "powered by": " 提供支援", + "This address is in local editing preview mode and cannot be viewed by the public.": "此地址處於本地編輯預覽模式,尚未公開。", + "View on xChar": "在 xChar 上檢視", + "View on xFeed": "在 xFeed 上檢視", + "View on Hoot It": "在 Hoot It 上檢視", + "View on Crossbell Scan": "在 Crossbell Scan 上檢視", + "Subscribe to JSON Feed": "訂閱 JSON Feed", + "Subscribe to RSS": "訂閱 RSS", + "Search on this site": "在這個網站上搜尋" +} \ No newline at end of file diff --git a/src/app/i18n/locales/zh/common.json b/src/app/i18n/locales/zh/common.json new file mode 100644 index 00000000..2918aace --- /dev/null +++ b/src/app/i18n/locales/zh/common.json @@ -0,0 +1,87 @@ +{ + "Connect": "连接", + "Followers": "关注者", + "Following": "正在关注", + "Followings": "正在关注", + "Follow": "关注", + "Unfollow": "取消关注", + "intlDateTime": "{{val, datetime}}", + "post": "文章", + "posts": "文章", + "page": "页面", + "pages": "页面", + "comment": "评论", + "comments": "评论", + "Comment": "评论", + "Comments": "评论", + "reply": "回复", + "replies": "回复", + "like": "喜欢", + "likes": "喜欢", + "blog": "博客", + "Owner": "所有者", + "Transaction Hash": "交易哈希", + "IPFS Address": "IPFS 地址", + "BNB Greenfield Address": "BNB Greenfield 地址", + "Creation": "创建", + "Last Update": "最后更新", + "Create Character": "创建角色", + "Submit": "提交", + "Reply": "回复", + "Cancel Reply": "取消回复", + "Edit": "编辑", + "Cancel Edit": "取消编辑", + "Confirm Modification": "确认修改", + "ago": "{{time}}前", + "joined ago": "{{time}}前加入", + "obtained ago": "{{time}}前获得", + "Like": "点赞", + "Mint to an NFT": "珍藏为 NFT", + "Like successfully": "点赞成功", + "Mint successfully": "珍藏成功", + "like stored": "你的点赞已被安全地存储在区块链上,可以在 <2>Crossbell Scan 上查看", + "mint stored": "你已将此篇文章珍藏成NFT, 可以在 <2>xChar 或 <6>Crossbell Scan 上查看", + "Got it, thanks!": "好的,谢谢!", + "Like List": "点赞列表", + "Mint List": "珍藏列表", + "Revert": "撤销", + "Confirm to revert": "确认撤销", + "like revert": "请确认您是否想要撤销这个点赞操作?", + "Cancel": "取消", + "Confirm": "确认", + "No Content Yet.": "暂无内容", + "Close": "关闭", + "Dashboard": "仪表盘", + "Copied!": "已复制!", + "Operator Sign": "签名授权", + "Switch Characters": "切换角色", + "Upgrade to Wallet": "升级为钱包", + "Disconnect": "断开连接", + "Loading": "加载中", + "Showcase": "展示柜", + "AI-generated summary": "AI 生成的摘要", + "Generating": "生成中", + "Show more": "显示更多", + "Patron": "赞助", + "Become a patron of {{name}}" : "成为 {{name}} 的赞助者", + "Latest patrons": "最近赞助者", + "Latest tipper": "最近赞赏者", + "You are here to be the first patron.": "你将是第一个赞助者。", + "You are here to be the first tipper.": "你将是第一个赞赏者。", + "Select a tier": "选择一个等级", + "One-time": "一次性", + "Monthly and NFT Rewards": "每月和 NFT 奖励", + "Coming soon": "即将推出", + "What is MIRA? Where can I get some?" : "MIRA 是什么?我在哪里可以获得?", + "Tip": "赞赏", + "Tip the post: {{name}}": "赞赏文章:{{name}}", + "Custom": "自定义", + "Mintable": "可铸造", + "Successfully followed": "嘿!你已经准备好<2>在这里跟上你关注的博主的最新动态了。", + "Enable AI Filtering": "启用 AI 过滤", + "Filter out possible low-quality content based on AI ratings.": "基于 AI 评分过滤可能质量不佳的内容。", + "Refreshing": "刷新中", + "Search for your interest": "搜索你感兴趣的内容", + "results": "条结果", + "My xLog": "我的 xLog" +} diff --git a/src/app/i18n/locales/zh/dashboard.json b/src/app/i18n/locales/zh/dashboard.json new file mode 100644 index 00000000..be107594 --- /dev/null +++ b/src/app/i18n/locales/zh/dashboard.json @@ -0,0 +1,204 @@ +{ + "Dashboard": "仪表盘", + "Posts": "文章", + "Pages": "页面", + "Notifications": "通知", + "Unread notifications": "未读通知", + "Settings": "设置", + "Events": "活动", + "New Events": "新活动", + "Site Stats": "站点统计", + "Published posts": "发布的文章", + "Received comments": "收到的评论", + "Followers": "关注者", + "Viewed": "浏览量", + "Received tips": "收到的打赏", + "Site Duration": "站点运行时间", + "days": "天", + "Deleted!": "已删除!", + "Fail to Deleted.": "删除失败", + "Converted!": "已转换!", + "Failed to convert.": "转换失败。", + "All Posts": "所有文章", + "All Pages": "所有页面", + "Published": "已发布", + "published": "已发布", + "Draft": "草稿", + "draft": "草稿", + "Scheduled": "定时发布", + "scheduled": "定时发布", + "published and local modified": "已发布并本地修改", + "link post-vs-page": "https://wordpress.com/zh-cn/support/post-vs-page/", + "posts description": "文章是按时间倒序在你的网站上列出的条目。可以将它们看作是更新,以提供新内容给读者。<2>文章与页面。", + "pages description": "页面是静态的,不受日期影响。它们更像是你网站上的永久元素,比如“关于我们”、“联系我们”等。<2>文章与页面。", + "pages add": "创建页面后,你可以将其<2>添加到你网站的导航菜单中,以便访问者可以找到它。", + "New Post": "新建文章", + "New Page": "新建页面", + "Import": "导入", + "Import markdown file with front matter supported": "导入 Markdown 文件(支持 Front Matter)", + "View Site": "查看站点", + "hello": { + "welcome": "

👋 你好哇,

欢迎使用 xLog!

以下是一些有用的链接,帮助你开始使用 xLog:

", + "hidden": "👋 你好哇", + "community": "

加入我们的社区,认识新朋友或共同建设 xLog:

" + }, + "Edit": "编辑", + "Convert to Page": "转换为页面", + "Convert to Post": "转换为文章", + "Select All": "全部选择", + "Deselect All": "取消选择", + "Delete": "删除", + "Heading": "标题", + "Bold": "粗体", + "Italic": "斜体", + "Strikethrough": "删除线", + "Underline": "下划线", + "Quote": "引用", + "Inline Code": "行内代码", + "Code Block": "代码块", + "Unordered List": "无序列表", + "Ordered List": "有序列表", + "Link": "链接", + "Image": "图片", + "Upload Image": "上传图片", + "Mention": "提及", + "Tip: xLog Flavored Markdown": "帮助:xLog 风格的 Markdown", + "Preview": "预览", + "Publish": "发布", + "Update": "更新", + "Discard Changes": "放弃变更", + "Publish at": "发布时间", + "This post will be accessible from this time": "此文章将从此时间开始可访问", + "This page will be accessible from this time": "此页面将从此时间开始可访问", + "Post slug": "文章短链接", + "Page slug": "页面短链接", + "This post will be accessible at": "此文章将可通过以下链接访问", + "This page will be accessible at": "此页面将可通过以下链接访问", + "Tags": "标签", + "Separate multiple tags with English commas": "多个标签请用英文逗号分隔", + "Excerpt": "摘要", + "Leave it blank to use auto-generated excerpt": "留空则使用自动生成的摘要", + "General": "常规", + "Social Platforms": "社交平台", + "Navigation": "导航", + "Domains": "域名", + "Custom CSS": "自定义 CSS", + "Operators": "影子授权", + "Export data": "导出数据", + "Site Settings": "站点设置", + "Icon": "图标", + "Banner": "横幅", + "Supports both pictures and videos.": "支持图片和视频。", + "Name": "名称", + "Description": "描述", + "Integrate Google Analytics": "将 Google Analytics 集成到你的站点中。你可以按照<2>这里的说明查找你的 Measurement ID。", + "Integrate Umami Cloud Analytics": "将 Umami Cloud Analytics 集成到你的站点中。你可以按照<2>这里的说明查找你的 Website ID。", + "Save": "保存", + "Tips": "提示", + "social tips": { + "p1": "这些社交平台将显示在你的 xLog 的右下角。", + "p2": "我们支持<2>这些平台,自动显示其标志和链接。对于其他平台,将显示默认标志。如果你有其他需求,请随时向我们提交问题或PR,以支持更多的平台。", + "p3": "你还可以在 <2>xSync 上连接到 Twitter、Telegram 频道、Medium、Substack 等平台,并自动同步内容。当你在那里设置同步后,它也会显示在这里。" + }, + "Platform": "平台", + "Identity": "身份", + "Remove": "移除", + "New Item": "新建项目", + "xLog provides some out-of-the-box built-in pages": "xLog 提供了一些开箱即用的内置页面", + "Home page": "首页", + "Archives page": "归档页面", + "Tag page": "标签页面", + "NFT Showcase page": "NFT 展示页面", + "Label": "标签", + "URL": "链接", + "subdomain": "子域名", + "Custom Domain": "自定义域名", + "Set the following record on your DNS provider to active your custom domain": "在你的 DNS 提供商上设置以下记录以激活自定义域名", + "Scope: These styles will be applied to your entire blog, including this dashboard.": "范围:这些样式将应用于你的整个博客,包括这个仪表盘。", + "Support": "支持", + "CSS variables: xLog provides some built-in CSS variables": "CSS 变量:xLog 提供了一些内置的 CSS 变量", + "Using a browser plugin that can modify page styles, such as Stylebot, can help with debugging.": "使用可以修改页面样式的浏览器插件,例如 Stylebot,可以帮助调试。", + "Address": "地址", + "Character": "角色", + "New operator": "新建授权", + "Operator Address": "授权地址", + "Operator Character Check": "授权角色检查", + "Warning": "警告", + "Operators have permissions to enter your dashboard, change your settings(excluding xLog subdomain) and post, modify, delete contents on your site.": "影子授权可以进入你的仪表盘,更改你的设置(不包括 xLog 子域名)并在你的站点上发布、修改、删除内容。", + "Add": "添加", + "xLog News": "xLog 新鲜事", + "More": "更多", + "Meet New Friends": "认识新朋友", + "Need help?": "需要帮助?", + "Your post has been securely stored on the blockchain. Now you may want to": "你的文章已经安全地存储在区块链上。现在你可能想要", + "View the post": "查看文章", + "View the transaction": "查看交易", + "Share to Twitter": "分享到 Twitter", + "Got it, thanks!": "好的,谢谢!", + "Published!": "已发布!", + "Title goes here...": "标题在这里...", + "Start writing...": "开始写作...", + "Slug can only contain letters, numbers, hyphens, and underscores.": "短链接只能包含字母、数字、连字符和下划线。", + "Date": "日期", + "Prize": "奖金", + "Winners": "获奖者", + "Learn more": "了解更多", + "Ended": "已结束", + "Upcoming": "即将开始", + "Ongoing": "进行中", + "Import from Markdown files": "从 Markdown 文件导入", + "Import from Mirror.xyz": "从 Mirror.xyz 导入", + "Select Markdown Files": "选择 Markdown 文件", + "No files chosen": "未选择文件", + "No entries": "无条目", + "Preview your Mirror.xyz entries": "预览你的 Mirror.xyz 条目", + "Please select .md files, multiple files are supported, and front matter is supported.": "请选择 .md 文件,支持多个文件,支持 front matter。", + "Achievements": "成就", + "Tokens": "代币", + "$MIRA is a valuable token in the Crossbell world, and can be easily exchanged on the Crosschain Bridge and Uniswap.": "$MIRA 是 Crossbell 世界中的一种珍贵的代币,可以轻松地在 Crosschain Bridge 和 Uniswap 上兑换。", + "In the early stage, xLog will use $MIRA to motivate creators.": "在早期阶段,xLog 将使用 $MIRA 激励创作者。", + "You can obtain $MIRA through the following ways:": "你可以通过以下方式获得 $MIRA:", + "Creator incentive program.": "创作者激励计划。", + "Participate in events.": "参加活动。", + "Swap from USDC.": "从 USDC 兑换。", + "Received tips and sponsorships from readers.": "从读者收到打赏和赞助。", + "Swap to USDC": "兑换到 USDC", + "Free Claim": "免费领取", + "$XLOG is related to xLog DAO, but it's too early now, please stay tuned.": "$XLOG 与 xLog DAO 相关,但现在还为时尚早,敬请期待。", + "Stay tuned": "敬请期待", + "This is a token used for interaction on the Crossbell blockchain, which can be claimed for free from the faucet, so there's no need to worry about its balance.": "这是一个用于 Crossbell 区块链上交互的代币,可以从水龙头免费领取,所以不用担心它的余额。", + "Balance": "余额", + "Swap Tutorial": "兑换教程", + "DNS Checking": "DNS 检查中", + "DNS check passed.": "DNS 检查通过。", + "DNS check failed.": "DNS 检查失败。", + "Subdomain Checking": "子域名检查中", + "Subdomain Available.": "子域名可用。", + "Subdomain Unavailable.": "子域名不可用。", + "Recheck": "重新检查", + "Hottest": "最热", + "Latest": "最新", + "Following": "关注", + "Create a Post": "创建文章", + "Change Site Icon or domain": "更改站点图标或域名", + "Join xLog's Discord channel": "加入 xLog 的 Discord 频道", + "Participate in the development of xLog": "参与 xLog 的开发", + "Follow xLog's Twitter": "关注 xLog 的 Twitter", + "Check out the updates of other bloggers": "查看其他博主的更新", + "You have already imported them, please enter the post page to create a new post!": "您已经导入了它们,请进入文章页面创建新的文章吧。", + "Today": "今天", + "This month": "本月", + "This week": "本周", + "All time": "全部", + "Confirm Deletion?": "确认删除?", + "delete_confirmation_post": "你确定要删除这篇文章吗?", + "delete_confirmation_page": "你确定要删除这个页面吗?", + "Confirm": "确认", + "Cancel": "取消", + "Published a new post on my blockchain blog: {{title}}. Check it out now!": "在我的区块链博客发布了一篇新文章《{{title}}》,快来看看吧!", + "Comments": "评论", + "You can subscribe to comments through an RSS reader to receive timely reminders.": "你可以通过 RSS 阅读器订阅评论,以便及时收到提醒。", + "Subscription address:": "订阅地址:", + "comment on your" : "评论了你的{{type}}「{{toTitle}}」", + "{{newCount}} new comments" : "{{newCount}} 条新评论" +} \ No newline at end of file diff --git a/src/app/i18n/locales/zh/index.json b/src/app/i18n/locales/zh/index.json new file mode 100644 index 00000000..a7048a85 --- /dev/null +++ b/src/app/i18n/locales/zh/index.json @@ -0,0 +1,61 @@ +{ + "Write": "写作", + "Own": "拥有", + "Earn": "赚取", + ".": "。", + "Look at others'": "看看其他人的", + "description": "<0>xLog 是面向所有人的最棒 <3>链上 <7>开源 博客社区。", + "Get my xLog in 5 minutes": "5 分钟拥有自己的 xLog", + "Explore the xLog way": "探索 xLog 之路", + "features": { + "Write": { + "subtitle": "当灵感来临时写作", + "description": "让创作者们摆脱耗时、不必要的流程,减少写作过程中的阻碍,让你和团队能够专注于创造。" + }, + "Own": { + "subtitle": "在区块链上拥有自己的内容", + "description": "通过在 Crossbell 区块链上发布来拥有自己的内容。 xLog 不会存储任何数据,也无法剥夺或修改你的权利和内容,即使 xLog 想这样做。 了解 Crossbell 是如何工作的。", + "extra": { + "title": "不要相信,去验证", + "description": "在互联网上不轻信任何人是一个好习惯,包括 xLog。因此,我们强烈建议你浏览 xLog 上的任何站点,检查页面底部的交易历史,阅读区块链合约代码,看看实情是否与 xLog 所声称的一致。", + "button": "去验证" + } + }, + "Earn": { + "subtitle": "赚取代币和权利", + "description": "优秀的内容应该得到奖励,而区块链为创作者提供了透明公正的奖励机会。xLog DAO 将进一步促进我们社区的发展。" + } + }, + "Features": "特色", + "Showcase": "展示柜", + "Integration": "集成", + "Home": "首页", + "Activities": "动态", + "Source Code": "源码", + "Visit": "访问", + "Easy to get started": "简单上手", + "Easy to get started text": "xLog 支持 web3 钱包电子邮件连接,使你能够快速创建一个定制的博客,具有自定义域名、订阅、评论、NFT 铸造、RSS 订阅和 AI 增强等功能,仅需 5 分钟即可完成,无需申请或费用。", + "Safe": "安全", + "Safe text": "所有博客数据,包括配置、文章、订阅、评论等,都由你自己签名并安全地存储在区块链上,只有你持有的私钥才能进行控制和访问。包括 xLog 在内的任何人都无法进行更改。", + "Fast": "快速", + "Fast text": "区块链并不总意味着低效率。xLog通过其高效的缓存机制和众多优化,可以达到最佳性能。站点还支持PWA用于本地安装和使用。", + "Customizable": "可定制", + "Customizable text": "你可以自由地使用自己的域名、自定义网站并按自己的喜好进行设计。这是你的网站,没有任何限制。xLog 鼓励并将提供丰富的主题和插件系统,以帮助你进行自定义。", + "Open": "开放", + "Open text": "xLog提供导入和导出工具,以及丰富的 API 和第三方集成。所有代码都在 GitHub 上开源,所有数据都在区块链上透明。xLog 没有任何隐瞒。", + "Elegant experience": "优雅的体验", + "Elegant experience text": "xLog 提供双栏编辑器,具有实时预览功能,提供优秀的写作体验,使用标准的 Markdown 语法,支持 HTML音视频和数学表达式。页面设计优雅,为读者提供舒适的阅读体验。", + "Creator Incentives": "创作者激励", + "Creator Incentives text": "在早期阶段,xLog以MIRA提供激励。我们正在积极构建代币经济模型,以确保xLog成为发布高质量内容的最佳平台。", + "DAO": "去中心化自治组织", + "DAO text": "将建立一个xLog DAO,在其中创作者使用代币进行投票。", + "Discover these awesome teams and creators on xLog (sorted by update time)": "在 xLog 上发现这些超棒的团队和创作者们(按更新时间排序)", + "Follow All!": "关注所有!", + "Already Followed All!" : "已经关注所有!", + "Show more": "显示更多", + "Submit yours": "提交你的", + "xLog's open design allows it to integrate with many other open protocols and applications without friction.": "xLog 的开放式设计使其能够与许多其他开放协议和应用程序无缝集成,没有任何限制。", + "Dashboard": "仪表盘", + "Suggested creators for you": "为你推荐的创作者", + "Hot Topics": "热门话题" +} \ No newline at end of file diff --git a/src/app/i18n/locales/zh/site.json b/src/app/i18n/locales/zh/site.json new file mode 100644 index 00000000..1926e4a1 --- /dev/null +++ b/src/app/i18n/locales/zh/site.json @@ -0,0 +1,19 @@ +{ + "Home": "主页", + "Archives": "归档", + "About": "关于", + "Tags": "标签", + "load more": "还有 {{count}} 篇{{name}},点击加载更多", + "signed and stored on the blockchain": "此{{name}}数据所有权由区块链加密技术和智能合约保障仅归创作者所有。", + "Write a comment on the blockchain": "在区块链上写下你的评论", + "powered by": " 提供支持", + "This address is in local editing preview mode and cannot be viewed by the public.": + "此地址处于本地编辑预览模式,无法被公众查看。", + "View on xChar": "在 xChar 上查看", + "View on xFeed": "在 xFeed 上查看", + "View on Hoot It": "在 Hoot It 上查看", + "View on Crossbell Scan": "在 Crossbell Scan 上查看", + "Subscribe to JSON Feed": "订阅 JSON Feed", + "Subscribe to RSS": "订阅 RSS", + "Search on this site": "在本站搜索" +} \ No newline at end of file diff --git a/src/app/i18n/settings.ts b/src/app/i18n/settings.ts new file mode 100644 index 00000000..4da7f705 --- /dev/null +++ b/src/app/i18n/settings.ts @@ -0,0 +1,15 @@ +export const fallbackLng = "en" +export const languages = ["en", "zh", "zh-TW", "ja"] +export const defaultNS = "common" + +export function getOptions(lng = fallbackLng, ns = defaultNS) { + return { + // debug: true, + supportedLngs: languages, + fallbackLng, + lng, + fallbackNS: defaultNS, + defaultNS, + ns, + } +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 00000000..53b601a8 --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,43 @@ +import { dir } from "i18next" +import { headers } from "next/headers" +import { useRouter } from "next/router" + +import "~/css/main.css" + +import { languages } from "./i18n/settings" +import Providers from "./providers" + +export async function generateStaticParams() { + return languages.map((lng) => ({ lng })) +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + let lng = "en" + const router = useRouter() + const queryLang = router.query.lang as string + if (!queryLang) { + let acceptLang = headers().get("accept-language")?.split(",")[0] + if (acceptLang === "zh-HK" || acceptLang === "zh-TW") { + acceptLang = "zh-TW" + } else { + acceptLang = acceptLang?.split("-")[0] + } + if (acceptLang) { + lng = acceptLang + } + } else { + lng = queryLang + } + + return ( + + + {children} + + + ) +} diff --git a/src/app/providers.tsx b/src/app/providers.tsx new file mode 100644 index 00000000..46503dd7 --- /dev/null +++ b/src/app/providers.tsx @@ -0,0 +1,87 @@ +import "aplayer-react/dist/index.css" +import NextNProgress from "nextjs-progressbar" +import { useState } from "react" +import { Toaster } from "react-hot-toast" +import { WagmiConfig, createClient } from "wagmi" + +import { + ConnectKitProvider, + getDefaultClientConfig, +} from "@crossbell/connect-kit" +import { + NotificationModal, + NotificationModalColorScheme, +} from "@crossbell/notification" +import { QueryClient } from "@tanstack/react-query" +import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client" + +// eslint-disable-next-line import/no-unresolved +import { useDarkMode } from "~/hooks/useDarkMode" +import { useMobileLayout } from "~/hooks/useMobileLayout" +import { APP_NAME } from "~/lib/env" +import { toGateway } from "~/lib/ipfs-parser" +import { createIDBPersister } from "~/lib/persister.client" +import { urlComposer } from "~/lib/url-composer" + +const wagmiClient = createClient(getDefaultClientConfig({ appName: APP_NAME })) + +const persister = createIDBPersister() + +const colorScheme: NotificationModalColorScheme = { + text: `rgb(var(--tw-colors-i-zinc-800))`, + textSecondary: `rgb(var(--tw-colors-i-gray-600))`, + background: `rgb(var(--tw-colors-i-white))`, + border: `var(--border-color)`, +} + +export default function Providers({ children }: { children: React.ReactNode }) { + useDarkMode() + useMobileLayout() + + const [queryClient] = useState( + () => + new QueryClient({ + defaultOptions: { + queries: { + cacheTime: 1000 * 60 * 60 * 24, // 24 hours + }, + }, + }), + ) + + return ( + + { + const queryIsReadyForPersistance = + query.state.status === "success" + if (queryIsReadyForPersistance) { + return !((query.state?.data as any)?.pages?.length > 1) + } else { + return false + } + }, + }, + }} + > + + + {children} + + + + + + ) +} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 35dd12e0..4456131d 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,5 +1,4 @@ import "aplayer-react/dist/index.css" -import { Network } from "crossbell.js" import { appWithTranslation } from "next-i18next" import NextNProgress from "nextjs-progressbar" import { Toaster } from "react-hot-toast" @@ -21,13 +20,11 @@ import "~/css/main.css" // eslint-disable-next-line import/no-unresolved import { useDarkMode } from "~/hooks/useDarkMode" import { useMobileLayout } from "~/hooks/useMobileLayout" -import { APP_NAME, IPFS_GATEWAY } from "~/lib/env" +import { APP_NAME } from "~/lib/env" import { toGateway } from "~/lib/ipfs-parser" import { createIDBPersister } from "~/lib/persister.client" import { urlComposer } from "~/lib/url-composer" -Network.setIpfsGateway(IPFS_GATEWAY) - const wagmiClient = createClient(getDefaultClientConfig({ appName: APP_NAME })) const queryClient = new QueryClient({ diff --git a/src/pages/index.tsx b/src/pages/index_b.tsx similarity index 100% rename from src/pages/index.tsx rename to src/pages/index_b.tsx diff --git a/tsconfig.json b/tsconfig.json index b9c9ccd1..d8c0da05 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,10 @@ { "compilerOptions": { - "lib": ["DOM", "DOM.Iterable", "esnext"], + "lib": [ + "DOM", + "DOM.Iterable", + "esnext" + ], "isolatedModules": true, "esModuleInterop": true, "jsx": "preserve", @@ -10,7 +14,9 @@ "strict": true, "baseUrl": ".", "paths": { - "~/*": ["./src/*"] + "~/*": [ + "./src/*" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true, @@ -18,8 +24,22 @@ "skipLibCheck": true, "incremental": true, "module": "esnext", - "typeRoots": ["./types"] + "typeRoots": [ + "./types" + ], + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] }