Skip to content

Commit

Permalink
chore: localize boost
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Oct 23, 2024
1 parent 15eba6d commit 4159391
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion apps/renderer/src/hooks/biz/useFeedActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const useFeedActions = ({
: []),
{
type: "text" as const,
label: "Boost",
label: t("words.boost"),
click: () => {
openBoostModal(feedId)
},
Expand Down Expand Up @@ -232,9 +232,11 @@ export const useFeedActions = ({
feed,
t,
isEntryList,
isInbox,
listByView,
feedId,
claimFeed,
openBoostModal,
addFeedToListMutation,
removeFeedFromListMutation,
present,
Expand Down
7 changes: 4 additions & 3 deletions apps/renderer/src/modules/boost/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useCallback } from "react"

import { useAsyncModal } from "~/components/ui/modal/helper/use-async-modal"
import { useAuthQuery } from "~/hooks/common"
import { useAuthQuery, useI18n } from "~/hooks/common"
import { boosts } from "~/queries/boosts"

import { BoostModalContent } from "./modal"

export const useBoostModal = () => {
const t = useI18n()
const present = useAsyncModal()

return useCallback(
Expand All @@ -17,12 +18,12 @@ export const useBoostModal = () => {

present<ResponseType>({
id: "boost",
title: "Boost",
title: t("words.boost"),
content: () => <BoostModalContent feedId={feedId} />,
overlay: true,
useDataFetcher,
})
},
[present],
[present, t],
)
}
2 changes: 1 addition & 1 deletion apps/renderer/src/modules/boost/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => {
onClick={handleBoost}
>
<i className="i-mgc-rocket-cute-fi mr-2 shrink-0" />
Boost
{t("words.boost")}
</Button>
)}

Expand Down
2 changes: 2 additions & 0 deletions locales/app/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"app.copy_logo_svg": "Copy Logo SVG",
"app.toggle_sidebar": "Toggle Sidebar",
"beta_access": "Beta Access",
"boost.boost_feed": "Boost Feed",
"discover.any_url_or_keyword": "Any URL or Keyword",
"discover.default_option": " (default)",
"discover.feed_description": "The description of this feed is as follows, and you can fill out the parameter form with the relevant information.",
Expand Down Expand Up @@ -326,6 +327,7 @@
"user_profile.toggle_item_style": "Toggle Item Style",
"words.achievement": "Achievements",
"words.add": "Add",
"words.boost": "Boost",
"words.browser": "Browser",
"words.confirm": "Confirm",
"words.discover": "Discover",
Expand Down
1 change: 1 addition & 0 deletions locales/app/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
"user_profile.toggle_item_style": "切换列表样式",
"words.achievement": "成就",
"words.add": "添加",
"words.boost": "助力",
"words.browser": "浏览器",
"words.confirm": "确认",
"words.discover": "发现",
Expand Down
1 change: 1 addition & 0 deletions locales/errors/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"4003": "Feed insufficient withdrawable balance",
"4004": "Target user wallet error",
"4005": "Daily power calculation in progress",
"4006": "Invalid boost amount",
"5000": "Invitation limit exceeded. Please try again in a few days.",
"5001": "Invitation already exists.",
"5002": "Invitation code already used.",
Expand Down

0 comments on commit 4159391

Please sign in to comment.