From 7f3b787d9d953bbd44f7297d73cce114631274b2 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 20 Sep 2024 16:54:31 +0800 Subject: [PATCH 01/37] init Signed-off-by: Innei --- apps/renderer/src/hooks/biz/useAb.ts | 31 +++++ apps/renderer/src/initialize/index.ts | 5 +- apps/renderer/src/initialize/posthog.ts | 9 +- apps/renderer/src/lib/img-proxy.ts | 10 +- apps/renderer/src/modules/ab/atoms.ts | 15 +++ apps/renderer/src/modules/ab/hoc.tsx | 30 +++++ apps/renderer/src/modules/ab/providers.tsx | 84 ++++++++++++++ .../renderer/src/providers/root-providers.tsx | 2 + apps/renderer/tsconfig.json | 3 +- configs/vite.render.config.ts | 1 + constants/flags.json | 3 + package.json | 1 + scripts/pull-ab-flags.ts | 107 ++++++++++++++++++ 13 files changed, 293 insertions(+), 8 deletions(-) create mode 100644 apps/renderer/src/hooks/biz/useAb.ts create mode 100644 apps/renderer/src/modules/ab/atoms.ts create mode 100644 apps/renderer/src/modules/ab/hoc.tsx create mode 100644 apps/renderer/src/modules/ab/providers.tsx create mode 100644 constants/flags.json create mode 100644 scripts/pull-ab-flags.ts diff --git a/apps/renderer/src/hooks/biz/useAb.ts b/apps/renderer/src/hooks/biz/useAb.ts new file mode 100644 index 000000000..3eddbb14f --- /dev/null +++ b/apps/renderer/src/hooks/biz/useAb.ts @@ -0,0 +1,31 @@ +import { useAtomValue } from "jotai" +import PostHog from "posthog-js" +import { useFeatureFlagEnabled } from "posthog-js/react" + +import { jotaiStore } from "~/lib/jotai" +import type { FeatureKeys } from "~/modules/ab/atoms" +import { debugFeaturesAtom, enableDebugOverrideAtom, IS_DEBUG_ENV } from "~/modules/ab/atoms" + +export const useAb = (feature: FeatureKeys) => { + const isEnableDebugOverrides = useAtomValue(enableDebugOverrideAtom) + const debugFeatureOverrides = useAtomValue(debugFeaturesAtom) + + const isEnabled = useFeatureFlagEnabled(feature) + + if (IS_DEBUG_ENV && isEnableDebugOverrides) return debugFeatureOverrides[feature] + + return isEnabled +} + +export const getAbValue = (feature: FeatureKeys) => { + const enabled = PostHog.getFeatureFlag(feature) + const debugOverride = jotaiStore.get(debugFeaturesAtom) + + const isEnableOverride = jotaiStore.get(enableDebugOverrideAtom) + + if (isEnableOverride) { + return debugOverride[feature] + } + + return enabled +} diff --git a/apps/renderer/src/initialize/index.ts b/apps/renderer/src/initialize/index.ts index b978e7328..60e937348 100644 --- a/apps/renderer/src/initialize/index.ts +++ b/apps/renderer/src/initialize/index.ts @@ -95,13 +95,12 @@ export const initializeApp = async () => { }) // should after hydrateSettings - const { dataPersist: enabledDataPersist, sendAnonymousData } = getGeneralSettings() + const { dataPersist: enabledDataPersist } = getGeneralSettings() initSentry() + initPostHog() await apm("i18n", initI18n) - if (sendAnonymousData) initPostHog() - let dataHydratedTime: undefined | number // Initialize the database if (enabledDataPersist) { diff --git a/apps/renderer/src/initialize/posthog.ts b/apps/renderer/src/initialize/posthog.ts index c5a367f88..018851061 100644 --- a/apps/renderer/src/initialize/posthog.ts +++ b/apps/renderer/src/initialize/posthog.ts @@ -1,6 +1,8 @@ import { env } from "@follow/shared/env" import type { CaptureOptions, Properties } from "posthog-js" +import { posthog } from "posthog-js" +import { getGeneralSettings } from "~/atoms/settings/general" import { whoami } from "~/atoms/user" declare global { @@ -12,9 +14,6 @@ declare global { } } export const initPostHog = async () => { - if (import.meta.env.DEV) return - const { default: posthog } = await import("posthog-js") - if (env.VITE_POSTHOG_KEY === undefined) return posthog.init(env.VITE_POSTHOG_KEY, { person_profiles: "identified_only", @@ -25,6 +24,10 @@ export const initPostHog = async () => { window.posthog = { reset, capture(event_name: string, properties?: Properties | null, options?: CaptureOptions) { + if (import.meta.env.DEV) return + if (!getGeneralSettings().sendAnonymousData) { + return + } return capture.apply(posthog, [ event_name, { diff --git a/apps/renderer/src/lib/img-proxy.ts b/apps/renderer/src/lib/img-proxy.ts index bc4c9e802..c839c3937 100644 --- a/apps/renderer/src/lib/img-proxy.ts +++ b/apps/renderer/src/lib/img-proxy.ts @@ -1,6 +1,8 @@ import { env } from "@follow/shared/env" import { imageRefererMatches } from "@follow/shared/image" +import { getAbValue } from "~/hooks/biz/useAb" + export const getImageProxyUrl = ({ url, width, @@ -9,7 +11,13 @@ export const getImageProxyUrl = ({ url: string width: number height: number -}) => `${env.VITE_IMGPROXY_URL}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` +}) => { + if (getAbValue("Image_Proxy_V2")) { + return `${env.VITE_IMGPROXY_URL}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` + } else { + return `${env.VITE_IMGPROXY_URL}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` + } +} export const replaceImgUrlIfNeed = (url: string) => { for (const rule of imageRefererMatches) { diff --git a/apps/renderer/src/modules/ab/atoms.ts b/apps/renderer/src/modules/ab/atoms.ts new file mode 100644 index 000000000..f45068326 --- /dev/null +++ b/apps/renderer/src/modules/ab/atoms.ts @@ -0,0 +1,15 @@ +import FEATURES from "@constants/flags.json" +import { atom } from "jotai" +import { atomWithStorage } from "jotai/utils" + +import { getStorageNS } from "~/lib/ns" + +export type FeatureKeys = keyof typeof FEATURES + +export const debugFeaturesAtom = atomWithStorage(getStorageNS("ab"), FEATURES, undefined, { + getOnInit: true, +}) + +export const IS_DEBUG_ENV = import.meta.env.DEV || import.meta.env["PREVIEW_MODE"] + +export const enableDebugOverrideAtom = atom(IS_DEBUG_ENV) diff --git a/apps/renderer/src/modules/ab/hoc.tsx b/apps/renderer/src/modules/ab/hoc.tsx new file mode 100644 index 000000000..823e9bfb9 --- /dev/null +++ b/apps/renderer/src/modules/ab/hoc.tsx @@ -0,0 +1,30 @@ +import type { FC } from "react" +import { forwardRef } from "react" + +import { useAb } from "~/hooks/biz/useAb" + +import type { FeatureKeys } from "./atoms" + +const Noop = () => null +export const withFeature = + (feature: FeatureKeys) => + ( + Component: FC, + + FallbackComponent: any = Noop, + ) => { + // @ts-expect-error + const WithFeature = forwardRef((props: T, ref: any) => { + const isEnabled = useAb(feature) + + if (isEnabled === undefined) return null + + return isEnabled ? ( + + ) : ( + + ) + }) + + return WithFeature + } diff --git a/apps/renderer/src/modules/ab/providers.tsx b/apps/renderer/src/modules/ab/providers.tsx new file mode 100644 index 000000000..45758074a --- /dev/null +++ b/apps/renderer/src/modules/ab/providers.tsx @@ -0,0 +1,84 @@ +import { useAtomValue, useSetAtom } from "jotai" + +import { Divider } from "~/components/ui/divider" +import { Label } from "~/components/ui/label" +import { useModalStack } from "~/components/ui/modal" +import { RootPortal } from "~/components/ui/portal" +import { Switch } from "~/components/ui/switch" + +import type { FeatureKeys } from "./atoms" +import { debugFeaturesAtom, enableDebugOverrideAtom, IS_DEBUG_ENV } from "./atoms" + +export const FeatureFlagDebugger = () => { + if (IS_DEBUG_ENV) return + + return null +} + +const DebugToggle = () => { + const { present } = useModalStack() + return ( + +
{ + present({ + title: "A/B", + content: ABModalContent, + }) + }} + className="fixed bottom-5 right-0 flex size-5 items-center justify-center opacity-40 duration-200 hover:opacity-100" + > + +
+
+ ) +} + +const SwitchInternal = ({ Key }: { Key: FeatureKeys }) => { + const enabled = useAtomValue(debugFeaturesAtom)[Key] + const setDebugFeatures = useSetAtom(debugFeaturesAtom) + return ( + { + setDebugFeatures((prev) => ({ ...prev, [Key]: checked })) + }} + /> + ) +} + +const ABModalContent = () => { + const features = useAtomValue(debugFeaturesAtom) + + const enableOverride = useAtomValue(enableDebugOverrideAtom) + const setEnableDebugOverride = useSetAtom(enableDebugOverrideAtom) + return ( +
+ + + + +
+ {Object.keys(features).map((key) => { + return ( +
+ +
+ ) + })} +
+
+ ) +} diff --git a/apps/renderer/src/providers/root-providers.tsx b/apps/renderer/src/providers/root-providers.tsx index 8966cff19..c14d309e2 100644 --- a/apps/renderer/src/providers/root-providers.tsx +++ b/apps/renderer/src/providers/root-providers.tsx @@ -10,6 +10,7 @@ import { Toaster } from "~/components/ui/sonner" import { HotKeyScopeMap } from "~/constants" import { jotaiStore } from "~/lib/jotai" import { persistConfig, queryClient } from "~/lib/query-client" +import { FeatureFlagDebugger } from "~/modules/ab/providers" import { ContextMenuProvider } from "./context-menu-provider" import { EventProvider } from "./event-provider" @@ -39,6 +40,7 @@ export const RootProviders: FC = ({ children }) => ( + {import.meta.env.DEV && } {children} diff --git a/apps/renderer/tsconfig.json b/apps/renderer/tsconfig.json index 0011f9807..1f6fa670c 100644 --- a/apps/renderer/tsconfig.json +++ b/apps/renderer/tsconfig.json @@ -14,7 +14,8 @@ "paths": { "~/*": ["src/*"], "@pkg": ["../../package.json"], - "@locales/*": ["../../locales/*"] + "@locales/*": ["../../locales/*"], + "@constants/*": ["../../constants/*"] } } } diff --git a/configs/vite.render.config.ts b/configs/vite.render.config.ts index 62bea76d9..a38a42e02 100644 --- a/configs/vite.render.config.ts +++ b/configs/vite.render.config.ts @@ -100,6 +100,7 @@ export const viteRenderBaseConfig = { "@env": resolve("src/env.ts"), "@locales": resolve("locales"), "@follow/electron-main": resolve("apps/main/src"), + "@constants": resolve("constants"), }, }, base: "/", diff --git a/constants/flags.json b/constants/flags.json new file mode 100644 index 000000000..c0da2a81f --- /dev/null +++ b/constants/flags.json @@ -0,0 +1,3 @@ +{ + "Image_Proxy_V2": true +} diff --git a/package.json b/package.json index 060a2c681..02cf33bd0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "prepare": "pnpm exec simple-git-hooks && shx test -f .env || shx cp .env.example .env", "publish": "electron-vite build --outDir=dist && electron-forge publish", "start": "electron-vite preview", + "sync:ab": "tsx scripts/pull-ab-flags.ts", "test": "pnpm -F web run test", "typecheck": "npm run typecheck:node && npm run typecheck:web", "typecheck:node": "pnpm -F electron-main run typecheck", diff --git a/scripts/pull-ab-flags.ts b/scripts/pull-ab-flags.ts new file mode 100644 index 000000000..3755973fa --- /dev/null +++ b/scripts/pull-ab-flags.ts @@ -0,0 +1,107 @@ +import "dotenv/config" + +import { readFileSync, writeFileSync } from "node:fs" +import path, { dirname, resolve } from "node:path" +import { fileURLToPath } from "node:url" +import { inspect } from "node:util" + +import { ofetch } from "ofetch" + +const { POSTHOG_TOKEN } = process.env + +if (!POSTHOG_TOKEN) { + throw new Error("POSTHOG_TOKEN is not set") +} +// https://posthog.com/docs/api/feature-flags#post-api-organizations-parent_lookup_organization_id-feature_flags-copy_flags +const listRes: ListRes = await ofetch( + `https://app.posthog.com/api/projects/${process.env.POSTHOG_PROJECT_ID}/feature_flags/?limit=9999`, + { + method: "GET", + headers: { + Authorization: `Bearer ${POSTHOG_TOKEN}`, + }, + }, +) + +interface ListRes { + count: number + next: null + previous: null + results: ResultsItem[] +} +interface ResultsItem { + id: number + name: string + key: string + filters: any[] + deleted: boolean + active: boolean + created_by: any[] + created_at: string + is_simple_flag: boolean + rollout_percentage: number + ensure_experience_continuity: boolean + experiment_set: any[] + surveys: any[] + features: any[] + rollback_conditions: any[] + performed_rollback: boolean + can_edit: boolean + usage_dashboard: number + analytics_dashboards: any[] + has_enriched_analytics: boolean + tags: any[] +} + +const existFlags = {} as Record + +listRes.results.forEach((flag) => (existFlags[flag.key] = true)) + +const __dirname = resolve(dirname(fileURLToPath(import.meta.url))) +const localFlagsString = readFileSync(path.join(__dirname, "../constants/flags.json"), "utf8") +const localFlags = JSON.parse(localFlagsString as string) as Record + +const updateToRmoteFlags = {} as Record + +// If remote key has but local not has, add to Local +for (const key in existFlags) { + if (!(key in localFlags)) { + localFlags[key] = existFlags[key] + } +} + +// Write to local flags +writeFileSync(path.join(__dirname, "../constants/flags.json"), JSON.stringify(localFlags, null, 2)) + +console.info("update local flags", inspect(localFlags)) + +// Local first +for (const key in localFlags) { + // existFlags[key] = localFlags[key] + if (existFlags[key] !== localFlags[key]) { + updateToRmoteFlags[key] = localFlags[key] + } +} + +if (Object.keys(updateToRmoteFlags).length > 0) { + await Promise.allSettled( + Object.entries(updateToRmoteFlags).map(([key, flag]) => { + return fetch( + `https://app.posthog.com/api/projects/${process.env.POSTHOG_PROJECT_ID}/feature_flags/`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${process.env.POSTHOG_PRIVATE_KEY}`, + }, + body: JSON.stringify({ + key, + active: flag, + }), + }, + ) + }), + ) + + console.info("update flags", inspect(updateToRmoteFlags)) +} From d81f57d2ad24ab9176a6d342f427676065c0f5f6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Fri, 20 Sep 2024 19:05:29 +0800 Subject: [PATCH 02/37] feat: read image proxy url from ab value --- apps/renderer/src/hooks/biz/useAb.ts | 9 +++++++-- apps/renderer/src/lib/img-proxy.ts | 9 ++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/renderer/src/hooks/biz/useAb.ts b/apps/renderer/src/hooks/biz/useAb.ts index 3eddbb14f..213704f5c 100644 --- a/apps/renderer/src/hooks/biz/useAb.ts +++ b/apps/renderer/src/hooks/biz/useAb.ts @@ -17,8 +17,9 @@ export const useAb = (feature: FeatureKeys) => { return isEnabled } -export const getAbValue = (feature: FeatureKeys) => { - const enabled = PostHog.getFeatureFlag(feature) +export const isAbEnabled = (feature: FeatureKeys) => { + const featureFlag = PostHog.getFeatureFlag(feature) + const enabled = typeof featureFlag === "boolean" ? featureFlag : featureFlag === "enabled" const debugOverride = jotaiStore.get(debugFeaturesAtom) const isEnableOverride = jotaiStore.get(enableDebugOverrideAtom) @@ -29,3 +30,7 @@ export const getAbValue = (feature: FeatureKeys) => { return enabled } + +export const getAbValue = (feature: FeatureKeys) => { + return PostHog.getFeatureFlagPayload(feature) +} diff --git a/apps/renderer/src/lib/img-proxy.ts b/apps/renderer/src/lib/img-proxy.ts index c839c3937..9b61011b1 100644 --- a/apps/renderer/src/lib/img-proxy.ts +++ b/apps/renderer/src/lib/img-proxy.ts @@ -1,7 +1,6 @@ -import { env } from "@follow/shared/env" import { imageRefererMatches } from "@follow/shared/image" -import { getAbValue } from "~/hooks/biz/useAb" +import { getAbValue, isAbEnabled } from "~/hooks/biz/useAb" export const getImageProxyUrl = ({ url, @@ -12,10 +11,10 @@ export const getImageProxyUrl = ({ width: number height: number }) => { - if (getAbValue("Image_Proxy_V2")) { - return `${env.VITE_IMGPROXY_URL}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` + if (isAbEnabled("Image_Proxy_V2")) { + return `${getAbValue("Image_Proxy_V2")}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` } else { - return `${env.VITE_IMGPROXY_URL}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` + return `${getAbValue("Image_Proxy_V2")}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` } } From 8decd4326e56f11bb04333fb86fa5d43f689ab3b Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Fri, 20 Sep 2024 19:18:46 +0800 Subject: [PATCH 03/37] chore: format --- apps/renderer/src/modules/ab/providers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/renderer/src/modules/ab/providers.tsx b/apps/renderer/src/modules/ab/providers.tsx index 45758074a..ce0f8f0ab 100644 --- a/apps/renderer/src/modules/ab/providers.tsx +++ b/apps/renderer/src/modules/ab/providers.tsx @@ -62,7 +62,7 @@ const ABModalContent = () => { onCheckedChange={(checked) => { setEnableDebugOverride(checked) }} - /> + /> From 3bf9d9ea222170d95c8aef91c6af897fa8cf5f60 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 20 Sep 2024 21:38:22 +0800 Subject: [PATCH 04/37] update Signed-off-by: Innei --- apps/renderer/src/hooks/biz/useAb.ts | 3 +- apps/renderer/src/lib/img-proxy.ts | 5 +- apps/renderer/src/modules/ab/fallback.ts | 5 + packages/shared/src/hono.ts | 328 ++++++++++++++++++----- 4 files changed, 278 insertions(+), 63 deletions(-) create mode 100644 apps/renderer/src/modules/ab/fallback.ts diff --git a/apps/renderer/src/hooks/biz/useAb.ts b/apps/renderer/src/hooks/biz/useAb.ts index 213704f5c..2d7db02ea 100644 --- a/apps/renderer/src/hooks/biz/useAb.ts +++ b/apps/renderer/src/hooks/biz/useAb.ts @@ -5,6 +5,7 @@ import { useFeatureFlagEnabled } from "posthog-js/react" import { jotaiStore } from "~/lib/jotai" import type { FeatureKeys } from "~/modules/ab/atoms" import { debugFeaturesAtom, enableDebugOverrideAtom, IS_DEBUG_ENV } from "~/modules/ab/atoms" +import { abPayloadFallback } from "~/modules/ab/fallback" export const useAb = (feature: FeatureKeys) => { const isEnableDebugOverrides = useAtomValue(enableDebugOverrideAtom) @@ -32,5 +33,5 @@ export const isAbEnabled = (feature: FeatureKeys) => { } export const getAbValue = (feature: FeatureKeys) => { - return PostHog.getFeatureFlagPayload(feature) + return PostHog.getFeatureFlagPayload(feature) || abPayloadFallback[feature] } diff --git a/apps/renderer/src/lib/img-proxy.ts b/apps/renderer/src/lib/img-proxy.ts index 9b61011b1..8345002bd 100644 --- a/apps/renderer/src/lib/img-proxy.ts +++ b/apps/renderer/src/lib/img-proxy.ts @@ -11,10 +11,11 @@ export const getImageProxyUrl = ({ width: number height: number }) => { + const abValue = getAbValue("Image_Proxy_V2") if (isAbEnabled("Image_Proxy_V2")) { - return `${getAbValue("Image_Proxy_V2")}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` + return `${abValue}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` } else { - return `${getAbValue("Image_Proxy_V2")}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` + return `${abValue}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` } } diff --git a/apps/renderer/src/modules/ab/fallback.ts b/apps/renderer/src/modules/ab/fallback.ts new file mode 100644 index 000000000..ecac73508 --- /dev/null +++ b/apps/renderer/src/modules/ab/fallback.ts @@ -0,0 +1,5 @@ +import type { FeatureKeys } from "./atoms" + +export const abPayloadFallback: Record = { + Image_Proxy_V2: "https://thumbor.follow.is", +} diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index ef708be2a..88d8a0e26 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -1,15 +1,179 @@ import * as hono_hono_base from 'hono/hono-base'; import { HttpBindings } from '@hono/node-server'; -import * as drizzle_orm from 'drizzle-orm'; -import { InferInsertModel } from 'drizzle-orm'; -import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; import * as zod from 'zod'; import { z } from 'zod'; +import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; +import * as drizzle_orm from 'drizzle-orm'; +import { InferInsertModel } from 'drizzle-orm'; type Env = { Bindings: HttpBindings; }; +declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "achievements"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "achievements"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "achievements"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + type: drizzle_orm_pg_core.PgColumn<{ + name: "type"; + tableName: "achievements"; + dataType: "string"; + columnType: "PgText"; + data: "received" | "checking" | "completed" | "incomplete"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["checking", "completed", "incomplete", "received"]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + actionId: drizzle_orm_pg_core.PgColumn<{ + name: "action_id"; + tableName: "achievements"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + progress: drizzle_orm_pg_core.PgColumn<{ + name: "progress"; + tableName: "achievements"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + progressMax: drizzle_orm_pg_core.PgColumn<{ + name: "progress_max"; + tableName: "achievements"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + done: drizzle_orm_pg_core.PgColumn<{ + name: "done"; + tableName: "achievements"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + doneAt: drizzle_orm_pg_core.PgColumn<{ + name: "done_at"; + tableName: "achievements"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const achievementsOpenAPISchema: zod.ZodObject<{ + id: zod.ZodString; + userId: zod.ZodString; + type: zod.ZodEnum<["checking", "completed", "incomplete", "received"]>; + actionId: zod.ZodNumber; + progress: zod.ZodNumber; + progressMax: zod.ZodNumber; + done: zod.ZodBoolean; + doneAt: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + type: "received" | "checking" | "completed" | "incomplete"; + id: string; + userId: string; + actionId: number; + progress: number; + progressMax: number; + done: boolean; + doneAt: string | null; +}, { + type: "received" | "checking" | "completed" | "incomplete"; + id: string; + userId: string; + actionId: number; + progress: number; + progressMax: number; + done: boolean; + doneAt: string | null; +}>; + declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>; declare const conditionFieldSchema: z.ZodEnum<["view", "title", "site_url", "feed_url", "category"]>; declare const conditionOperatorSchema: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; @@ -110,11 +274,11 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; }, "strip", z.ZodTypeAny, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }>, "many">>; }, "strip", z.ZodTypeAny, { @@ -127,7 +291,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; }, { @@ -140,17 +304,12 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; }>; }, "strip", z.ZodTypeAny, { name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url" | "category"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; result: { summary?: boolean | undefined; translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; @@ -161,17 +320,17 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; }; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; }, { name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url" | "category"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; result: { summary?: boolean | undefined; translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; @@ -182,10 +341,15 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{ }[] | undefined; blockRules?: { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }[] | undefined; }; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; }>; declare const actionsOpenAPISchema: z.ZodObject; }, "strip", z.ZodTypeAny, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }, { value: string | number; - field: "title" | "content" | "all" | "author" | "url" | "order"; + field: "title" | "all" | "content" | "author" | "url" | "order"; operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; }>, "many">>; }, "strip", z.ZodTypeAny, { @@ -247,7 +411,7 @@ declare const actionsOpenAPISchema: z.ZodObject; }, "strip", z.ZodTypeAny, { name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url" | "category"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; result: { summary?: boolean | undefined; translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; @@ -281,17 +440,17 @@ declare const actionsOpenAPISchema: z.ZodObject, "many">>>; }>, "strip", z.ZodTypeAny, { userId: string; rules?: { name: string; - condition: { - value: string; - field: "title" | "view" | "site_url" | "feed_url" | "category"; - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; - }[]; result: { summary?: boolean | undefined; translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; @@ -326,20 +485,20 @@ declare const actionsOpenAPISchema: z.ZodObject; declare const actionsRelations: drizzle_orm.Relations<"actions", { @@ -3736,11 +3900,6 @@ declare const _routes: hono_hono_base.HonoBase; type AppType = typeof _routes; -export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; +export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; From caf5fe5c839cc68aec786114b5a659cc8352d167 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 20 Sep 2024 21:56:33 +0800 Subject: [PATCH 05/37] fix: import circular and copywrite i18n Signed-off-by: Innei --- .../src/modules/settings/tabs/general.tsx | 213 +++++++++--------- .../src/pages/settings/(settings)/general.tsx | 8 +- 2 files changed, 111 insertions(+), 110 deletions(-) diff --git a/apps/renderer/src/modules/settings/tabs/general.tsx b/apps/renderer/src/modules/settings/tabs/general.tsx index c31c63747..c37059eac 100644 --- a/apps/renderer/src/modules/settings/tabs/general.tsx +++ b/apps/renderer/src/modules/settings/tabs/general.tsx @@ -31,7 +31,6 @@ import { clearLocalPersistStoreData } from "~/store/utils/clear" import { SettingDescription, SettingInput } from "../control" import { SettingItemGroup } from "../section" -import { SettingsTitle } from "../title" const { defineSettingItem, SettingBuilder } = createSetting( useGeneralSettingValue, @@ -54,120 +53,116 @@ export const SettingGeneral = () => { const { present } = useModalStack() return ( - <> - -
- + { - present({ - title: t("general.rebuild_database.title"), - clickOutsideToDismiss: true, - content: () => ( -
-

{t("general.rebuild_database.warning.line1")}

-

{t("general.rebuild_database.warning.line2")}

-
- -
+ }), + { + label: t("general.rebuild_database.label"), + action: async () => { + present({ + title: t("general.rebuild_database.title"), + clickOutsideToDismiss: true, + content: () => ( +
+

{t("general.rebuild_database.warning.line1")}

+

{t("general.rebuild_database.warning.line2")}

+
+
- ), - }) - }, - description: t("general.rebuild_database.description"), - buttonText: t("general.rebuild_database.button"), +
+ ), + }) }, + description: t("general.rebuild_database.description"), + buttonText: t("general.rebuild_database.button"), + }, - { type: "title", value: t("general.network"), disabled: !window.electron }, - window.electron && NettingSetting, - ]} - /> -
- + { type: "title", value: t("general.network"), disabled: !window.electron }, + window.electron && NettingSetting, + ]} + /> +
) } diff --git a/apps/renderer/src/pages/settings/(settings)/general.tsx b/apps/renderer/src/pages/settings/(settings)/general.tsx index 54f219090..23f2998d3 100644 --- a/apps/renderer/src/pages/settings/(settings)/general.tsx +++ b/apps/renderer/src/pages/settings/(settings)/general.tsx @@ -1,4 +1,5 @@ import { SettingGeneral } from "~/modules/settings/tabs/general" +import { SettingsTitle } from "~/modules/settings/title" import { defineSettingPageData } from "~/modules/settings/utils" const iconName = "i-mgc-settings-7-cute-re" @@ -11,5 +12,10 @@ export const loader = defineSettingPageData({ }) export function Component() { - return + return ( + <> + + + + ) } From 4166cb205e3588d57489664359ca4de4711c9e48 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Sun, 22 Sep 2024 16:32:40 +0800 Subject: [PATCH 06/37] chore: update hono --- packages/shared/src/hono.ts | 1528 +++++++++++++++++++++++++++-------- 1 file changed, 1190 insertions(+), 338 deletions(-) diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index 88d8a0e26..8b173f78c 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -1390,49 +1390,6 @@ declare const feedsOpenAPISchema: zod.ZodObject<{ errorAt: string | null; ownerUserId: string | null; }>; -declare const feedsInputSchema: zod.ZodObject<{ - description: zod.ZodOptional>; - title: zod.ZodOptional>; - id: zod.ZodOptional; - image: zod.ZodOptional>; - url: zod.ZodString; - siteUrl: zod.ZodOptional>; - checkedAt: zod.ZodString; - lastModifiedHeader: zod.ZodOptional>; - etagHeader: zod.ZodOptional>; - ttl: zod.ZodOptional>; - errorMessage: zod.ZodOptional>; - errorAt: zod.ZodOptional>; - ownerUserId: zod.ZodOptional>; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - url: string; - checkedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - id?: string | undefined; - image?: string | null | undefined; - siteUrl?: string | null | undefined; - lastModifiedHeader?: string | null | undefined; - etagHeader?: string | null | undefined; - ttl?: number | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; -}, { - url: string; - checkedAt: string; - description?: string | null | undefined; - title?: string | null | undefined; - id?: string | undefined; - image?: string | null | undefined; - siteUrl?: string | null | undefined; - lastModifiedHeader?: string | null | undefined; - etagHeader?: string | null | undefined; - ttl?: number | null | undefined; - errorMessage?: string | null | undefined; - errorAt?: string | null | undefined; - ownerUserId?: string | null | undefined; -}>; declare const feedsRelations: drizzle_orm.Relations<"feeds", { subscriptions: drizzle_orm.Many<"subscriptions">; entries: drizzle_orm.Many<"entries">; @@ -1440,201 +1397,6 @@ declare const feedsRelations: drizzle_orm.Relations<"feeds", { }>; type FeedModel = InferInsertModel; -declare const invitations: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "invitations"; - schema: undefined; - columns: { - code: drizzle_orm_pg_core.PgColumn<{ - name: "code"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - createdAt: drizzle_orm_pg_core.PgColumn<{ - name: "created_at"; - tableName: "invitations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - fromUserId: drizzle_orm_pg_core.PgColumn<{ - name: "from_user_id"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - toUserId: drizzle_orm_pg_core.PgColumn<{ - name: "to_user_id"; - tableName: "invitations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -declare const invitationsOpenAPISchema: zod.ZodObject<{ - code: zod.ZodString; - createdAt: zod.ZodNullable; - fromUserId: zod.ZodString; - toUserId: zod.ZodNullable; -}, zod.UnknownKeysParam, zod.ZodTypeAny, { - code: string; - createdAt: string | null; - fromUserId: string; - toUserId: string | null; -}, { - code: string; - createdAt: string | null; - fromUserId: string; - toUserId: string | null; -}>; -declare const invitationsRelations: drizzle_orm.Relations<"invitations", { - users: drizzle_orm.One<"user", false>; -}>; - -declare const settings: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "settings"; - schema: undefined; - columns: { - id: drizzle_orm_pg_core.PgColumn<{ - name: "id"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: true; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - userId: drizzle_orm_pg_core.PgColumn<{ - name: "user_id"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - tab: drizzle_orm_pg_core.PgColumn<{ - name: "tab"; - tableName: "settings"; - dataType: "string"; - columnType: "PgText"; - data: "general" | "appearance" | "integration"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: ["general", "appearance", "integration"]; - baseColumn: never; - generated: undefined; - }, {}, {}>; - payload: drizzle_orm_pg_core.PgColumn<{ - name: "payload"; - tableName: "settings"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - updateAt: drizzle_orm_pg_core.PgColumn<{ - name: "update_at"; - tableName: "settings"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - version: drizzle_orm_pg_core.PgColumn<{ - name: "version"; - tableName: "settings"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; - declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{ name: "subscriptions"; schema: undefined; @@ -1915,6 +1677,625 @@ declare const timelineRelations: drizzle_orm.Relations<"timeline", { collections: drizzle_orm.One<"collections", true>; }>; +declare const invitations: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "invitations"; + schema: undefined; + columns: { + code: drizzle_orm_pg_core.PgColumn<{ + name: "code"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "invitations"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + fromUserId: drizzle_orm_pg_core.PgColumn<{ + name: "from_user_id"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + toUserId: drizzle_orm_pg_core.PgColumn<{ + name: "to_user_id"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const invitationsOpenAPISchema: zod.ZodObject<{ + code: zod.ZodString; + createdAt: zod.ZodNullable; + fromUserId: zod.ZodString; + toUserId: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + code: string; + createdAt: string | null; + fromUserId: string; + toUserId: string | null; +}, { + code: string; + createdAt: string | null; + fromUserId: string; + toUserId: string | null; +}>; +declare const invitationsRelations: drizzle_orm.Relations<"invitations", { + users: drizzle_orm.One<"user", false>; +}>; + +declare const lists: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "lists"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedIds: drizzle_orm_pg_core.PgColumn<{ + name: "feed_ids"; + tableName: "lists"; + dataType: "array"; + columnType: "PgArray"; + data: string[]; + driverParam: string | string[]; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: drizzle_orm.Column<{ + name: "feed_ids"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, object, object>; + generated: undefined; + }, {}, {}>; + title: drizzle_orm_pg_core.PgColumn<{ + name: "title"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + description: drizzle_orm_pg_core.PgColumn<{ + name: "description"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + image: drizzle_orm_pg_core.PgColumn<{ + name: "image"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + view: drizzle_orm_pg_core.PgColumn<{ + name: "view"; + tableName: "lists"; + dataType: "number"; + columnType: "PgSmallInt"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + fee: drizzle_orm_pg_core.PgColumn<{ + name: "fee"; + tableName: "lists"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + timelineUpdatedAt: drizzle_orm_pg_core.PgColumn<{ + name: "timeline_updated_at"; + tableName: "lists"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + ownerUserId: drizzle_orm_pg_core.PgColumn<{ + name: "owner_user_id"; + tableName: "lists"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const listsOpenAPISchema: zod.ZodObject<{ + id: zod.ZodString; + feedIds: zod.ZodArray; + title: zod.ZodString; + description: zod.ZodNullable; + image: zod.ZodNullable; + view: zod.ZodNumber; + fee: zod.ZodNumber; + timelineUpdatedAt: zod.ZodString; + ownerUserId: zod.ZodString; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + description: string | null; + title: string; + id: string; + image: string | null; + view: number; + ownerUserId: string; + feedIds: string[]; + fee: number; + timelineUpdatedAt: string; +}, { + description: string | null; + title: string; + id: string; + image: string | null; + view: number; + ownerUserId: string; + feedIds: string[]; + fee: number; + timelineUpdatedAt: string; +}>; +declare const listsRelations: drizzle_orm.Relations<"lists", { + owner: drizzle_orm.One<"user", true>; + listsSubscriptions: drizzle_orm.Many<"lists_subscriptions">; +}>; + +declare const listsSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "lists_subscriptions"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "lists_subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + listId: drizzle_orm_pg_core.PgColumn<{ + name: "list_id"; + tableName: "lists_subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + view: drizzle_orm_pg_core.PgColumn<{ + name: "view"; + tableName: "lists_subscriptions"; + dataType: "number"; + columnType: "PgSmallInt"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + title: drizzle_orm_pg_core.PgColumn<{ + name: "title"; + tableName: "lists_subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + lastViewedAt: drizzle_orm_pg_core.PgColumn<{ + name: "last_viewed_at"; + tableName: "lists_subscriptions"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + isPrivate: drizzle_orm_pg_core.PgColumn<{ + name: "is_private"; + tableName: "lists_subscriptions"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString; + listId: zod.ZodString; + view: zod.ZodNumber; + title: zod.ZodNullable; + lastViewedAt: zod.ZodNullable; + isPrivate: zod.ZodBoolean; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + title: string | null; + userId: string; + view: number; + isPrivate: boolean; + listId: string; + lastViewedAt: string | null; +}, { + title: string | null; + userId: string; + view: number; + isPrivate: boolean; + listId: string; + lastViewedAt: string | null; +}>; +declare const listsSubscriptionsRelations: drizzle_orm.Relations<"lists_subscriptions", { + users: drizzle_orm.One<"user", true>; + lists: drizzle_orm.One<"lists", true>; +}>; + +declare const listsTimeline: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "lists_timeline"; + schema: undefined; + columns: { + listId: drizzle_orm_pg_core.PgColumn<{ + name: "list_id"; + tableName: "lists_timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feedId"; + tableName: "lists_timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + entryId: drizzle_orm_pg_core.PgColumn<{ + name: "entry_id"; + tableName: "lists_timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + insertedAt: drizzle_orm_pg_core.PgColumn<{ + name: "inserted_at"; + tableName: "lists_timeline"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const listsTimelineOpenAPISchema: zod.ZodObject<{ + listId: zod.ZodString; + feedId: zod.ZodString; + entryId: zod.ZodString; + insertedAt: zod.ZodString; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + feedId: string; + insertedAt: string; + entryId: string; + listId: string; +}, { + feedId: string; + insertedAt: string; + entryId: string; + listId: string; +}>; +declare const listsTimelineRelations: drizzle_orm.Relations<"lists_timeline", { + entries: drizzle_orm.One<"entries", true>; + feeds: drizzle_orm.One<"feeds", true>; +}>; + +declare const settings: drizzle_orm_pg_core.PgTableWithColumns<{ + name: "settings"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + tab: drizzle_orm_pg_core.PgColumn<{ + name: "tab"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: "general" | "appearance" | "integration"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["general", "appearance", "integration"]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + payload: drizzle_orm_pg_core.PgColumn<{ + name: "payload"; + tableName: "settings"; + dataType: "json"; + columnType: "PgJsonb"; + data: Record; + driverParam: unknown; + notNull: false; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + updateAt: drizzle_orm_pg_core.PgColumn<{ + name: "update_at"; + tableName: "settings"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + version: drizzle_orm_pg_core.PgColumn<{ + name: "version"; + tableName: "settings"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; + declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ name: "user"; schema: undefined; @@ -2352,6 +2733,7 @@ declare const verificationTokens: drizzle_orm_pg_core.PgTableWithColumns<{ }>; declare const usersRelations: drizzle_orm.Relations<"user", { subscriptions: drizzle_orm.Many<"subscriptions">; + listsSubscriptions: drizzle_orm.Many<"lists_subscriptions">; collections: drizzle_orm.Many<"collections">; actions: drizzle_orm.One<"actions", true>; wallets: drizzle_orm.One<"wallets", true>; @@ -2576,6 +2958,22 @@ declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{ baseColumn: never; generated: undefined; }, {}, {}>; + toListId: drizzle_orm_pg_core.PgColumn<{ + name: "to_list_id"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; toEntryId: drizzle_orm_pg_core.PgColumn<{ name: "to_entry_id"; tableName: "transactions"; @@ -2649,6 +3047,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{ fromUserId: zod.ZodNullable; toUserId: zod.ZodNullable; toFeedId: zod.ZodNullable; + toListId: zod.ZodNullable; toEntryId: zod.ZodNullable; powerToken: zod.ZodString; createdAt: zod.ZodString; @@ -2660,6 +3059,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{ toUserId: string | null; hash: string; toFeedId: string | null; + toListId: string | null; toEntryId: string | null; powerToken: string; comment: string | null; @@ -2670,6 +3070,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{ toUserId: string | null; hash: string; toFeedId: string | null; + toListId: string | null; toEntryId: string | null; powerToken: string; comment: string | null; @@ -2735,6 +3136,288 @@ declare const feedPowerTokensRelations: drizzle_orm.Relations<"feedPowerTokens", }>; declare const _routes: hono_hono_base.HonoBase; type AppType = typeof _routes; -export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; +export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; \ No newline at end of file From 17b1de9e7c9e210608f70960e7413a1addd82f37 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Sun, 22 Sep 2024 16:33:38 +0800 Subject: [PATCH 07/37] chore: update --- packages/shared/src/hono.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index 8b173f78c..92815780b 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -4858,4 +4858,4 @@ declare const _routes: hono_hono_base.HonoBase; type AppType = typeof _routes; -export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; \ No newline at end of file +export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; From 53b900901ae38a1e439f50254873eaa3b35c2501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B3=A0=E9=9F=B3?= Date: Sun, 22 Sep 2024 18:14:06 +0800 Subject: [PATCH 08/37] feat[i18n]: Complete Chinese i18n (#560) * Update zh-CN.json * Complete zh-TW i18n * Complete zh-TW i18n. * Fix zh-TW i18n. --- locales/app/zh-CN.json | 23 +++++++++++++++++++++++ locales/app/zh-TW.json | 23 ++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index c52878a0e..e51cf59dd 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -1,4 +1,8 @@ { + "achievement.all_done": "大功告成!", + "achievement.first_claim_feed": "订阅源所有者", + "achievement.first_claim_feed_description": "在 Follow 上认证订阅源", + "achievement.mint_more_power": "成为核心玩家,赚取更多 ", "ai_daily.title": "热点 - {{title}}", "ai_daily.tooltip.content": "AI 根据时间线( - )提取的重点信息", "ai_daily.tooltip.update_schedule": "每天 8:00 和 20:00 定时更新", @@ -14,6 +18,9 @@ "discover.rss_hub_route": "RSSHub 路由", "discover.rss_url": "RSS URL", "discover.select_placeholder": "选择", + "discover.target": "搜索", + "discover.target.feeds": "订阅源", + "discover.target.lists": "列表", "early_access": "预览版本", "entry_actions.copy_link": "复制链接", "entry_actions.failed_to_save_to_eagle": "保存到 Eagle 失败", @@ -81,9 +88,12 @@ "feed_form.category": "分类", "feed_form.category_description": "默认按照网站分类", "feed_form.error_fetching_feed": "获取订阅源出错", + "feed_form.fee": "订阅费", + "feed_form.fee_description": "若需订阅此列表,需支付订阅费用", "feed_form.feed_not_found": "未找到订阅源", "feed_form.feedback": "反馈", "feed_form.follow": "订阅", + "feed_form.follow_with_fee": "使用 {{fee}} Power 订阅", "feed_form.followed": "🎉 订阅成功", "feed_form.private_follow": "私密订阅", "feed_form.private_follow_description": "开启后,该订阅不再显示在个人主页", @@ -127,6 +137,8 @@ "player.playback_rate": "播放速度", "player.unmute": "取消静音", "player.volume": "音量", + "resize.tooltip.double_click_to_collapse": "双击以折叠", + "resize.tooltip.drag_to_resize": "拖动以调整大小", "search.empty.no_results": "搜索结果为空", "search.group.entries": "条目", "search.group.feeds": "订阅源", @@ -146,12 +158,17 @@ "sidebar.feed_actions.claim_feed": "认证订阅", "sidebar.feed_actions.copy_feed_id": "复制 ID", "sidebar.feed_actions.copy_feed_url": "复制链接", + "sidebar.feed_actions.copy_list_id": "复制列表 ID", + "sidebar.feed_actions.copy_list_url": "复制列表链接", "sidebar.feed_actions.edit": "编辑", "sidebar.feed_actions.edit_feed": "编辑订阅", "sidebar.feed_actions.feed_owned_by_you": "该订阅源归你所有", + "sidebar.feed_actions.list_owned_by_you": "该列表归你所有", "sidebar.feed_actions.mark_all_as_read": "全部标记为已读", "sidebar.feed_actions.navigate_to_feed": "跳转至", + "sidebar.feed_actions.navigate_to_list": "跳转至列表", "sidebar.feed_actions.open_feed_in_browser": "在浏览器打开订阅源", + "sidebar.feed_actions.open_list_in_browser": "在浏览器打开列表", "sidebar.feed_actions.open_site_in_browser": "在浏览器打开网站", "sidebar.feed_actions.unfollow": "取消订阅", "sidebar.feed_actions.unfollow_feed": "取消订阅", @@ -179,6 +196,7 @@ "tip_modal.tip_support": "⭐ 打赏表示支持!", "tip_modal.unclaimed_feed": "这个订阅源还没有被认证,收到的 Power 将存放在区块链直到源所有者完成认证", "user_button.account": "账号", + "user_button.achievement": "成就", "user_button.download_desktop_app": "下载客户端", "user_button.log_out": "登出", "user_button.power": "Power", @@ -189,15 +207,20 @@ "user_profile.loading": "加载中", "user_profile.share": "分享", "user_profile.toggle_item_style": "切换列表样式", + "words.achievement": "成就", "words.add": "添加", "words.confirm": "确认", "words.discover": "发现", "words.email": "邮箱", + "words.feeds": "订阅源", "words.import": "导入", "words.items": "内容", "words.language": "语言", + "words.lists": "列表", "words.load_archived_entries": "加载已归档条目", "words.login": "登录", + "words.mint": "Mint", + "words.power": "Power", "words.rss": "RSS", "words.rss3": "RSS3", "words.rsshub": "RSSHub", diff --git a/locales/app/zh-TW.json b/locales/app/zh-TW.json index e83a65ec0..9745d2ed9 100644 --- a/locales/app/zh-TW.json +++ b/locales/app/zh-TW.json @@ -1,4 +1,8 @@ { + "achievement.all_done": "大功告成!", + "achievement.first_claim_feed": "訂閱源所有者", + "achievement.first_claim_feed_description": "在 Follow 上認證訂閱源", + "achievement.mint_more_power": "成為核心玩家,賺取更多 ", "ai_daily.title": "頭條新聞 - {{title}}", "ai_daily.tooltip.content": "以下是 AI 從您的時間軸中選擇的新聞( - ),可能對您很重要。", "ai_daily.tooltip.update_schedule": "每天早上 8 點和晚上 8 點更新。", @@ -14,6 +18,9 @@ "discover.rss_hub_route": "RSSHub 路由", "discover.rss_url": "RSS URL", "discover.select_placeholder": "選擇", + "discover.target": "搜尋", + "discover.target.feeds": "訂閱源", + "discover.target.lists": "列表", "early_access": "搶先體驗", "entry_actions.copy_link": "複製連結", "entry_actions.failed_to_save_to_eagle": "無法儲存到 Eagle。", @@ -81,9 +88,12 @@ "feed_form.category": "類別", "feed_form.category_description": "預設情況下,您的關注將按網站分組。", "feed_form.error_fetching_feed": "獲取摘要時出錯。", + "feed_form.fee": "訂閱費", + "feed_form.fee_description": "若需訂閱此列表,需支付訂閱費用", "feed_form.feed_not_found": "未找到摘要。", "feed_form.feedback": "回饋", "feed_form.follow": "關注", + "feed_form.follow_with_fee": "使用 {{fee}} Power 訂閱", "feed_form.followed": "🎉 已關注。", "feed_form.private_follow": "私人關注", "feed_form.private_follow_description": "此關注是否在您的個人資料頁面上公開顯示。", @@ -127,8 +137,10 @@ "player.playback_rate": "播放速率", "player.unmute": "取消靜音", "player.volume": "音量", + "resize.tooltip.double_click_to_collapse": "雙擊以摺疊", + "resize.tooltip.drag_to_resize": "拖動以調整大小", "search.empty.no_results": "未找到結果。", - "search.group.entries": "條目", + "search.group.entries": "項目", "search.group.feeds": "摘要", "search.options.all": "全部", "search.options.entries": "項目", @@ -146,12 +158,16 @@ "sidebar.feed_actions.claim_feed": "認領摘要", "sidebar.feed_actions.copy_feed_id": "複製摘要 ID", "sidebar.feed_actions.copy_feed_url": "複製摘要 URL", + "sidebar.feed_actions.copy_list_id": "複製列表 ID", + "sidebar.feed_actions.copy_list_url": "複製列表連結", "sidebar.feed_actions.edit": "編輯", "sidebar.feed_actions.edit_feed": "編輯摘要", "sidebar.feed_actions.feed_owned_by_you": "此摘要由你所擁有", + "sidebar.feed_actions.list_owned_by_you": "該列表歸你所有", "sidebar.feed_actions.mark_all_as_read": "全部標記為已讀", "sidebar.feed_actions.navigate_to_feed": "導航到摘要", "sidebar.feed_actions.open_feed_in_browser": "使用瀏覽器打開這個摘要", + "sidebar.feed_actions.open_list_in_browser": "在瀏覽器開啟列表", "sidebar.feed_actions.open_site_in_browser": "使用瀏覽器打開這個網站", "sidebar.feed_actions.unfollow": "取消關注", "sidebar.feed_actions.unfollow_feed": "取消關注摘要", @@ -179,6 +195,7 @@ "tip_modal.tip_support": "⭐ 贊助以表示你的支持!", "tip_modal.unclaimed_feed": "目前尚無人認領此摘要。收到的 Power 將安全地保存在區塊鏈合約中,直到被認領為止。", "user_button.account": "帳戶", + "user_button.achievement": "成就", "user_button.download_desktop_app": "下載桌面應用程式", "user_button.log_out": "登出", "user_button.power": "Power", @@ -189,15 +206,19 @@ "user_profile.loading": "載入中", "user_profile.share": "分享", "user_profile.toggle_item_style": "切換項目樣式", + "words.achievement": "成就", "words.add": "新增", "words.confirm": "確認", "words.discover": "發現", "words.email": "Email", + "words.feeds": "摘要", "words.import": "匯入", "words.items": "內容", "words.language": "語言", + "words.lists": "列表", "words.load_archived_entries": "載入已封存項目", "words.login": "登入", + "words.power": "Power", "words.rss": "RSS", "words.rss3": "RSS3", "words.rsshub": "RSSHub", From 09d77657a07f81d69f80c3eea1620efe1ddb9da9 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 22 Sep 2024 19:22:54 +0800 Subject: [PATCH 09/37] fix: app width limit to 1024px Signed-off-by: Innei --- apps/renderer/src/pages/(main)/layout.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/renderer/src/pages/(main)/layout.tsx b/apps/renderer/src/pages/(main)/layout.tsx index a348ff81b..9f08904e9 100644 --- a/apps/renderer/src/pages/(main)/layout.tsx +++ b/apps/renderer/src/pages/(main)/layout.tsx @@ -9,6 +9,7 @@ import { useResizable } from "react-resizable-layout" import { Outlet } from "react-router-dom" import { setMainContainerElement } from "~/atoms/dom" +import { useViewport } from "~/atoms/hooks/viewport" import { getUISettings, setUISetting } from "~/atoms/settings/ui" import { setFeedColumnShow, useFeedColumnShow } from "~/atoms/sidebar" import { useLoginModalShow, useWhoami } from "~/atoms/user" @@ -79,6 +80,24 @@ export function Component() { useDailyTask() + const isNotSupportWidth = useViewport((v) => v.w < 1024) + + if (isNotSupportWidth) { + return ( +
+ +
Please using desktop app to using {APP_NAME}
+ +
+ Download:{" "} + + {repository.url} + +
+
+ ) + } + return (
Date: Sun, 22 Sep 2024 19:57:10 +0800 Subject: [PATCH 10/37] fix(eslint): json sort key Signed-off-by: Innei --- eslint.config.mjs | 13 ++++--- locales/app/ar-DZ.json | 2 +- locales/app/ar-MA.json | 2 +- locales/app/ar-SA.json | 2 +- locales/app/ar-iq.json | 2 +- locales/app/ar-kw.json | 2 +- locales/app/ar-tn.json | 2 +- locales/app/en.json | 2 +- locales/app/es.json | 2 +- locales/app/fi.json | 2 +- locales/app/fr.json | 2 +- locales/app/it.json | 2 +- locales/app/ja.json | 2 +- locales/app/pt.json | 2 +- locales/app/ru.json | 2 +- locales/app/zh-CN.json | 2 +- locales/app/zh-HK.json | 2 +- locales/app/zh-TW.json | 2 +- locales/common/ar-DZ.json | 2 +- locales/common/ar-IQ.json | 2 +- locales/common/ar-KW.json | 2 +- locales/common/ar-MA.json | 2 +- locales/common/ar-SA.json | 2 +- locales/common/ar-TN.json | 2 +- locales/common/en.json | 2 +- locales/common/es.json | 2 +- locales/common/fi.json | 2 +- locales/common/fr.json | 2 +- locales/common/it.json | 2 +- locales/common/ja.json | 2 +- locales/common/pt.json | 2 +- locales/common/ru.json | 2 +- locales/common/zh-CN.json | 2 +- locales/common/zh-HK.json | 2 +- locales/common/zh-TW.json | 2 +- locales/errors/en.json | 2 +- locales/errors/fr.json | 2 +- locales/errors/ja.json | 2 +- locales/errors/ru.json | 2 +- locales/errors/zh-CN.json | 2 +- locales/errors/zh-HK.json | 2 +- locales/errors/zh-TW.json | 2 +- locales/external/ar-DZ.json | 2 +- locales/external/ar-MA.json | 2 +- locales/external/ar-SA.json | 2 +- locales/external/ar-iq.json | 2 +- locales/external/ar-kw.json | 2 +- locales/external/ar-tn.json | 2 +- locales/external/en.json | 2 +- locales/external/es.json | 2 +- locales/external/fi.json | 2 +- locales/external/fr.json | 2 +- locales/external/it.json | 2 +- locales/external/ja.json | 2 +- locales/external/pt.json | 2 +- locales/external/ru.json | 2 +- locales/external/zh-CN.json | 2 +- locales/external/zh-HK.json | 2 +- locales/external/zh-TW.json | 2 +- locales/lang/ar-DZ.json | 2 +- locales/lang/ar-IQ.json | 2 +- locales/lang/ar-KW.json | 2 +- locales/lang/ar-MA.json | 2 +- locales/lang/ar-SA.json | 2 +- locales/lang/ar-TN.json | 2 +- locales/lang/en.json | 2 +- locales/lang/es.json | 2 +- locales/lang/fi.json | 2 +- locales/lang/fr.json | 2 +- locales/lang/it.json | 2 +- locales/lang/ja.json | 2 +- locales/lang/pt.json | 2 +- locales/lang/ru.json | 2 +- locales/lang/zh-CN.json | 2 +- locales/lang/zh-HK.json | 2 +- locales/lang/zh-TW.json | 2 +- locales/native/ar-iq.json | 2 +- locales/native/ar-kw.json | 2 +- locales/native/ar-tn.json | 2 +- locales/native/en.json | 2 +- locales/native/it.json | 2 +- locales/native/ja.json | 2 +- locales/native/zh-CN.json | 2 +- locales/native/zh-HK.json | 2 +- locales/native/zh-TW.json | 2 +- locales/settings/ar-DZ.json | 2 +- locales/settings/ar-IQ.json | 2 +- locales/settings/ar-KW.json | 2 +- locales/settings/ar-MA.json | 2 +- locales/settings/ar-SA.json | 2 +- locales/settings/ar-TN.json | 2 +- locales/settings/en.json | 2 +- locales/settings/es.json | 2 +- locales/settings/fi.json | 2 +- locales/settings/fr.json | 2 +- locales/settings/it.json | 2 +- locales/settings/ja.json | 2 +- locales/settings/pt.json | 2 +- locales/settings/ru.json | 2 +- locales/settings/zh-CN.json | 2 +- locales/settings/zh-HK.json | 2 +- locales/settings/zh-TW.json | 2 +- locales/shortcuts/ar-DZ.json | 2 +- locales/shortcuts/ar-IQ.json | 2 +- locales/shortcuts/ar-KW.json | 2 +- locales/shortcuts/ar-MA.json | 2 +- locales/shortcuts/ar-SA.json | 2 +- locales/shortcuts/ar-TN.json | 2 +- locales/shortcuts/en.json | 2 +- locales/shortcuts/es.json | 2 +- locales/shortcuts/fi.json | 2 +- locales/shortcuts/fr.json | 2 +- locales/shortcuts/it.json | 2 +- locales/shortcuts/ja.json | 2 +- locales/shortcuts/pt.json | 2 +- locales/shortcuts/ru.json | 2 +- locales/shortcuts/zh-CN.json | 2 +- locales/shortcuts/zh-HK.json | 2 +- locales/shortcuts/zh-TW.json | 2 +- plugins/eslint-recursive-sort.js | 60 ++++++++++++++++++++++++++++++++ 120 files changed, 184 insertions(+), 125 deletions(-) create mode 100644 plugins/eslint-recursive-sort.js diff --git a/eslint.config.mjs b/eslint.config.mjs index 04a200c7e..6010fe6ec 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +1,8 @@ // @ts-check import { defineConfig } from "eslint-config-hyoban" +import recursiveSort from "./plugins/eslint-recursive-sort.js" + export default defineConfig( { formatting: false, @@ -45,14 +47,11 @@ export default defineConfig( }, { files: ["locales/**/*.json"], + plugins: { + "recursive-sort": recursiveSort, + }, rules: { - "jsonc/sort-keys": [ - "error", - { - pathPattern: ".*", - order: { type: "asc" }, - }, - ], + "recursive-sort/recursive-sort": "error", }, }, ) diff --git a/locales/app/ar-DZ.json b/locales/app/ar-DZ.json index cd7e015c1..12ae19f88 100644 --- a/locales/app/ar-DZ.json +++ b/locales/app/ar-DZ.json @@ -204,4 +204,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "صفر عناصر" -} +} \ No newline at end of file diff --git a/locales/app/ar-MA.json b/locales/app/ar-MA.json index 0088eaca9..9ff9baf08 100644 --- a/locales/app/ar-MA.json +++ b/locales/app/ar-MA.json @@ -204,4 +204,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "صفر عناصر" -} +} \ No newline at end of file diff --git a/locales/app/ar-SA.json b/locales/app/ar-SA.json index 88513247c..7d8358a84 100644 --- a/locales/app/ar-SA.json +++ b/locales/app/ar-SA.json @@ -204,4 +204,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "لا توجد عناصر" -} +} \ No newline at end of file diff --git a/locales/app/ar-iq.json b/locales/app/ar-iq.json index 7fee8b035..0db4be8ae 100644 --- a/locales/app/ar-iq.json +++ b/locales/app/ar-iq.json @@ -207,4 +207,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "لا توجد عناصر" -} +} \ No newline at end of file diff --git a/locales/app/ar-kw.json b/locales/app/ar-kw.json index 1e6151319..b185ded3c 100644 --- a/locales/app/ar-kw.json +++ b/locales/app/ar-kw.json @@ -207,4 +207,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "صفر عناصر" -} +} \ No newline at end of file diff --git a/locales/app/ar-tn.json b/locales/app/ar-tn.json index 0867f3181..6c806a638 100644 --- a/locales/app/ar-tn.json +++ b/locales/app/ar-tn.json @@ -207,4 +207,4 @@ "words.user": "المستخدم", "words.which.all": "الكل", "words.zero_items": "صفر عناصر" -} +} \ No newline at end of file diff --git a/locales/app/en.json b/locales/app/en.json index a20db65eb..97f727303 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -230,4 +230,4 @@ "words.user": "User", "words.which.all": "all", "words.zero_items": "Zero items" -} +} \ No newline at end of file diff --git a/locales/app/es.json b/locales/app/es.json index eca8d2c23..66ed9b984 100644 --- a/locales/app/es.json +++ b/locales/app/es.json @@ -134,4 +134,4 @@ "words.user": "Usuario", "words.which.all": "Todo", "words.zero_items": "Sin contenido" -} +} \ No newline at end of file diff --git a/locales/app/fi.json b/locales/app/fi.json index 11dba1ad4..98a767428 100644 --- a/locales/app/fi.json +++ b/locales/app/fi.json @@ -204,4 +204,4 @@ "words.user": "Käyttäjä", "words.which.all": "kaikki", "words.zero_items": "Ei kohteita" -} +} \ No newline at end of file diff --git a/locales/app/fr.json b/locales/app/fr.json index dc14f478e..703b8a3ae 100644 --- a/locales/app/fr.json +++ b/locales/app/fr.json @@ -204,4 +204,4 @@ "words.user": "Utilisateur", "words.which.all": "tous", "words.zero_items": "Zéro élément" -} +} \ No newline at end of file diff --git a/locales/app/it.json b/locales/app/it.json index 0d550522b..713452f96 100644 --- a/locales/app/it.json +++ b/locales/app/it.json @@ -204,4 +204,4 @@ "words.user": "Utente", "words.which.all": "tutti", "words.zero_items": "Zero elementi" -} +} \ No newline at end of file diff --git a/locales/app/ja.json b/locales/app/ja.json index 51b0dde27..1fd656de7 100644 --- a/locales/app/ja.json +++ b/locales/app/ja.json @@ -203,4 +203,4 @@ "words.user": "ユーザー", "words.which.all": "すべて", "words.zero_items": "アイテムがありません" -} +} \ No newline at end of file diff --git a/locales/app/pt.json b/locales/app/pt.json index 191a45783..e0728c059 100644 --- a/locales/app/pt.json +++ b/locales/app/pt.json @@ -203,4 +203,4 @@ "words.user": "ユーザー", "words.which.all": "すべて", "words.zero_items": "アイテムがありません" -} +} \ No newline at end of file diff --git a/locales/app/ru.json b/locales/app/ru.json index cb02e972c..65f37faa0 100644 --- a/locales/app/ru.json +++ b/locales/app/ru.json @@ -204,4 +204,4 @@ "words.user": "Пользователь", "words.which.all": "все", "words.zero_items": "Нет элементов" -} +} \ No newline at end of file diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index e51cf59dd..0160d81fb 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -230,4 +230,4 @@ "words.user": "用户", "words.which.all": "全部", "words.zero_items": "没有内容" -} +} \ No newline at end of file diff --git a/locales/app/zh-HK.json b/locales/app/zh-HK.json index e17dc6e21..3853cd59f 100644 --- a/locales/app/zh-HK.json +++ b/locales/app/zh-HK.json @@ -207,4 +207,4 @@ "words.user": "用戶", "words.which.all": "所有", "words.zero_items": "零項目" -} +} \ No newline at end of file diff --git a/locales/app/zh-TW.json b/locales/app/zh-TW.json index 9745d2ed9..702d2f1e3 100644 --- a/locales/app/zh-TW.json +++ b/locales/app/zh-TW.json @@ -228,4 +228,4 @@ "words.user": "使用者", "words.which.all": "全部", "words.zero_items": "沒有內容" -} +} \ No newline at end of file diff --git a/locales/common/ar-DZ.json b/locales/common/ar-DZ.json index 78c34d91c..ceed167b0 100644 --- a/locales/common/ar-DZ.json +++ b/locales/common/ar-DZ.json @@ -26,4 +26,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/ar-IQ.json b/locales/common/ar-IQ.json index 09de59417..2c0d91cdc 100644 --- a/locales/common/ar-IQ.json +++ b/locales/common/ar-IQ.json @@ -25,4 +25,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/ar-KW.json b/locales/common/ar-KW.json index 09de59417..2c0d91cdc 100644 --- a/locales/common/ar-KW.json +++ b/locales/common/ar-KW.json @@ -25,4 +25,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/ar-MA.json b/locales/common/ar-MA.json index 66293ad4c..2c6cde327 100644 --- a/locales/common/ar-MA.json +++ b/locales/common/ar-MA.json @@ -26,4 +26,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/ar-SA.json b/locales/common/ar-SA.json index 0ff14b728..9cdc2a7a6 100644 --- a/locales/common/ar-SA.json +++ b/locales/common/ar-SA.json @@ -26,4 +26,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/ar-TN.json b/locales/common/ar-TN.json index 013ae1159..48084040d 100644 --- a/locales/common/ar-TN.json +++ b/locales/common/ar-TN.json @@ -25,4 +25,4 @@ "words.result_other": "نتائج", "words.space": " ", "words.which.all": "الكل" -} +} \ No newline at end of file diff --git a/locales/common/en.json b/locales/common/en.json index 5452d58cf..57af3eb9d 100644 --- a/locales/common/en.json +++ b/locales/common/en.json @@ -31,4 +31,4 @@ "words.submit": "Submit", "words.update": "Update", "words.which.all": "All" -} +} \ No newline at end of file diff --git a/locales/common/es.json b/locales/common/es.json index 42115fdee..331fb2ea1 100644 --- a/locales/common/es.json +++ b/locales/common/es.json @@ -26,4 +26,4 @@ "words.result_other": "resultados", "words.space": " ", "words.which.all": "Todo" -} +} \ No newline at end of file diff --git a/locales/common/fi.json b/locales/common/fi.json index 06c594ab2..778f585c1 100644 --- a/locales/common/fi.json +++ b/locales/common/fi.json @@ -25,4 +25,4 @@ "words.result_other": "tulokset", "words.space": " ", "words.which.all": "Kaikki" -} +} \ No newline at end of file diff --git a/locales/common/fr.json b/locales/common/fr.json index 75ecb72e6..0fc4c7118 100644 --- a/locales/common/fr.json +++ b/locales/common/fr.json @@ -26,4 +26,4 @@ "words.result_other": "résultats", "words.space": " ", "words.which.all": "Tous" -} +} \ No newline at end of file diff --git a/locales/common/it.json b/locales/common/it.json index 3e46cb39d..a3eda93a2 100644 --- a/locales/common/it.json +++ b/locales/common/it.json @@ -25,4 +25,4 @@ "words.result_other": "risultati", "words.space": " ", "words.which.all": "Tutti" -} +} \ No newline at end of file diff --git a/locales/common/ja.json b/locales/common/ja.json index d7c8fd3d4..6bff8e07b 100644 --- a/locales/common/ja.json +++ b/locales/common/ja.json @@ -26,4 +26,4 @@ "words.result_other": "結果", "words.space": "", "words.which.all": "すべて" -} +} \ No newline at end of file diff --git a/locales/common/pt.json b/locales/common/pt.json index 4ed5c6847..3ac23481a 100644 --- a/locales/common/pt.json +++ b/locales/common/pt.json @@ -26,4 +26,4 @@ "words.result_other": "resultados", "words.space": " ", "words.which.all": "Todos" -} +} \ No newline at end of file diff --git a/locales/common/ru.json b/locales/common/ru.json index 81f46ea1d..6cf0c5960 100644 --- a/locales/common/ru.json +++ b/locales/common/ru.json @@ -25,4 +25,4 @@ "words.result_other": "результаты", "words.space": " ", "words.which.all": "Все" -} +} \ No newline at end of file diff --git a/locales/common/zh-CN.json b/locales/common/zh-CN.json index 99c7e3304..aede32947 100644 --- a/locales/common/zh-CN.json +++ b/locales/common/zh-CN.json @@ -27,4 +27,4 @@ "words.result_other": "结果", "words.space": "", "words.which.all": "全部" -} +} \ No newline at end of file diff --git a/locales/common/zh-HK.json b/locales/common/zh-HK.json index 36f3ec1d9..836b855e1 100644 --- a/locales/common/zh-HK.json +++ b/locales/common/zh-HK.json @@ -25,4 +25,4 @@ "words.result_other": "結果", "words.space": " ", "words.which.all": "全部" -} +} \ No newline at end of file diff --git a/locales/common/zh-TW.json b/locales/common/zh-TW.json index 490ba0f24..9f98c22d9 100644 --- a/locales/common/zh-TW.json +++ b/locales/common/zh-TW.json @@ -26,4 +26,4 @@ "words.result_other": "多筆結果", "words.space": " ", "words.which.all": "全部" -} +} \ No newline at end of file diff --git a/locales/errors/en.json b/locales/errors/en.json index 1f8f017fc..0285f181f 100644 --- a/locales/errors/en.json +++ b/locales/errors/en.json @@ -26,4 +26,4 @@ "7001": "Invalid setting tab", "7002": "Invalid setting payload", "7003": "Setting payload too large" -} +} \ No newline at end of file diff --git a/locales/errors/fr.json b/locales/errors/fr.json index b984e3a3e..a5322dab2 100644 --- a/locales/errors/fr.json +++ b/locales/errors/fr.json @@ -26,4 +26,4 @@ "7001": "Onglet de paramètre invalide", "7002": "Contenu de paramètre invalide", "7003": "Contenu de paramètre trop volumineux" -} +} \ No newline at end of file diff --git a/locales/errors/ja.json b/locales/errors/ja.json index 64edfeb9d..3887b0923 100644 --- a/locales/errors/ja.json +++ b/locales/errors/ja.json @@ -26,4 +26,4 @@ "7001": "無効な設定タブです", "7002": "無効な設定ペイロードです", "7003": "設定ペイロードが大きすぎます" -} +} \ No newline at end of file diff --git a/locales/errors/ru.json b/locales/errors/ru.json index f0a9251e0..3d8ce2a2b 100644 --- a/locales/errors/ru.json +++ b/locales/errors/ru.json @@ -26,4 +26,4 @@ "7001": "Неверная вкладка настройки", "7002": "Неверное содержимое настройки", "7003": "Содержимое настройки слишком велико" -} +} \ No newline at end of file diff --git a/locales/errors/zh-CN.json b/locales/errors/zh-CN.json index 0b6a3bdb0..6a4cb7e3b 100644 --- a/locales/errors/zh-CN.json +++ b/locales/errors/zh-CN.json @@ -26,4 +26,4 @@ "7001": "无效的设置标签", "7002": "无效的设置负载", "7003": "设置负载过大" -} +} \ No newline at end of file diff --git a/locales/errors/zh-HK.json b/locales/errors/zh-HK.json index e9f9ab3fc..11a2491a9 100644 --- a/locales/errors/zh-HK.json +++ b/locales/errors/zh-HK.json @@ -26,4 +26,4 @@ "7001": "無效的設定標簽", "7002": "無效的設定負載", "7003": "設定負載太大" -} +} \ No newline at end of file diff --git a/locales/errors/zh-TW.json b/locales/errors/zh-TW.json index 05d90e4eb..e37a86d30 100644 --- a/locales/errors/zh-TW.json +++ b/locales/errors/zh-TW.json @@ -26,4 +26,4 @@ "7001": "設定標籤無效", "7002": "設定負載無效", "7003": "設定負載過大" -} +} \ No newline at end of file diff --git a/locales/external/ar-DZ.json b/locales/external/ar-DZ.json index e243855ea..ea1aca904 100644 --- a/locales/external/ar-DZ.json +++ b/locales/external/ar-DZ.json @@ -39,4 +39,4 @@ "openApp": "افتح {{APP_NAME}}", "successMessage": "تم الاتصال بنجاح بحساب {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ar-MA.json b/locales/external/ar-MA.json index b73818854..113edb3fc 100644 --- a/locales/external/ar-MA.json +++ b/locales/external/ar-MA.json @@ -39,4 +39,4 @@ "openApp": "افتح {{APP_NAME}}", "successMessage": "لقد تم الاتصال بنجاح بحسابك على {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ar-SA.json b/locales/external/ar-SA.json index 99ccef6bb..f09770a23 100644 --- a/locales/external/ar-SA.json +++ b/locales/external/ar-SA.json @@ -39,4 +39,4 @@ "openApp": "فتح {{APP_NAME}}", "successMessage": "تم الاتصال بحساب {{APP_NAME}} بنجاح." } -} +} \ No newline at end of file diff --git a/locales/external/ar-iq.json b/locales/external/ar-iq.json index e243855ea..ea1aca904 100644 --- a/locales/external/ar-iq.json +++ b/locales/external/ar-iq.json @@ -39,4 +39,4 @@ "openApp": "افتح {{APP_NAME}}", "successMessage": "تم الاتصال بنجاح بحساب {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ar-kw.json b/locales/external/ar-kw.json index cffc4ea29..0d21bf094 100644 --- a/locales/external/ar-kw.json +++ b/locales/external/ar-kw.json @@ -40,4 +40,4 @@ "openApp": "افتح {{APP_NAME}}", "successMessage": "تم الاتصال بنجاح بحساب {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ar-tn.json b/locales/external/ar-tn.json index 1d623dcbb..d00ee86cf 100644 --- a/locales/external/ar-tn.json +++ b/locales/external/ar-tn.json @@ -40,4 +40,4 @@ "openApp": "افتح {{APP_NAME}}", "successMessage": "تم الاتصال بحساب {{APP_NAME}} بنجاح." } -} +} \ No newline at end of file diff --git a/locales/external/en.json b/locales/external/en.json index 0d0253701..3bd0c0555 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -32,4 +32,4 @@ "redirect.instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", "redirect.openApp": "Open {{APP_NAME}}", "redirect.successMessage": "You have successfully connected to {{APP_NAME}} Account." -} +} \ No newline at end of file diff --git a/locales/external/es.json b/locales/external/es.json index 102fd9ecc..8e9889de6 100644 --- a/locales/external/es.json +++ b/locales/external/es.json @@ -39,4 +39,4 @@ "openApp": "Abrir {{APP_NAME}}", "successMessage": "Te has conectado exitosamente a la cuenta de {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/fi.json b/locales/external/fi.json index e596c13c7..79327e78c 100644 --- a/locales/external/fi.json +++ b/locales/external/fi.json @@ -39,4 +39,4 @@ "openApp": "Avaa {{APP_NAME}}", "successMessage": "Olet onnistuneesti yhdistänyt {{APP_NAME}}-tilisi." } -} +} \ No newline at end of file diff --git a/locales/external/fr.json b/locales/external/fr.json index b8ea48ffa..6f7d70d64 100644 --- a/locales/external/fr.json +++ b/locales/external/fr.json @@ -39,4 +39,4 @@ "openApp": "Ouvrir {{APP_NAME}}", "successMessage": "Vous vous êtes connecté avec succès à votre compte {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/it.json b/locales/external/it.json index b57e20a50..54912edce 100644 --- a/locales/external/it.json +++ b/locales/external/it.json @@ -39,4 +39,4 @@ "openApp": "Apri {{APP_NAME}}", "successMessage": "Ti sei connesso con successo all'account {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ja.json b/locales/external/ja.json index c18a56a64..49701eea4 100644 --- a/locales/external/ja.json +++ b/locales/external/ja.json @@ -39,4 +39,4 @@ "openApp": "{{APP_NAME}}を開く", "successMessage": "{{APP_NAME}}アカウントに正常に接続されました。" } -} +} \ No newline at end of file diff --git a/locales/external/pt.json b/locales/external/pt.json index 4613d598a..279d3d770 100644 --- a/locales/external/pt.json +++ b/locales/external/pt.json @@ -39,4 +39,4 @@ "openApp": "Abrir {{APP_NAME}}", "successMessage": "Conectou-se com sucesso à conta {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/ru.json b/locales/external/ru.json index 5bdf546a0..f57e4b034 100644 --- a/locales/external/ru.json +++ b/locales/external/ru.json @@ -39,4 +39,4 @@ "openApp": "Открыть {{APP_NAME}}", "successMessage": "Вы успешно подключились к аккаунту {{APP_NAME}}." } -} +} \ No newline at end of file diff --git a/locales/external/zh-CN.json b/locales/external/zh-CN.json index 913e8c2f3..948006303 100644 --- a/locales/external/zh-CN.json +++ b/locales/external/zh-CN.json @@ -39,4 +39,4 @@ "openApp": "打开 {{APP_NAME}}", "successMessage": "已成功连接到 {{APP_NAME}} 账户。" } -} +} \ No newline at end of file diff --git a/locales/external/zh-HK.json b/locales/external/zh-HK.json index 8345a15a7..169852d72 100644 --- a/locales/external/zh-HK.json +++ b/locales/external/zh-HK.json @@ -40,4 +40,4 @@ "openApp": "打開 {{APP_NAME}}", "successMessage": "你已成功連接到 {{APP_NAME}} 帳戶。" } -} +} \ No newline at end of file diff --git a/locales/external/zh-TW.json b/locales/external/zh-TW.json index 4f94e7c11..50f542efc 100644 --- a/locales/external/zh-TW.json +++ b/locales/external/zh-TW.json @@ -40,4 +40,4 @@ "openApp": "開啟 {{APP_NAME}}", "successMessage": "您已成功連接至 {{APP_NAME}} 帳戶。" } -} +} \ No newline at end of file diff --git a/locales/lang/ar-DZ.json b/locales/lang/ar-DZ.json index e508a8098..db2a437a2 100644 --- a/locales/lang/ar-DZ.json +++ b/locales/lang/ar-DZ.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (الجزائر)" -} +} \ No newline at end of file diff --git a/locales/lang/ar-IQ.json b/locales/lang/ar-IQ.json index 29128b5b9..f74322a22 100644 --- a/locales/lang/ar-IQ.json +++ b/locales/lang/ar-IQ.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (العراق)" -} +} \ No newline at end of file diff --git a/locales/lang/ar-KW.json b/locales/lang/ar-KW.json index 9f61c3dd3..095668640 100644 --- a/locales/lang/ar-KW.json +++ b/locales/lang/ar-KW.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (الكويت)" -} +} \ No newline at end of file diff --git a/locales/lang/ar-MA.json b/locales/lang/ar-MA.json index 56bf9328e..3dc6a0a5e 100644 --- a/locales/lang/ar-MA.json +++ b/locales/lang/ar-MA.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (المغرب)" -} +} \ No newline at end of file diff --git a/locales/lang/ar-SA.json b/locales/lang/ar-SA.json index be22948df..dd77984c2 100644 --- a/locales/lang/ar-SA.json +++ b/locales/lang/ar-SA.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (السعودية)" -} +} \ No newline at end of file diff --git a/locales/lang/ar-TN.json b/locales/lang/ar-TN.json index 55e522c42..0ed98a87c 100644 --- a/locales/lang/ar-TN.json +++ b/locales/lang/ar-TN.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "العربية (تونس)" -} +} \ No newline at end of file diff --git a/locales/lang/en.json b/locales/lang/en.json index 4c98959c5..54bfdc6fa 100644 --- a/locales/lang/en.json +++ b/locales/lang/en.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "English" -} +} \ No newline at end of file diff --git a/locales/lang/es.json b/locales/lang/es.json index 6770e31e2..c63f73068 100644 --- a/locales/lang/es.json +++ b/locales/lang/es.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Español" -} +} \ No newline at end of file diff --git a/locales/lang/fi.json b/locales/lang/fi.json index 5c4ca6c84..6bace9d2a 100644 --- a/locales/lang/fi.json +++ b/locales/lang/fi.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Suomi" -} +} \ No newline at end of file diff --git a/locales/lang/fr.json b/locales/lang/fr.json index b6ca82157..39afcd606 100644 --- a/locales/lang/fr.json +++ b/locales/lang/fr.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Français" -} +} \ No newline at end of file diff --git a/locales/lang/it.json b/locales/lang/it.json index dbb40169f..1edea01ad 100644 --- a/locales/lang/it.json +++ b/locales/lang/it.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Italiano" -} +} \ No newline at end of file diff --git a/locales/lang/ja.json b/locales/lang/ja.json index ba6647d52..d14e14328 100644 --- a/locales/lang/ja.json +++ b/locales/lang/ja.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "日本語" -} +} \ No newline at end of file diff --git a/locales/lang/pt.json b/locales/lang/pt.json index de2304bc3..19272a5a3 100644 --- a/locales/lang/pt.json +++ b/locales/lang/pt.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Português" -} +} \ No newline at end of file diff --git a/locales/lang/ru.json b/locales/lang/ru.json index d38033f88..1311d25b7 100644 --- a/locales/lang/ru.json +++ b/locales/lang/ru.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "Русский" -} +} \ No newline at end of file diff --git a/locales/lang/zh-CN.json b/locales/lang/zh-CN.json index 92e726a3e..69c48e4f3 100644 --- a/locales/lang/zh-CN.json +++ b/locales/lang/zh-CN.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "简体中文" -} +} \ No newline at end of file diff --git a/locales/lang/zh-HK.json b/locales/lang/zh-HK.json index ff7b5df21..7dc74c1fc 100644 --- a/locales/lang/zh-HK.json +++ b/locales/lang/zh-HK.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "繁體中文(香港)" -} +} \ No newline at end of file diff --git a/locales/lang/zh-TW.json b/locales/lang/zh-TW.json index de1f73226..0bc2ccb0f 100644 --- a/locales/lang/zh-TW.json +++ b/locales/lang/zh-TW.json @@ -17,4 +17,4 @@ "langs.zh-HK": "繁體中文(香港)", "langs.zh-TW": "繁體中文(台灣)", "name": "繁體中文(台灣)" -} +} \ No newline at end of file diff --git a/locales/native/ar-iq.json b/locales/native/ar-iq.json index 6ee121dc1..2470db9ae 100644 --- a/locales/native/ar-iq.json +++ b/locales/native/ar-iq.json @@ -50,4 +50,4 @@ "menu.zoom": "تكبير", "menu.zoomIn": "تكبير", "menu.zoomOut": "تصغير" -} +} \ No newline at end of file diff --git a/locales/native/ar-kw.json b/locales/native/ar-kw.json index 6ee121dc1..2470db9ae 100644 --- a/locales/native/ar-kw.json +++ b/locales/native/ar-kw.json @@ -50,4 +50,4 @@ "menu.zoom": "تكبير", "menu.zoomIn": "تكبير", "menu.zoomOut": "تصغير" -} +} \ No newline at end of file diff --git a/locales/native/ar-tn.json b/locales/native/ar-tn.json index 6ee121dc1..2470db9ae 100644 --- a/locales/native/ar-tn.json +++ b/locales/native/ar-tn.json @@ -50,4 +50,4 @@ "menu.zoom": "تكبير", "menu.zoomIn": "تكبير", "menu.zoomOut": "تصغير" -} +} \ No newline at end of file diff --git a/locales/native/en.json b/locales/native/en.json index 683ae2ba4..3d09f3ec7 100644 --- a/locales/native/en.json +++ b/locales/native/en.json @@ -65,4 +65,4 @@ "menu.zoom": "Zoom", "menu.zoomIn": "Zoom In", "menu.zoomOut": "Zoom Out" -} +} \ No newline at end of file diff --git a/locales/native/it.json b/locales/native/it.json index 9c69796f0..ffc851948 100644 --- a/locales/native/it.json +++ b/locales/native/it.json @@ -50,4 +50,4 @@ "menu.zoom": "Zoom", "menu.zoomIn": "Ingrandisci", "menu.zoomOut": "Riduci" -} +} \ No newline at end of file diff --git a/locales/native/ja.json b/locales/native/ja.json index a5af12ddc..043e8d7db 100644 --- a/locales/native/ja.json +++ b/locales/native/ja.json @@ -49,4 +49,4 @@ "menu.zoom": "ズーム", "menu.zoomIn": "拡大", "menu.zoomOut": "縮小" -} +} \ No newline at end of file diff --git a/locales/native/zh-CN.json b/locales/native/zh-CN.json index 3c3bc1fc6..4d2a04fc1 100644 --- a/locales/native/zh-CN.json +++ b/locales/native/zh-CN.json @@ -61,4 +61,4 @@ "menu.zoom": "缩放", "menu.zoomIn": "放大", "menu.zoomOut": "缩小" -} +} \ No newline at end of file diff --git a/locales/native/zh-HK.json b/locales/native/zh-HK.json index 6c4d18c7f..03b1451a5 100644 --- a/locales/native/zh-HK.json +++ b/locales/native/zh-HK.json @@ -50,4 +50,4 @@ "menu.zoom": "縮放", "menu.zoomIn": "放大", "menu.zoomOut": "縮小" -} +} \ No newline at end of file diff --git a/locales/native/zh-TW.json b/locales/native/zh-TW.json index 23c737709..e2297435d 100644 --- a/locales/native/zh-TW.json +++ b/locales/native/zh-TW.json @@ -50,4 +50,4 @@ "menu.zoom": "縮放", "menu.zoomIn": "放大", "menu.zoomOut": "縮小" -} +} \ No newline at end of file diff --git a/locales/settings/ar-DZ.json b/locales/settings/ar-DZ.json index f3f216dd8..f7b902927 100644 --- a/locales/settings/ar-DZ.json +++ b/locales/settings/ar-DZ.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "سحب باور", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/ar-IQ.json b/locales/settings/ar-IQ.json index 62a1ce14e..6334c3be3 100644 --- a/locales/settings/ar-IQ.json +++ b/locales/settings/ar-IQ.json @@ -200,4 +200,4 @@ "wallet.withdraw.modalTitle": "سحب باور", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/ar-KW.json b/locales/settings/ar-KW.json index e94a15b8b..924e16493 100644 --- a/locales/settings/ar-KW.json +++ b/locales/settings/ar-KW.json @@ -200,4 +200,4 @@ "wallet.withdraw.modalTitle": "سحب Power", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/ar-MA.json b/locales/settings/ar-MA.json index 3732ecd8d..1788ca008 100644 --- a/locales/settings/ar-MA.json +++ b/locales/settings/ar-MA.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "سحب باور", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "السحب تمت بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/ar-SA.json b/locales/settings/ar-SA.json index 9462b760a..dab44db64 100644 --- a/locales/settings/ar-SA.json +++ b/locales/settings/ar-SA.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "سحب الطاقة", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/ar-TN.json b/locales/settings/ar-TN.json index e10cb0115..74ab60b73 100644 --- a/locales/settings/ar-TN.json +++ b/locales/settings/ar-TN.json @@ -200,4 +200,4 @@ "wallet.withdraw.modalTitle": "سحب الطاقة", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/settings/en.json b/locales/settings/en.json index 5f18fbf98..544658b57 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -234,4 +234,4 @@ "wallet.withdraw.modalTitle": "Withdraw Power", "wallet.withdraw.submitButton": "Submit", "wallet.withdraw.success": "Withdrawal successful!" -} +} \ No newline at end of file diff --git a/locales/settings/es.json b/locales/settings/es.json index 657d7bba6..593b2430d 100644 --- a/locales/settings/es.json +++ b/locales/settings/es.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Retirar Power", "wallet.withdraw.submitButton": "Enviar", "wallet.withdraw.success": "¡Retiro exitoso!" -} +} \ No newline at end of file diff --git a/locales/settings/fi.json b/locales/settings/fi.json index 9c65e2f16..083ba18d8 100644 --- a/locales/settings/fi.json +++ b/locales/settings/fi.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Nosta Poweria", "wallet.withdraw.submitButton": "Lähetä", "wallet.withdraw.success": "Nosto onnistui!" -} +} \ No newline at end of file diff --git a/locales/settings/fr.json b/locales/settings/fr.json index dba17387e..5b42acfb6 100644 --- a/locales/settings/fr.json +++ b/locales/settings/fr.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Retirer Power", "wallet.withdraw.submitButton": "Soumettre", "wallet.withdraw.success": "Retrait réussi !" -} +} \ No newline at end of file diff --git a/locales/settings/it.json b/locales/settings/it.json index e91f5018b..9e830cbfe 100644 --- a/locales/settings/it.json +++ b/locales/settings/it.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Preleva Power", "wallet.withdraw.submitButton": "Invia", "wallet.withdraw.success": "Prelievo riuscito!" -} +} \ No newline at end of file diff --git a/locales/settings/ja.json b/locales/settings/ja.json index 7ce8dcf9c..080dc4ce8 100644 --- a/locales/settings/ja.json +++ b/locales/settings/ja.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Powerを引き出す", "wallet.withdraw.submitButton": "送信", "wallet.withdraw.success": "引き出しが成功しました!" -} +} \ No newline at end of file diff --git a/locales/settings/pt.json b/locales/settings/pt.json index 8f3514d3b..10045cf96 100644 --- a/locales/settings/pt.json +++ b/locales/settings/pt.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Levantar Power", "wallet.withdraw.submitButton": "Submeter", "wallet.withdraw.success": "Levantamento bem-sucedido!" -} +} \ No newline at end of file diff --git a/locales/settings/ru.json b/locales/settings/ru.json index 2f6c66cfb..8582534ca 100644 --- a/locales/settings/ru.json +++ b/locales/settings/ru.json @@ -192,4 +192,4 @@ "wallet.withdraw.modalTitle": "Вывести Power", "wallet.withdraw.submitButton": "Отправить", "wallet.withdraw.success": "Вывод успешен!" -} +} \ No newline at end of file diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 1d83e906f..f6bd3adba 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -206,4 +206,4 @@ "wallet.withdraw.modalTitle": "提现 Power", "wallet.withdraw.submitButton": "提交", "wallet.withdraw.success": "提现成功!" -} +} \ No newline at end of file diff --git a/locales/settings/zh-HK.json b/locales/settings/zh-HK.json index 4fa51af40..1f2535fce 100644 --- a/locales/settings/zh-HK.json +++ b/locales/settings/zh-HK.json @@ -201,4 +201,4 @@ "wallet.withdraw.modalTitle": "提取 Power", "wallet.withdraw.submitButton": "提交", "wallet.withdraw.success": "提取成功!" -} +} \ No newline at end of file diff --git a/locales/settings/zh-TW.json b/locales/settings/zh-TW.json index ae26fb51c..d21335b0b 100644 --- a/locales/settings/zh-TW.json +++ b/locales/settings/zh-TW.json @@ -201,4 +201,4 @@ "wallet.withdraw.modalTitle": "提取 Power", "wallet.withdraw.submitButton": "送出", "wallet.withdraw.success": "提取成功!" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-DZ.json b/locales/shortcuts/ar-DZ.json index 71b6113e5..6ceebb419 100644 --- a/locales/shortcuts/ar-DZ.json +++ b/locales/shortcuts/ar-DZ.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "إظهار/إخفاء الاختصارات", "keys.layout.toggleSidebar": "إظهار/إخفاء الشريط الجانبي للموجز", "sidebar_title": "الاختصارات" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-IQ.json b/locales/shortcuts/ar-IQ.json index 8bbc70ee5..63ebba9b2 100644 --- a/locales/shortcuts/ar-IQ.json +++ b/locales/shortcuts/ar-IQ.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "إظهار/إخفاء الاختصارات", "keys.layout.toggleSidebar": "إظهار/إخفاء الشريط الجانبي للتغذية", "sidebar_title": "الاختصارات" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-KW.json b/locales/shortcuts/ar-KW.json index f239b9ed6..84f18b652 100644 --- a/locales/shortcuts/ar-KW.json +++ b/locales/shortcuts/ar-KW.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "إظهار/إخفاء الاختصارات", "keys.layout.toggleSidebar": "إظهار/إخفاء الشريط الجانبي للتغذية", "sidebar_title": "الاختصارات" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-MA.json b/locales/shortcuts/ar-MA.json index fa2d4e803..1e2e5daf8 100644 --- a/locales/shortcuts/ar-MA.json +++ b/locales/shortcuts/ar-MA.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "إظهار/إخفاء الاختصارات", "keys.layout.toggleSidebar": "إظهار/إخفاء الشريط الجانبي للتغذية", "sidebar_title": "الاختصارات" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-SA.json b/locales/shortcuts/ar-SA.json index 602f5affa..9d2090244 100644 --- a/locales/shortcuts/ar-SA.json +++ b/locales/shortcuts/ar-SA.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "إظهار/إخفاء الاختصارات", "keys.layout.toggleSidebar": "إظهار/إخفاء الشريط الجانبي للتغذية", "sidebar_title": "الاختصارات" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ar-TN.json b/locales/shortcuts/ar-TN.json index e10cb0115..74ab60b73 100644 --- a/locales/shortcuts/ar-TN.json +++ b/locales/shortcuts/ar-TN.json @@ -200,4 +200,4 @@ "wallet.withdraw.modalTitle": "سحب الطاقة", "wallet.withdraw.submitButton": "إرسال", "wallet.withdraw.success": "تم السحب بنجاح!" -} +} \ No newline at end of file diff --git a/locales/shortcuts/en.json b/locales/shortcuts/en.json index 0a03f08e0..9b8b3ab93 100644 --- a/locales/shortcuts/en.json +++ b/locales/shortcuts/en.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Show/Hide Shortcuts", "keys.layout.toggleSidebar": "Show/Hide Feed Sidebar", "sidebar_title": "Shortcuts" -} +} \ No newline at end of file diff --git a/locales/shortcuts/es.json b/locales/shortcuts/es.json index 1f08265ca..80db9995d 100644 --- a/locales/shortcuts/es.json +++ b/locales/shortcuts/es.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Mostrar/Ocultar atajos", "keys.layout.toggleSidebar": "Mostrar/Ocultar barra lateral de feeds", "sidebar_title": "Atajos" -} +} \ No newline at end of file diff --git a/locales/shortcuts/fi.json b/locales/shortcuts/fi.json index 4dc488e61..4ba5e407d 100644 --- a/locales/shortcuts/fi.json +++ b/locales/shortcuts/fi.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Näytä/Piilota pikanäppäimet", "keys.layout.toggleSidebar": "Näytä/Piilota syötteen sivupalkki", "sidebar_title": "Pikanäppäimet" -} +} \ No newline at end of file diff --git a/locales/shortcuts/fr.json b/locales/shortcuts/fr.json index aa30690d9..cc80bcf8f 100644 --- a/locales/shortcuts/fr.json +++ b/locales/shortcuts/fr.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Afficher/Masquer les raccourcis", "keys.layout.toggleSidebar": "Afficher/Masquer la barre latérale des flux", "sidebar_title": "Raccourcis" -} +} \ No newline at end of file diff --git a/locales/shortcuts/it.json b/locales/shortcuts/it.json index e3b5f475d..6a790d0bf 100644 --- a/locales/shortcuts/it.json +++ b/locales/shortcuts/it.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Mostra/Nascondi scorciatoie", "keys.layout.toggleSidebar": "Mostra/Nascondi barra laterale", "sidebar_title": "Scorciatoie" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ja.json b/locales/shortcuts/ja.json index da18f7139..966a1d51c 100644 --- a/locales/shortcuts/ja.json +++ b/locales/shortcuts/ja.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "ショートカットを表示/非表示", "keys.layout.toggleSidebar": "フィードサイドバーの表示/非表示", "sidebar_title": "ショートカット" -} +} \ No newline at end of file diff --git a/locales/shortcuts/pt.json b/locales/shortcuts/pt.json index 85d13c60a..8c64e2d57 100644 --- a/locales/shortcuts/pt.json +++ b/locales/shortcuts/pt.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Mostrar/Ocultar Atalhos", "keys.layout.toggleSidebar": "Mostrar/Ocultar Barra Lateral de Feed", "sidebar_title": "Atalhos" -} +} \ No newline at end of file diff --git a/locales/shortcuts/ru.json b/locales/shortcuts/ru.json index 1b4a57056..c892a7dc9 100644 --- a/locales/shortcuts/ru.json +++ b/locales/shortcuts/ru.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "Показать/скрыть горячие клавиши", "keys.layout.toggleSidebar": "Показать/скрыть боковую панель каналов", "sidebar_title": "Горячие клавиши" -} +} \ No newline at end of file diff --git a/locales/shortcuts/zh-CN.json b/locales/shortcuts/zh-CN.json index ef02abeea..fe2d4545b 100644 --- a/locales/shortcuts/zh-CN.json +++ b/locales/shortcuts/zh-CN.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "显示/隐藏快捷键", "keys.layout.toggleSidebar": "显示/隐藏侧边栏", "sidebar_title": "快捷键" -} +} \ No newline at end of file diff --git a/locales/shortcuts/zh-HK.json b/locales/shortcuts/zh-HK.json index e6b627541..45099f4ac 100644 --- a/locales/shortcuts/zh-HK.json +++ b/locales/shortcuts/zh-HK.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "顯示/隱藏快捷鍵", "keys.layout.toggleSidebar": "顯示/隱藏訂閱側邊欄", "sidebar_title": "快捷鍵" -} +} \ No newline at end of file diff --git a/locales/shortcuts/zh-TW.json b/locales/shortcuts/zh-TW.json index 83e47c814..f5b943df8 100644 --- a/locales/shortcuts/zh-TW.json +++ b/locales/shortcuts/zh-TW.json @@ -21,4 +21,4 @@ "keys.layout.showShortcuts": "顯示/隱藏快捷鍵", "keys.layout.toggleSidebar": "顯示/隱藏摘要側邊欄", "sidebar_title": "快捷鍵" -} +} \ No newline at end of file diff --git a/plugins/eslint-recursive-sort.js b/plugins/eslint-recursive-sort.js new file mode 100644 index 000000000..eba7d4c63 --- /dev/null +++ b/plugins/eslint-recursive-sort.js @@ -0,0 +1,60 @@ +const sortObjectKeys = (obj) => { + if (typeof obj !== "object" || obj === null) { + return obj + } + + if (Array.isArray(obj)) { + return obj.map((element) => sortObjectKeys(element)) + } + + return Object.keys(obj) + .sort() + .reduce((acc, key) => { + acc[key] = sortObjectKeys(obj[key]) + return acc + }, {}) +} +/** + * @type {import("eslint").ESLint.Plugin} + */ +export default { + rules: { + "recursive-sort": { + meta: { + type: "layout", + fixable: "code", + }, + create(context) { + return { + Program(node) { + if (context.getFilename().endsWith(".json")) { + const sourceCode = context.getSourceCode() + const text = sourceCode.getText() + + try { + const json = JSON.parse(text) + const sortedJson = sortObjectKeys(json) + const sortedText = JSON.stringify(sortedJson, null, 2) + + if (text !== sortedText) { + context.report({ + node, + message: "JSON keys are not sorted recursively", + fix(fixer) { + return fixer.replaceText(node, sortedText) + }, + }) + } + } catch (error) { + context.report({ + node, + message: `Invalid JSON: ${error.message}`, + }) + } + } + }, + } + }, + }, + }, +} From 0f49ce4ade035faf994962ea07568bacb44c630d Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 22 Sep 2024 20:01:00 +0800 Subject: [PATCH 11/37] chore(ci): add fix lint and format ci Signed-off-by: Innei --- .../workflows/auto-fix-lint-format-commit.yml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/auto-fix-lint-format-commit.yml diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml new file mode 100644 index 000000000..2bdb01168 --- /dev/null +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -0,0 +1,62 @@ +name: Auto Fix Lint and Format + +on: + pull_request: + types: [opened, synchronize] + +jobs: + auto-fix: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + + - name: Install dependencies + run: pnpm install + + - name: Run linter and fix issues + run: pnpm run lint:fix + + - name: Run formatter + run: pnpm run format + + - name: Check for changes + id: git-check + run: | + git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + + - name: Commit and push changes + if: steps.git-check.outputs.changes == 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "chore: auto-fix linting and formatting issues" + git push + + - name: Add PR comment + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const fs = require('fs'); + const changes = ${{ steps.git-check.outputs.changes == 'true' }}; + const message = changes + ? 'Linting and formatting issues were automatically fixed. Please review the changes.' + : 'No linting or formatting issues were found.'; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + }); From 8852a81d4cfe80a0704bcf52220c39e9ccbe98de Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 22 Sep 2024 20:03:36 +0800 Subject: [PATCH 12/37] fix: ci Signed-off-by: Innei --- .github/workflows/auto-fix-lint-format-commit.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml index 2bdb01168..44ec10034 100644 --- a/.github/workflows/auto-fix-lint-format-commit.yml +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -7,11 +7,14 @@ on: jobs: auto-fix: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.head_ref }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -42,14 +45,13 @@ jobs: git config --local user.name "GitHub Action" git add -A git commit -m "chore: auto-fix linting and formatting issues" - git push + git push origin HEAD:${{ github.head_ref }} - name: Add PR comment uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const fs = require('fs'); const changes = ${{ steps.git-check.outputs.changes == 'true' }}; const message = changes ? 'Linting and formatting issues were automatically fixed. Please review the changes.' From 5ac4b16b854a2f819e34928da2ac012154a5fd8e Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 22 Sep 2024 20:08:07 +0800 Subject: [PATCH 13/37] ci: fix Signed-off-by: Innei --- .github/workflows/auto-fix-lint-format-commit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml index 44ec10034..89d962455 100644 --- a/.github/workflows/auto-fix-lint-format-commit.yml +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -36,15 +36,15 @@ jobs: - name: Check for changes id: git-check run: | - git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + git add -A + git diff --cached --exit-code || echo "changes=true" >> $GITHUB_OUTPUT - name: Commit and push changes if: steps.git-check.outputs.changes == 'true' run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git add -A - git commit -m "chore: auto-fix linting and formatting issues" + git commit -m "chore: auto-fix linting and formatting issues" --no-verify git push origin HEAD:${{ github.head_ref }} - name: Add PR comment From a5a4de00e3612b7799869d133b893817dbcf82f4 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 22 Sep 2024 20:15:57 +0800 Subject: [PATCH 14/37] fix: ci Signed-off-by: Innei --- .github/workflows/auto-fix-lint-format-commit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml index 89d962455..a983889db 100644 --- a/.github/workflows/auto-fix-lint-format-commit.yml +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: write steps: - name: Checkout code uses: actions/checkout@v4 @@ -45,7 +46,8 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git commit -m "chore: auto-fix linting and formatting issues" --no-verify - git push origin HEAD:${{ github.head_ref }} + #git push origin HEAD:${{ github.head_ref }} + git push https://${{ secrets.PAT }}@github.com/${{ github.repository }}.git HEAD:${{ github.head_ref }} - name: Add PR comment uses: actions/github-script@v7 From e2b8ec88624ad1e8e7f6136a624fc284ae3fb77b Mon Sep 17 00:00:00 2001 From: Jerry Wong Date: Sun, 22 Sep 2024 21:05:29 +0800 Subject: [PATCH 15/37] feat: add more words i18n (#516) * feat: some word i18n * feat: add object-cover to feed icon, add zh-HK and zh-TW errors lang * feat: add more words i18n * update * resolve merge conflict * resole * resolve merge conflict * resolve merge conflict * Update apps/renderer/src/modules/claim/hooks.ts Co-authored-by: Innei * Update apps/renderer/src/hooks/biz/useSubscriptionActions.tsx Co-authored-by: Innei * Update apps/renderer/src/modules/discover/import.tsx Co-authored-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei * update Signed-off-by: Innei --------- Signed-off-by: Innei Co-authored-by: Innei Co-authored-by: Innei --- .../workflows/auto-fix-lint-format-commit.yml | 38 ++++++++--------- .github/workflows/build.yml | 8 ---- .../src/hooks/biz/useSubscriptionActions.tsx | 19 +++++++-- apps/renderer/src/modules/claim/hooks.ts | 4 +- apps/renderer/src/modules/discover/import.tsx | 42 ++++++++++--------- .../src/modules/entry-content/index.tsx | 19 +++------ .../renderer/src/modules/feed-column/list.tsx | 2 +- locales/app/ar-DZ.json | 2 +- locales/app/ar-MA.json | 2 +- locales/app/ar-SA.json | 2 +- locales/app/ar-iq.json | 2 +- locales/app/ar-kw.json | 2 +- locales/app/ar-tn.json | 2 +- locales/app/en.json | 10 +++++ locales/app/es.json | 2 +- locales/app/fi.json | 2 +- locales/app/fr.json | 2 +- locales/app/it.json | 2 +- locales/app/ja.json | 2 +- locales/app/pt.json | 2 +- locales/app/ru.json | 2 +- locales/app/zh-CN.json | 12 +++++- locales/app/zh-HK.json | 12 +++++- locales/app/zh-TW.json | 12 +++++- locales/common/ar-DZ.json | 2 +- locales/common/ar-IQ.json | 2 +- locales/common/ar-KW.json | 2 +- locales/common/ar-MA.json | 2 +- locales/common/ar-SA.json | 2 +- locales/common/ar-TN.json | 2 +- locales/common/en.json | 2 +- locales/common/es.json | 2 +- locales/common/fi.json | 2 +- locales/common/fr.json | 2 +- locales/common/it.json | 2 +- locales/common/ja.json | 2 +- locales/common/pt.json | 2 +- locales/common/ru.json | 2 +- locales/common/zh-CN.json | 2 +- locales/common/zh-HK.json | 2 +- locales/common/zh-TW.json | 2 +- locales/errors/en.json | 2 +- locales/errors/fr.json | 2 +- locales/errors/ja.json | 2 +- locales/errors/ru.json | 2 +- locales/errors/zh-CN.json | 2 +- locales/errors/zh-HK.json | 2 +- locales/errors/zh-TW.json | 2 +- locales/external/ar-DZ.json | 2 +- locales/external/ar-MA.json | 2 +- locales/external/ar-SA.json | 2 +- locales/external/ar-iq.json | 2 +- locales/external/ar-kw.json | 2 +- locales/external/ar-tn.json | 2 +- locales/external/en.json | 2 +- locales/external/es.json | 2 +- locales/external/fi.json | 2 +- locales/external/fr.json | 2 +- locales/external/it.json | 2 +- locales/external/ja.json | 2 +- locales/external/pt.json | 2 +- locales/external/ru.json | 2 +- locales/external/zh-CN.json | 2 +- locales/external/zh-HK.json | 2 +- locales/external/zh-TW.json | 2 +- locales/lang/ar-DZ.json | 2 +- locales/lang/ar-IQ.json | 2 +- locales/lang/ar-KW.json | 2 +- locales/lang/ar-MA.json | 2 +- locales/lang/ar-SA.json | 2 +- locales/lang/ar-TN.json | 2 +- locales/lang/en.json | 2 +- locales/lang/es.json | 2 +- locales/lang/fi.json | 2 +- locales/lang/fr.json | 2 +- locales/lang/it.json | 2 +- locales/lang/ja.json | 2 +- locales/lang/pt.json | 2 +- locales/lang/ru.json | 2 +- locales/lang/zh-CN.json | 2 +- locales/lang/zh-HK.json | 2 +- locales/lang/zh-TW.json | 2 +- locales/native/ar-iq.json | 2 +- locales/native/ar-kw.json | 2 +- locales/native/ar-tn.json | 2 +- locales/native/en.json | 2 +- locales/native/it.json | 2 +- locales/native/ja.json | 2 +- locales/native/zh-CN.json | 2 +- locales/native/zh-HK.json | 2 +- locales/native/zh-TW.json | 2 +- locales/settings/ar-DZ.json | 2 +- locales/settings/ar-IQ.json | 2 +- locales/settings/ar-KW.json | 2 +- locales/settings/ar-MA.json | 2 +- locales/settings/ar-SA.json | 2 +- locales/settings/ar-TN.json | 2 +- locales/settings/en.json | 2 +- locales/settings/es.json | 2 +- locales/settings/fi.json | 2 +- locales/settings/fr.json | 2 +- locales/settings/it.json | 2 +- locales/settings/ja.json | 2 +- locales/settings/pt.json | 2 +- locales/settings/ru.json | 2 +- locales/settings/zh-CN.json | 2 +- locales/settings/zh-HK.json | 2 +- locales/settings/zh-TW.json | 2 +- locales/shortcuts/ar-DZ.json | 2 +- locales/shortcuts/ar-IQ.json | 2 +- locales/shortcuts/ar-KW.json | 2 +- locales/shortcuts/ar-MA.json | 2 +- locales/shortcuts/ar-SA.json | 2 +- locales/shortcuts/ar-TN.json | 2 +- locales/shortcuts/en.json | 2 +- locales/shortcuts/es.json | 2 +- locales/shortcuts/fi.json | 2 +- locales/shortcuts/fr.json | 2 +- locales/shortcuts/it.json | 2 +- locales/shortcuts/ja.json | 2 +- locales/shortcuts/pt.json | 2 +- locales/shortcuts/ru.json | 2 +- locales/shortcuts/zh-CN.json | 2 +- locales/shortcuts/zh-HK.json | 2 +- locales/shortcuts/zh-TW.json | 2 +- plugins/eslint-recursive-sort.js | 2 +- 126 files changed, 224 insertions(+), 184 deletions(-) diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml index a983889db..ab6f776cb 100644 --- a/.github/workflows/auto-fix-lint-format-commit.yml +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -1,7 +1,7 @@ name: Auto Fix Lint and Format on: - pull_request: + pull_request_target: types: [opened, synchronize] jobs: @@ -16,14 +16,16 @@ jobs: with: fetch-depth: 0 ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Setup pnpm + uses: pnpm/action-setup@v2 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - - - name: Setup pnpm - uses: pnpm/action-setup@v2 + cache: "pnpm" - name: Install dependencies run: pnpm install @@ -34,30 +36,28 @@ jobs: - name: Run formatter run: pnpm run format - - name: Check for changes - id: git-check - run: | - git add -A - git diff --cached --exit-code || echo "changes=true" >> $GITHUB_OUTPUT - - name: Commit and push changes - if: steps.git-check.outputs.changes == 'true' - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -m "chore: auto-fix linting and formatting issues" --no-verify - #git push origin HEAD:${{ github.head_ref }} - git push https://${{ secrets.PAT }}@github.com/${{ github.repository }}.git HEAD:${{ github.head_ref }} + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "chore: auto-fix linting and formatting issues" + commit_options: "--no-verify" + file_pattern: "." - name: Add PR comment uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const changes = ${{ steps.git-check.outputs.changes == 'true' }}; - const message = changes + const hasChanges = await github.rest.pulls.listFiles({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }).then(response => response.data.length > 0); + + const message = hasChanges ? 'Linting and formatting issues were automatically fixed. Please review the changes.' : 'No linting or formatting issues were found.'; + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c4b801a0..e73176ce8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,14 +51,6 @@ jobs: fetch-depth: 1 lfs: true - - name: Cache pnpm modules - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: ${{ matrix.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ matrix.os }}- - - name: Setup pnpm uses: pnpm/action-setup@v4 diff --git a/apps/renderer/src/hooks/biz/useSubscriptionActions.tsx b/apps/renderer/src/hooks/biz/useSubscriptionActions.tsx index b79212f53..a90fcd610 100644 --- a/apps/renderer/src/hooks/biz/useSubscriptionActions.tsx +++ b/apps/renderer/src/hooks/biz/useSubscriptionActions.tsx @@ -1,5 +1,6 @@ import { useMutation } from "@tanstack/react-query" import { useHotkeys } from "react-hotkeys-hook" +import { Trans, useTranslation } from "react-i18next" import { toast } from "sonner" import { Kbd } from "~/components/ui/kbd/Kbd" @@ -13,8 +14,10 @@ import { feedUnreadActions } from "~/store/unread" import { navigateEntry } from "./useNavigateEntry" import { getRouteParams } from "./useRouteParams" -export const useDeleteSubscription = ({ onSuccess }: { onSuccess?: () => void }) => - useMutation({ +export const useDeleteSubscription = ({ onSuccess }: { onSuccess?: () => void }) => { + const { t } = useTranslation() + + return useMutation({ mutationFn: async (subscription: SubscriptionFlatModel) => subscriptionActions.unfollow(subscription.feedId).then((feed) => { subscriptionQuery.byView(subscription.view).invalidate() @@ -39,12 +42,13 @@ export const useDeleteSubscription = ({ onSuccess }: { onSuccess?: () => void }) toast.dismiss(toastId) } + const toastId = toast(, { duration: 3000, action: { label: ( - Undo + {t("words.undo")} Meta+Z @@ -68,6 +72,7 @@ export const useDeleteSubscription = ({ onSuccess }: { onSuccess?: () => void }) } }, }) +} const UnfollowInfo = ({ title, undo }: { title: string; undo: () => any }) => { useHotkeys("ctrl+z,meta+z", undo, { @@ -76,7 +81,13 @@ const UnfollowInfo = ({ title, undo }: { title: string; undo: () => any }) => { }) return ( <> - Feed {title} has been unfollowed. + {title}, + }} + /> ) } diff --git a/apps/renderer/src/modules/claim/hooks.ts b/apps/renderer/src/modules/claim/hooks.ts index 89bd5b7e2..27b78139c 100644 --- a/apps/renderer/src/modules/claim/hooks.ts +++ b/apps/renderer/src/modules/claim/hooks.ts @@ -1,4 +1,5 @@ import { createElement, useCallback } from "react" +import { useTranslation } from "react-i18next" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { getFeedById } from "~/store/feed" @@ -7,6 +8,7 @@ import { FeedClaimModalContent } from "./feed-claim-modal" export const useFeedClaimModal = ({ feedId }: { feedId?: string }) => { const { present } = useModalStack() + const { t } = useTranslation() return useCallback(() => { if (!feedId) return @@ -16,7 +18,7 @@ export const useFeedClaimModal = ({ feedId }: { feedId?: string }) => { if (!feed) return present({ - title: "Feed Claim", + title: t("feed_claim_modal.title"), content: () => createElement(FeedClaimModalContent, { feedId }), modalClassName: "!h-auto !max-h-screen", }) diff --git a/apps/renderer/src/modules/discover/import.tsx b/apps/renderer/src/modules/discover/import.tsx index 044cc5b7f..157661ac9 100644 --- a/apps/renderer/src/modules/discover/import.tsx +++ b/apps/renderer/src/modules/discover/import.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useMutation } from "@tanstack/react-query" import { Fragment } from "react/jsx-runtime" import { useForm } from "react-hook-form" -import { useTranslation } from "react-i18next" +import { Trans, useTranslation } from "react-i18next" import { z } from "zod" import { Button } from "~/components/ui/button" @@ -35,20 +35,26 @@ const formSchema = z.object({ }), }) -const list = [ +const NumberDisplay = ({ value }) => {value ?? 0} + +const list: { + key: I18nKeys + title: string + className: string +}[] = [ { key: "parsedErrorItems", - title: "Parsed Error Items", + title: , className: "text-red-500", }, { key: "successfulItems", - title: "Successful Items", + title: , className: "text-green-500", }, { key: "conflictItems", - title: "Conflict Items", + title: , className: "text-yellow-500", }, ] @@ -88,6 +94,7 @@ export function DiscoverImport() { function onSubmit(values: z.infer) { mutation.mutate(values.file) } + const { t } = useTranslation() return ( @@ -99,7 +106,7 @@ export function DiscoverImport() { name="file" render={({ field: { value, onChange, ...fieldProps } }) => ( - OPML file + {t("discover.import.opml")}