diff --git a/locales/external/en.json b/locales/external/en.json index 64b46f3515..7aca60ec8d 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -1,4 +1,38 @@ { + "feed": { + "follow_one": "follow", + "follow_other": "follows", + "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} with {{readCount}} {{readNoun}} on {{appName}}", + "read_one": "read", + "read_other": "reads" + }, + "header": { + "app": "App", + "download": "Download" + }, + "invitation": { + "activate": "Activate", + "codeOptions": { + "1": "Looking for any alpha test user to invite you.", + "2": "Join our Discord server for occasional giveaways.", + "3": "Follow our X account for occasional giveaways." + }, + "earlyAccess": "Follow is currently in early access and requires an invitation code to use.", + "earlyAccessMessage": "😰 Sorry, Follow is currently in early access and requires an invitation code to use.", + "generateButton": "Generate new code", + "generateCost": "You can spend {{INVITATION_PRICE}} Power to generate an invitation code for your friends.", + "getCodeMessage": "You can get an invitation code in the following ways:", + "title": "Invitation Code" + }, + "login": { + "backToWebApp": "Back To Web App", + "continueWithGitHub": "Continue with GitHub", + "continueWithGoogle": "Continue with Google", + "logInTo": "Log in to ", + "openApp": "Open App", + "redirecting": "Redirecting", + "welcomeTo": "Welcome to " + }, "redirect": { "continueInBrowser": "Continue in Browser", "instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", diff --git a/src/renderer/src/components/header.tsx b/src/renderer/src/components/header.tsx index 785f2f07d8..2cf4f55f98 100644 --- a/src/renderer/src/components/header.tsx +++ b/src/renderer/src/components/header.tsx @@ -5,6 +5,7 @@ import type { MotionValue } from "framer-motion" import { useMotionValueEvent, useScroll } from "framer-motion" import type { FC } from "react" import { cloneElement, useState } from "react" +import { useTranslation } from "react-i18next" import { Link } from "react-router-dom" import { FollowIcon } from "./icons/follow" @@ -19,6 +20,7 @@ const useMotionValueToState = (value: MotionValue) => { export function Header() { const present = usePresentUserProfileModal() + const { t } = useTranslation("external") const { scrollY } = useScroll() const scrollYState = useMotionValueToState(scrollY) @@ -40,12 +42,12 @@ export function Header() {
- } label="App" /> + } label={t("header.app")} /> } - label="Download" + label={t("header.download")} />
diff --git a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx index 803d529c56..9bfaa56ea6 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx @@ -6,7 +6,7 @@ import { LoadingCircle } from "@renderer/components/ui/loading" import { views } from "@renderer/constants" import { useTitle } from "@renderer/hooks/common" import { FeedViewType } from "@renderer/lib/enum" -import { cn, pluralize } from "@renderer/lib/utils" +import { cn } from "@renderer/lib/utils" import { ArticleItem } from "@renderer/modules/entry-column/Items/article-item" import { NotificationItem } from "@renderer/modules/entry-column/Items/notification-item" import { PictureItem } from "@renderer/modules/entry-column/Items/picture-item" @@ -17,6 +17,7 @@ import { useEntriesPreview } from "@renderer/queries/entries" import { useFeed } from "@renderer/queries/feed" import { DEEPLINK_SCHEME } from "@shared/constants" import type { FC } from "react" +import { useTranslation } from "react-i18next" import { useParams, useSearchParams } from "react-router-dom" export function Component() { @@ -57,6 +58,7 @@ export function Component() { Item = ArticleItem } } + const { t } = useTranslation("external") useTitle(feed.data?.feed.title) return ( <> @@ -78,10 +80,13 @@ export function Component() {
{feed.data.feed.description}
- {feed.data.subscriptionCount}{" "} - {pluralize("follow", feed.data.subscriptionCount)} with{" "} - {feed.data.readCount} {pluralize("read", feed.data.readCount)} on{" "} - {APP_NAME} + {t("feed.followsAndReads", { + subscriptionCount: feed.data.subscriptionCount, + subscriptionNoun: t("feed.follow", { count: feed.data.subscriptionCount }), + readCount: feed.data.readCount, + readNoun: t("feed.read", { count: feed.data.readCount }), + appName: APP_NAME, + })}
@@ -92,7 +95,7 @@ function Login() { loginHandler("github") }} > - Continue with GitHub + {t("login.continueWithGitHub")} )}