Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/layer/main/src/@types/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const langs = ["en", "zh-CN", "zh-TW", "ja"] as const
const langs = ["en", "zh-CN", "zh-TW", "ja", "ko"] as const
export const currentSupportedLanguages = [...langs].sort() as string[]
export type MainSupportedLanguages = (typeof langs)[number]

Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/layer/main/src/@types/resources.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import en from "@locales/native/en.json"
import ja from "@locales/native/ja.json"
import ko from "@locales/native/ko.json"
import zhCn from "@locales/native/zh-CN.json"
import zhTw from "@locales/native/zh-TW.json"

Expand All @@ -19,4 +20,7 @@ export const resources = {
ja: {
native: ja,
},
ko: {
native: ko,
},
} satisfies Record<MainSupportedLanguages, Record<(typeof ns)[number], Record<string, string>>>
3 changes: 2 additions & 1 deletion apps/desktop/layer/renderer/src/@types/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DONT EDIT THIS FILE MANUALLY
const langs = ["en", "zh-CN", "zh-TW", "ja"] as const
const langs = ["en", "zh-CN", "zh-TW", "ja", "ko"] as const
export const currentSupportedLanguages = langs as readonly string[]
export type RendererSupportedLanguages = (typeof langs)[number]

Expand All @@ -8,6 +8,7 @@ export const dayjsLocaleImportMap = {
["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")],
["ja"]: ["ja", () => import("dayjs/locale/ja")],
["zh-TW"]: ["zh-tw", () => import("dayjs/locale/zh-tw")],
["ko"]: ["ko", () => import("dayjs/locale/ko")],
}
export const ns = ["common", "lang", "errors", "app", "settings", "shortcuts", "ai"] as const
export const defaultNS = "app" as const
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
// DONT EDIT THIS FILE MANUALLY
import ai_en from "@locales/ai/en.json"
import ai_ja from "@locales/ai/ja.json"
import ai_ko from "@locales/ai/ko.json"
import en from "@locales/app/en.json"
import app_ja from "@locales/app/ja.json"
import app_ko from "@locales/app/ko.json"
import app_zhCN from "@locales/app/zh-CN.json"
import app_zhTW from "@locales/app/zh-TW.json"
import common_en from "@locales/common/en.json"
import common_ja from "@locales/common/ja.json"
import common_ko from "@locales/common/ko.json"
import common_zhCN from "@locales/common/zh-CN.json"
import common_zhTW from "@locales/common/zh-TW.json"
import errors_en from "@locales/errors/en.json"
import errors_ja from "@locales/errors/ja.json"
import errors_ko from "@locales/errors/ko.json"
import errors_zhCN from "@locales/errors/zh-CN.json"
import errors_zhTW from "@locales/errors/zh-TW.json"
import lang_en from "@locales/lang/en.json"
import lang_ja from "@locales/lang/ja.json"
import lang_ko from "@locales/lang/ko.json"
import lang_zhCN from "@locales/lang/zh-CN.json"
import lang_zhTW from "@locales/lang/zh-TW.json"
import settings_en from "@locales/settings/en.json"
import settings_ja from "@locales/settings/ja.json"
import settings_ko from "@locales/settings/ko.json"
import settings_zhCN from "@locales/settings/zh-CN.json"
import settings_zhTW from "@locales/settings/zh-TW.json"
import shortcuts_en from "@locales/shortcuts/en.json"
import shortcuts_ja from "@locales/shortcuts/ja.json"
import shortcuts_ko from "@locales/shortcuts/ko.json"
import shortcuts_zhCN from "@locales/shortcuts/zh-CN.json"
import shortcuts_zhTW from "@locales/shortcuts/zh-TW.json"

Expand Down Expand Up @@ -70,6 +77,15 @@ export const defaultResources = {
errors: errors_zhTW,
ai: ai_en, // Fallback to English until Traditional Chinese translation is available
},
ko: {
app: app_ko,
lang: lang_ko,
common: common_ko,
settings: settings_ko,
shortcuts: shortcuts_ko,
errors: errors_ko,
ai: ai_ko,
},
} satisfies Record<
RendererSupportedLanguages,
Partial<Record<(typeof ns)[number], Record<string, string>>>
Expand Down
16 changes: 16 additions & 0 deletions apps/desktop/layer/renderer/src/@types/default-resource.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
// DONT EDIT THIS FILE MANUALLY
import ai_en from "@locales/ai/en.json"
import ai_ko from "@locales/ai/ko.json"
import en from "@locales/app/en.json"
import ko from "@locales/app/ko.json"
import common_en from "@locales/common/en.json"
import common_ja from "@locales/common/ja.json"
import common_ko from "@locales/common/ko.json"
import common_zhCN from "@locales/common/zh-CN.json"
import common_zhTW from "@locales/common/zh-TW.json"
import errors_en from "@locales/errors/en.json"
import errors_ko from "@locales/errors/ko.json"
import lang_en from "@locales/lang/en.json"
import lang_ja from "@locales/lang/ja.json"
import lang_ko from "@locales/lang/ko.json"
import lang_zhCN from "@locales/lang/zh-CN.json"
import lang_zhTW from "@locales/lang/zh-TW.json"
import settings_en from "@locales/settings/en.json"
import settings_ko from "@locales/settings/ko.json"
import shortcuts_en from "@locales/shortcuts/en.json"
import shortcuts_ko from "@locales/shortcuts/ko.json"

import type { ns, RendererSupportedLanguages } from "./constants"

Expand Down Expand Up @@ -42,6 +49,15 @@ export const defaultResources = {
common: common_ja,
},
"zh-TW": { lang: lang_zhTW, common: common_zhTW },
ko: {
app: ko,
lang: lang_ko,
common: common_ko,
settings: settings_ko,
shortcuts: shortcuts_ko,
errors: errors_ko,
ai: ai_ko,
},
} satisfies Record<
RendererSupportedLanguages,
Partial<Record<(typeof ns)[number], Record<string, string>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const ActionButtonGroup = () => {
const queryClient = useQueryClient()
const actionLength = useActionRules((actions) => actions.length)
const isDirty = useIsActionDataDirty()
const { t } = useTranslation("settings")
const { t } = useTranslation(["settings", "app"])
unstable_usePrompt({
message: t("actions.navigate.prompt"),
when: ({ currentLocation, nextLocation }) =>
Expand Down Expand Up @@ -238,10 +238,10 @@ const ActionButtonGroup = () => {
{/* Left side - Simple status */}
<div className="hidden lg:block">
<h3 className="text-text text-lg font-medium">
{hasActions ? `${actionLength} Rules` : "No Rules"}
{hasActions ? t("action.rules_count", { count: actionLength }) : t("action.no_rules")}
</h3>
<p className="text-text-secondary text-sm">
{hasActions ? "Active automation rules" : "Create your first automation rule"}
{hasActions ? t("action.active_automation_rules") : t("action.create_first_rule")}
</p>
</div>

Expand All @@ -255,26 +255,26 @@ const ActionButtonGroup = () => {
) : (
<i className="i-mgc-file-import-cute-re mr-2 size-4" />
)}
{hasActions ? "Share" : "Import"}
{hasActions ? t("action.share") : t("app:words.import")}
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-56">
<DropdownMenuItem onClick={handleExport} disabled={!hasActions}>
<i className="i-mgc-download-2-cute-re mr-3 size-4" />
Export to File
{t("action.export_to_file")}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleImport}>
<i className="i-mgc-file-upload-cute-re mr-3 size-4" />
Import from File
{t("action.import_from_file")}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={handleCopyToClipboard} disabled={!hasActions}>
<i className="i-mgc-copy-2-cute-re mr-3 size-4" />
Copy to Clipboard
{t("action.copy_to_clipboard")}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleImportFromClipboard}>
<i className="i-mgc-paste-cute-re mr-3 size-4" />
Import from Clipboard
{t("action.import_from_clipboard")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down
35 changes: 25 additions & 10 deletions apps/desktop/layer/renderer/src/modules/auth/LoginModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import { LegalModalContent } from "./LegalModal"
import { ReferralForm } from "./ReferralForm"
import { TokenModalContent } from "./TokenModal"

const languageLayoutConfig = {
ko: { layout: "ko" },
}

interface LoginModalContentProps {
runtime: LoginRuntime
canClose?: boolean
Expand All @@ -35,7 +39,7 @@ export const LoginModalContent = (props: LoginModalContentProps) => {

const { canClose = true, runtime } = props

const { t } = useTranslation()
const { t, i18n } = useTranslation()
const { data: authProviders, isLoading } = useAuthProviders()

const isMobile = useMobile()
Expand Down Expand Up @@ -84,15 +88,26 @@ export const LoginModalContent = (props: LoginModalContentProps) => {
</div>
)}

<div className="-mt-9 mb-4 flex items-center justify-center">
<Logo className="size-16" />
</div>
<div className="mb-6 mt-4 flex items-center justify-center text-center">
<span className="text-3xl">
{isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")}
</span>
<Folo className="ml-2 size-14" />
</div>
{languageLayoutConfig[i18n.language]?.layout === "ko" ? (
<div className="mb-6 mt-4 flex items-center justify-center text-center">
<Folo className="mr-2 size-16" />
<span className="text-3xl">
{isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")}
</span>
</div>
) : (
<>
<div className="-mt-9 mb-4 flex items-center justify-center">
<Logo className="size-16" />
</div>
<div className="mb-6 mt-4 flex items-center justify-center text-center">
<span className="text-3xl">
{isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")}
</span>
<Folo className="ml-2 size-14" />
</div>
</>
)}

{isEmail ? (
isRegister ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interface DiscoverFeedCardProps {

export const DiscoverFeedCard: FC<DiscoverFeedCardProps> = memo(
({ item, onSuccess, className }) => {
const { t } = useTranslation("common")
const { t } = useTranslation(["app", "common"])

const isSubscribed = useIsSubscribed(item.feed?.id || item.list?.id || "")

Expand All @@ -114,7 +114,7 @@ export const DiscoverFeedCard: FC<DiscoverFeedCardProps> = memo(
{item.docs ? (
<a href={item.docs} target="_blank" rel="noreferrer">
<Button buttonClassName="rounded-full bg-zinc-900 px-6 text-white transition-opacity hover:opacity-90 dark:bg-white dark:text-zinc-900">
View Docs
{t("discover.view_docs")}
</Button>
</a>
) : (
Expand All @@ -138,21 +138,21 @@ export const DiscoverFeedCard: FC<DiscoverFeedCardProps> = memo(

<span>
{formatNumber(item.analytics.subscriptionCount)}{" "}
{t("feed.follower", { count: item.analytics.subscriptionCount })}
{t("common:feed.follower", { count: item.analytics.subscriptionCount })}
</span>
</div>
)}
{item.analytics?.updatesPerWeek ? (
<div className="flex items-center gap-1.5">
<i className="i-mgc-safety-certificate-cute-re" />
<span>
{t("feed.entry_week", { count: item.analytics.updatesPerWeek ?? 0 })}
{t("common:feed.entry_week", { count: item.analytics.updatesPerWeek ?? 0 })}
</span>
</div>
) : item.analytics?.latestEntryPublishedAt ? (
<div className="flex items-center gap-1.5">
<i className="i-mgc-safe-alert-cute-re" />
<span>{t("feed.updated_at")}</span>
<span>{t("common:feed.updated_at")}</span>
<RelativeTime
date={item.analytics.latestEntryPublishedAt}
displayAbsoluteTimeAfterDay={Infinity}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const DiscoverFeedForm = ({
}}
placeholder={
(parameters?.default ?? formPlaceholder[keyItem.name])
? `e.g. ${formPlaceholder[keyItem.name]}`
? `${t("discover.example_prefix")} ${formPlaceholder[keyItem.name]}`
: void 0
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const info: Record<
prefix?: string[]
showModal?: boolean
default?: string
labelSuffix?: React.ReactNode
labelSuffix?: (t: any) => React.ReactNode
}
> = {
search: {
Expand All @@ -53,15 +53,15 @@ const info: Record<
default: "https://",
prefix: ["https://", "http://"],
showModal: true,
labelSuffix: (
labelSuffix: (t) => (
<a
href={`${repository.url}/wiki/Folo-Flavored-Feed-Spec`}
target="_blank"
rel="noreferrer"
className="text-accent border-accent inline-flex w-auto items-center gap-1 rounded-full border px-2 py-px text-sm font-normal"
>
<i className="i-mgc-book-6-cute-re" />
<span>Folo Flavored Feed Spec</span>
<span>{t("discover.folo_flavored_feed_spec")}</span>
</a>
),
},
Expand All @@ -70,15 +70,15 @@ const info: Record<
prefix: ["rsshub://"],
default: "rsshub://",
showModal: true,
labelSuffix: (
labelSuffix: (t) => (
<a
href="https://docs.rsshub.app/"
target="_blank"
rel="noreferrer"
className="text-accent border-accent inline-flex w-auto items-center gap-1 rounded-full border px-2 py-px text-sm font-normal"
>
<i className="i-mgc-book-6-cute-re" />
<span>RSSHub Docs</span>
<span>{t("discover.rsshub_docs")}</span>
</a>
),
},
Expand Down Expand Up @@ -262,14 +262,14 @@ export function DiscoverForm({ type = "search" }: { type?: string }) {
<FormItem className="mb-4">
<FormLabel className="text-text text-headline mb-2 flex items-center gap-2 pl-2 font-bold">
{t(info[type]?.label!)}
{info[type]?.labelSuffix}
{info[type]?.labelSuffix?.(t)}
</FormLabel>
<FormControl>
<Input
autoFocus
{...field}
onChange={handleKeywordChange}
placeholder={type === "search" ? "Enter URL or keyword..." : undefined}
placeholder={type === "search" ? t("discover.search_placeholder") : undefined}
/>
</FormControl>
<FormMessage />
Expand Down
Loading
Loading