feat(mobile): translation for settings (#3391)
* feat(mobile): translation for settings * general * appearance * data control * account * invitation * about * privacy * list * actions * update action * update list and common words * settings
This commit is contained in:
@@ -18,9 +18,9 @@ export const FixedModalCloseButton: Component<{
|
||||
onClick={onClick}
|
||||
>
|
||||
<i className="i-mgc-close-cute-re text-lg" />
|
||||
<span className="sr-only">{t("close")}</span>
|
||||
<span className="sr-only">{t("words.close")}</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t("close")}</TooltipContent>
|
||||
<TooltipContent>{t("words.close")}</TooltipContent>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export function AsyncModalContent<T>({
|
||||
<i className="i-mgc-close-cute-re" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t("close")}</TooltipContent>
|
||||
<TooltipContent>{t("words.close")}</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</m.div>
|
||||
|
||||
@@ -9,7 +9,7 @@ export const ModalClose = () => {
|
||||
|
||||
return (
|
||||
<MotionButtonBase
|
||||
aria-label={t("close")}
|
||||
aria-label={t("words.close")}
|
||||
className="hover:bg-theme-button-hover absolute right-6 top-6 flex size-8 items-center justify-center rounded-md duration-200"
|
||||
onClick={dismiss}
|
||||
>
|
||||
|
||||
@@ -186,7 +186,7 @@ export const useDialog = (): DialogInstance => {
|
||||
dismiss()
|
||||
}}
|
||||
>
|
||||
{options.cancelText ?? t("cancel", { ns: "common" })}
|
||||
{options.cancelText ?? t("words.cancel", { ns: "common" })}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
@@ -195,7 +195,7 @@ export const useDialog = (): DialogInstance => {
|
||||
dismiss()
|
||||
}}
|
||||
>
|
||||
{options.confirmText ?? t("confirm", { ns: "common" })}
|
||||
{options.confirmText ?? t("words.confirm", { ns: "common" })}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => {
|
||||
{t("boost.boost_success_thanks")}
|
||||
</m.p>
|
||||
<Button variant="primary" onClick={() => dismiss()}>
|
||||
{t.common("close")}
|
||||
{t.common("words.close")}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -377,7 +377,7 @@ const FeedInnerForm = ({
|
||||
dismiss()
|
||||
}}
|
||||
>
|
||||
{t.common("cancel")}
|
||||
{t.common("words.cancel")}
|
||||
</Button>
|
||||
)}
|
||||
<Button ref={buttonRef} type="submit" isLoading={followMutation.isPending}>
|
||||
|
||||
@@ -333,7 +333,7 @@ const ListInnerForm = ({
|
||||
dismiss()
|
||||
}}
|
||||
>
|
||||
{t.common("cancel")}
|
||||
{t.common("words.cancel")}
|
||||
</Button>
|
||||
)}
|
||||
<Button ref={buttonRef} type="submit" isLoading={followMutation.isPending}>
|
||||
|
||||
@@ -81,7 +81,7 @@ const TrendContent: FC<TrendingProps> = ({ language }) => {
|
||||
<ActionButton
|
||||
className="absolute right-4 top-4"
|
||||
onClick={dismiss}
|
||||
tooltip={t("close", { ns: "common" })}
|
||||
tooltip={t("words.close", { ns: "common" })}
|
||||
>
|
||||
<i className="i-mgc-close-cute-re" />
|
||||
</ActionButton>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { FeedViewType } from "@follow/constants"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Pressable, Text, View } from "react-native"
|
||||
|
||||
import { Grid } from "@/src/components/ui/grid"
|
||||
@@ -14,6 +15,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export const FeedViewSelector = ({ value, onChange, className, readOnly }: Props) => {
|
||||
const { t } = useTranslation("common")
|
||||
const secondaryLabelColor = useColor("secondaryLabel")
|
||||
return (
|
||||
<Grid columns={views.length} gap={5} className={className}>
|
||||
@@ -38,7 +40,7 @@ export const FeedViewSelector = ({ value, onChange, className, readOnly }: Props
|
||||
color: isSelected ? view.activeColor : secondaryLabelColor,
|
||||
}}
|
||||
>
|
||||
{view.name}
|
||||
{t(view.name)}
|
||||
</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ParseKeys } from "i18next"
|
||||
|
||||
import type { SupportedLanguages } from "@/src/lib/language"
|
||||
import type { Navigation } from "@/src/lib/navigation/Navigation"
|
||||
import { actionActions } from "@/src/store/action/store"
|
||||
@@ -6,84 +8,92 @@ import type { ActionId, ActionRule } from "@/src/store/action/types"
|
||||
import { EditRewriteRulesScreen } from "../routes/EditRewriteRules"
|
||||
import { EditWebhooksScreen } from "../routes/EditWebhooks"
|
||||
|
||||
export const filterFieldOptions = [
|
||||
export const filterFieldOptions: Array<{
|
||||
label: Extract<ParseKeys<"settings">, `actions.action_card.feed_options.${string}`>
|
||||
value: string
|
||||
type?: "text" | "number" | "view"
|
||||
}> = [
|
||||
{
|
||||
label: "Subscription View",
|
||||
label: "actions.action_card.feed_options.subscription_view",
|
||||
value: "view",
|
||||
type: "view",
|
||||
},
|
||||
{
|
||||
label: "Feed Title",
|
||||
label: "actions.action_card.feed_options.feed_title",
|
||||
value: "title",
|
||||
},
|
||||
{
|
||||
label: "Feed Category",
|
||||
label: "actions.action_card.feed_options.feed_category",
|
||||
value: "category",
|
||||
},
|
||||
{
|
||||
label: "Site URL",
|
||||
label: "actions.action_card.feed_options.site_url",
|
||||
value: "site_url",
|
||||
},
|
||||
{
|
||||
label: "Feed URL",
|
||||
label: "actions.action_card.feed_options.feed_url",
|
||||
value: "feed_url",
|
||||
},
|
||||
{
|
||||
label: "Entry Title",
|
||||
label: "actions.action_card.feed_options.entry_title",
|
||||
value: "entry_title",
|
||||
},
|
||||
{
|
||||
label: "Entry Content",
|
||||
label: "actions.action_card.feed_options.entry_content",
|
||||
value: "entry_content",
|
||||
},
|
||||
{
|
||||
label: "Entry URL",
|
||||
label: "actions.action_card.feed_options.entry_url",
|
||||
value: "entry_url",
|
||||
},
|
||||
{
|
||||
label: "Entry Author",
|
||||
label: "actions.action_card.feed_options.entry_author",
|
||||
value: "entry_author",
|
||||
},
|
||||
{
|
||||
label: "Entry Media Length",
|
||||
label: "actions.action_card.feed_options.entry_media_length",
|
||||
value: "entry_media_length",
|
||||
type: "number",
|
||||
},
|
||||
]
|
||||
|
||||
export const filterOperatorOptions = [
|
||||
export const filterOperatorOptions: Array<{
|
||||
label: Extract<ParseKeys<"settings">, `actions.action_card.operation_options.${string}`>
|
||||
value: string
|
||||
types: Array<"text" | "number" | "view">
|
||||
}> = [
|
||||
{
|
||||
label: "contains",
|
||||
label: "actions.action_card.operation_options.contains",
|
||||
value: "contains",
|
||||
types: ["text"],
|
||||
},
|
||||
{
|
||||
label: "does not contain",
|
||||
label: "actions.action_card.operation_options.does_not_contain",
|
||||
value: "not_contains",
|
||||
types: ["text"],
|
||||
},
|
||||
{
|
||||
label: "is equal to",
|
||||
label: "actions.action_card.operation_options.is_equal_to",
|
||||
value: "eq",
|
||||
types: ["number", "text", "view"],
|
||||
},
|
||||
{
|
||||
label: "is not equal to",
|
||||
label: "actions.action_card.operation_options.is_not_equal_to",
|
||||
value: "not_eq",
|
||||
types: ["number", "text", "view"],
|
||||
},
|
||||
{
|
||||
label: "is greater than",
|
||||
label: "actions.action_card.operation_options.is_greater_than",
|
||||
value: "gt",
|
||||
types: ["number"],
|
||||
},
|
||||
{
|
||||
label: "is less than",
|
||||
label: "actions.action_card.operation_options.is_less_than",
|
||||
value: "lt",
|
||||
types: ["number"],
|
||||
},
|
||||
{
|
||||
label: "matches regex",
|
||||
label: "actions.action_card.operation_options.matches_regex",
|
||||
value: "regex",
|
||||
types: ["text"],
|
||||
},
|
||||
@@ -91,42 +101,42 @@ export const filterOperatorOptions = [
|
||||
|
||||
export const availableActionList: Array<{
|
||||
value: ActionId
|
||||
label: string
|
||||
label: Extract<ParseKeys<"settings">, `actions.action_card.${string}`>
|
||||
onEnable?: (index: number) => void
|
||||
onNavigate?: (router: Navigation, index: number) => void
|
||||
component?: React.FC<{ rule: ActionRule }>
|
||||
}> = [
|
||||
{
|
||||
value: "summary",
|
||||
label: "Generate summary using AI",
|
||||
label: "actions.action_card.generate_summary",
|
||||
},
|
||||
{
|
||||
value: "translation",
|
||||
label: "Translate",
|
||||
label: "actions.action_card.translate_into",
|
||||
},
|
||||
{
|
||||
value: "readability",
|
||||
label: "Enable readability",
|
||||
label: "actions.action_card.enable_readability",
|
||||
},
|
||||
{
|
||||
value: "sourceContent",
|
||||
label: "View source content",
|
||||
label: "actions.action_card.source_content",
|
||||
},
|
||||
{
|
||||
value: "newEntryNotification",
|
||||
label: "Notification of new entry",
|
||||
label: "actions.action_card.new_entry_notification",
|
||||
},
|
||||
{
|
||||
value: "silence",
|
||||
label: "Silence",
|
||||
label: "actions.action_card.silence",
|
||||
},
|
||||
{
|
||||
value: "block",
|
||||
label: "Block",
|
||||
label: "actions.action_card.block",
|
||||
},
|
||||
{
|
||||
value: "rewriteRules",
|
||||
label: "Rewrite Rules",
|
||||
label: "actions.action_card.rewrite_rules",
|
||||
onEnable: (index: number) => {
|
||||
actionActions.patchRule(index, {
|
||||
result: {
|
||||
@@ -145,7 +155,7 @@ export const availableActionList: Array<{
|
||||
},
|
||||
{
|
||||
value: "webhooks",
|
||||
label: "Webhooks",
|
||||
label: "actions.action_card.webhooks",
|
||||
onEnable: (index) => {
|
||||
actionActions.patchRule(index, { result: { webhooks: [""] } })
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { nativeApplicationVersion, nativeBuildVersion } from "expo-application"
|
||||
import { Trans, useTranslation } from "react-i18next"
|
||||
import { Linking, Text, View } from "react-native"
|
||||
|
||||
import { Link } from "@/src/components/common/Link"
|
||||
@@ -43,12 +44,13 @@ const links = [
|
||||
]
|
||||
|
||||
export const AboutScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const buildId = nativeBuildVersion
|
||||
const appVersion = nativeApplicationVersion
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background" contentViewClassName="pt-6">
|
||||
<NavigationBlurEffectHeader title="About" />
|
||||
<NavigationBlurEffectHeader title={t("titles.about")} />
|
||||
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListBaseCell className="flex-col py-6">
|
||||
@@ -60,30 +62,57 @@ export const AboutScreen = () => {
|
||||
</Text>
|
||||
</View>
|
||||
<View className="mt-6 flex-1">
|
||||
<Text className="text-label text-[15px]">
|
||||
Folo is in the early stages of development. If you have any feedback or suggestions,
|
||||
please feel free to open an issue on the{" "}
|
||||
<Link className="text-accent" href="https://github.com/RSSNext/follow">
|
||||
GitHub repository
|
||||
</Link>
|
||||
</Text>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="about.feedbackInfo"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label text-[15px]">{children}</Text>
|
||||
)}
|
||||
values={{
|
||||
appName: "Folo",
|
||||
// TODO: add commitSha
|
||||
commitSha: "",
|
||||
}}
|
||||
components={{
|
||||
OpenIssueLink: (
|
||||
<Link className="text-accent" href="https://github.com/RSSNext/follow" />
|
||||
),
|
||||
ExternalLinkIcon: <View />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Text className="text-label mt-4 text-[15px]">
|
||||
The icon library used is copyrighted by{" "}
|
||||
<Link className="text-accent" href="https://mgc.mingcute.com/">
|
||||
https://mgc.mingcute.com/
|
||||
</Link>{" "}
|
||||
and cannot be redistributed.
|
||||
</Text>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="about.iconLibrary"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label mt-4 text-[15px]">{children}</Text>
|
||||
)}
|
||||
components={{
|
||||
IconLibraryLink: (
|
||||
<Link className="text-accent" href="https://mgc.mingcute.com/">
|
||||
https://mgc.mingcute.com/
|
||||
</Link>
|
||||
),
|
||||
ExternalLinkIcon: <View />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Text className="text-label mt-4 text-[15px]">
|
||||
Copyright © 2025 Folo. All rights reserved.
|
||||
</Text>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="about.licenseInfo"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label mt-4 text-[15px]">{children}</Text>
|
||||
)}
|
||||
values={{
|
||||
currentYear: new Date().getFullYear(),
|
||||
appName: "Folo",
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</GroupedInsetListBaseCell>
|
||||
</GroupedInsetListCard>
|
||||
|
||||
<GroupedInsetListSectionHeader label="Social Links" />
|
||||
<GroupedInsetListSectionHeader label={t("about.socialMedia")} />
|
||||
<GroupedInsetListCard>
|
||||
{links.map((link) => (
|
||||
<GroupedInsetListNavigationLink
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
||||
import * as FileSystem from "expo-file-system"
|
||||
import type { FC } from "react"
|
||||
import { useMemo } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { ActivityIndicator, Alert, Text, View } from "react-native"
|
||||
|
||||
import {
|
||||
@@ -66,9 +67,10 @@ const useAccount = () => {
|
||||
})
|
||||
}
|
||||
export const AccountScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Account" />
|
||||
<NavigationBlurEffectHeader title={t("titles.account")} />
|
||||
|
||||
<AuthenticationSection />
|
||||
|
||||
@@ -76,10 +78,10 @@ export const AccountScreen = () => {
|
||||
|
||||
{/* Danger Zone */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Danger Zone" />
|
||||
<GroupedInsetListSectionHeader label={t("profile.danger_zone")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedPlainButtonCell
|
||||
label="Delete account"
|
||||
label={t("profile.delete_account.label")}
|
||||
textClassName="text-red text-left"
|
||||
onPress={async () => {
|
||||
Alert.alert("Delete account", "Are you sure you want to delete your account?", [
|
||||
@@ -191,6 +193,7 @@ const AccountLinker: FC<{
|
||||
;(AccountLinker as any).itemStyle = GroupedInsetListCardItemStyle.NavigationLink
|
||||
|
||||
const AuthenticationSection = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { data: accounts } = useAccount()
|
||||
|
||||
const { data: providers, isLoading } = useQuery({
|
||||
@@ -210,7 +213,7 @@ const AuthenticationSection = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<GroupedInsetListSectionHeader label="Authentication" />
|
||||
<GroupedInsetListSectionHeader label={t("profile.link_social.authentication")} />
|
||||
<GroupedInsetListCard>
|
||||
{providers ? (
|
||||
Object.keys(providers).map((provider) => (
|
||||
@@ -231,6 +234,7 @@ const AuthenticationSection = () => {
|
||||
}
|
||||
|
||||
const SecuritySection = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { data: account } = useAccount()
|
||||
const hasPassword = account?.data?.find((account) => account.provider === "credential")
|
||||
const whoAmI = useWhoami()
|
||||
@@ -240,11 +244,11 @@ const SecuritySection = () => {
|
||||
const navigation = useNavigation()
|
||||
return (
|
||||
<>
|
||||
<GroupedInsetListSectionHeader label="Security" />
|
||||
<GroupedInsetListSectionHeader label={t("profile.security")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedPlainButtonCell
|
||||
textClassName="text-left"
|
||||
label="Change password"
|
||||
label={t("profile.change_password.label")}
|
||||
onPress={() => {
|
||||
const email = whoAmI?.email || ""
|
||||
if (!email) {
|
||||
@@ -261,7 +265,9 @@ const SecuritySection = () => {
|
||||
/>
|
||||
<GroupedPlainButtonCell
|
||||
textClassName="text-left"
|
||||
label={twoFactorEnabled ? "Disable 2FA" : "Setting 2FA"}
|
||||
label={
|
||||
twoFactorEnabled ? t("profile.two_factor.disable") : t("profile.two_factor.enable")
|
||||
}
|
||||
onPress={() => {
|
||||
Dialog.show(ConfirmPasswordDialog, {
|
||||
override: {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { withOpacity } from "@follow/utils"
|
||||
import { useCallback } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import type { ListRenderItem } from "react-native"
|
||||
import { ActivityIndicator, Text, View } from "react-native"
|
||||
import Animated, { LinearTransition } from "react-native-reanimated"
|
||||
@@ -34,6 +35,7 @@ import type { ActionRule } from "@/src/store/action/types"
|
||||
import { EditRuleScreen } from "./EditRule"
|
||||
|
||||
export const ActionsScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { isLoading } = usePrefetchActions()
|
||||
const rules = useActionRules()
|
||||
const isDirty = useIsActionDataDirty()
|
||||
@@ -41,7 +43,7 @@ export const ActionsScreen = () => {
|
||||
return (
|
||||
<SafeNavigationScrollView nestedScrollEnabled className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader
|
||||
title="Actions"
|
||||
title={t("titles.actions")}
|
||||
headerRight={useCallback(
|
||||
() => (
|
||||
<SaveRuleButton disabled={!isDirty} />
|
||||
@@ -54,8 +56,8 @@ export const ActionsScreen = () => {
|
||||
<View className="mt-6">
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInformationCell
|
||||
title="Actions"
|
||||
description="Action are collections of rules that you can automate to perform tasks on server or client side."
|
||||
title={t("titles.actions")}
|
||||
description={t("actions.info")}
|
||||
icon={<Magic2CuteFiIcon height={40} width={40} color="#fff" />}
|
||||
iconBackgroundColor="#059669"
|
||||
/>
|
||||
@@ -88,10 +90,11 @@ export const ActionsScreen = () => {
|
||||
}
|
||||
|
||||
const NewRuleButton = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
return (
|
||||
<GroupedInsetListCard className="mt-6">
|
||||
<GroupedPlainButtonCell
|
||||
label="New Rule"
|
||||
label={t("actions.newRule")}
|
||||
onPress={() => {
|
||||
actionActions.addRule()
|
||||
}}
|
||||
@@ -129,6 +132,7 @@ const ListItemCell: ListRenderItem<ActionRule> = (props) => {
|
||||
return <ListItemCellImpl {...props} />
|
||||
}
|
||||
const ListItemCellImpl: ListRenderItem<ActionRule> = ({ item: rule }) => {
|
||||
const { t } = useTranslation("common")
|
||||
const navigation = useNavigation()
|
||||
const colors = useColors()
|
||||
|
||||
@@ -137,14 +141,14 @@ const ListItemCellImpl: ListRenderItem<ActionRule> = ({ item: rule }) => {
|
||||
swipeRightToCallAction
|
||||
rightActions={[
|
||||
{
|
||||
label: "Delete",
|
||||
label: t("words.delete"),
|
||||
onPress: () => {
|
||||
actionActions.deleteRule(rule.index)
|
||||
},
|
||||
backgroundColor: colors.red,
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
label: t("words.edit"),
|
||||
onPress: () => {
|
||||
navigation.pushControllerView(EditRuleScreen, {
|
||||
index: rule.index,
|
||||
@@ -156,7 +160,7 @@ const ListItemCellImpl: ListRenderItem<ActionRule> = ({ item: rule }) => {
|
||||
>
|
||||
<ItemPressable
|
||||
className="flex-row justify-between p-4"
|
||||
onPress={() => navigation.presentControllerView(EditRuleScreen, { index: rule.index })}
|
||||
onPress={() => navigation.pushControllerView(EditRuleScreen, { index: rule.index })}
|
||||
>
|
||||
<Text className="text-label text-base">{rule.name}</Text>
|
||||
<Switch
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { themeNames } from "@shikijs/themes"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { useColorScheme, View } from "react-native"
|
||||
|
||||
import { setUISetting, useUISettingKey } from "@/src/atoms/settings/ui"
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
import { Switch } from "@/src/components/ui/switch/Switch"
|
||||
|
||||
export const AppearanceScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const showUnreadCount = useUISettingKey("subscriptionShowUnreadCount")
|
||||
const hideExtraBadge = useUISettingKey("hideExtraBadge")
|
||||
const thumbnailRatio = useUISettingKey("thumbnailRatio")
|
||||
@@ -28,13 +30,13 @@ export const AppearanceScreen = () => {
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Appearance" />
|
||||
<NavigationBlurEffectHeader title={t("appearance.title")} />
|
||||
|
||||
<GroupedInsetListSectionHeader label="Subscription" />
|
||||
<GroupedInsetListSectionHeader label={t("appearance.subscriptions")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell
|
||||
label="Show unread count"
|
||||
description="Show unread count in the subscription list"
|
||||
label={t("appearance.show_unread_count.label")}
|
||||
description={t("appearance.show_unread_count.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -46,8 +48,8 @@ export const AppearanceScreen = () => {
|
||||
</GroupedInsetListCell>
|
||||
|
||||
<GroupedInsetListCell
|
||||
label="Hide special badge"
|
||||
description="Hide the special badge of the feed in the sidebar, e.g. Boost, Claimed"
|
||||
label={t("appearance.hide_extra_badge.label")}
|
||||
description={t("appearance.hide_extra_badge.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -58,8 +60,8 @@ export const AppearanceScreen = () => {
|
||||
/>
|
||||
</GroupedInsetListCell>
|
||||
<GroupedInsetListCell
|
||||
label="Thumbnail ratio"
|
||||
description="The ratio of the thumbnail in the entry list."
|
||||
label={t("appearance.thumbnail_ratio.title")}
|
||||
description={t("appearance.thumbnail_ratio.description")}
|
||||
>
|
||||
<View className="w-[100px]">
|
||||
<Select
|
||||
@@ -78,7 +80,7 @@ export const AppearanceScreen = () => {
|
||||
|
||||
<GroupedInsetListSectionHeader label="Content" />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell label="Code highlight theme">
|
||||
<GroupedInsetListCell label={t("appearance.code_highlight_theme")}>
|
||||
<Select
|
||||
wrapperClassName="w-[120px]"
|
||||
options={themeNames.map((theme) => ({
|
||||
@@ -93,8 +95,8 @@ export const AppearanceScreen = () => {
|
||||
</GroupedInsetListCell>
|
||||
|
||||
<GroupedInsetListCell
|
||||
label="Render inline style"
|
||||
description="Allows rendering of the inline style of the original HTML."
|
||||
label={t("appearance.reader_render_inline_style.label")}
|
||||
description={t("appearance.reader_render_inline_style.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -106,8 +108,8 @@ export const AppearanceScreen = () => {
|
||||
</GroupedInsetListCell>
|
||||
|
||||
<GroupedInsetListCell
|
||||
label="Hide recent reader"
|
||||
description="Hide the recent reader in the entry header."
|
||||
label={t("appearance.hide_recent_reader.label")}
|
||||
description={t("appearance.hide_recent_reader.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as FileSystem from "expo-file-system"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Alert } from "react-native"
|
||||
|
||||
import { setDataSetting, useDataSettingKey } from "@/src/atoms/settings/data"
|
||||
@@ -19,17 +20,18 @@ import { toast } from "@/src/lib/toast"
|
||||
import { exportLocalDatabase, importOpml } from "../utils"
|
||||
|
||||
export const DataScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const sendAnonymousData = useDataSettingKey("sendAnonymousData")
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Data" />
|
||||
<NavigationBlurEffectHeader title={t("titles.data_control")} />
|
||||
|
||||
<GroupedInsetListSectionHeader label="Privacy" />
|
||||
<GroupedInsetListSectionHeader label={t("general.privacy")} />
|
||||
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell
|
||||
label="Send anonymous data"
|
||||
description="By opting to send anonymized telemetry data, you contribute to improving the overall user experience of Folo."
|
||||
label={t("general.send_anonymous_data.label")}
|
||||
description={t("general.send_anonymous_data.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -43,30 +45,36 @@ export const DataScreen = () => {
|
||||
|
||||
{/* Data Sources */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Data Sources" />
|
||||
<GroupedInsetListSectionHeader label={t("data_control.data_sources")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListActionCell onPress={importOpml} label="Import subscriptions from OPML" />
|
||||
<GroupedInsetListActionCell
|
||||
onPress={importOpml}
|
||||
label={t("data_control.import_opml.label")}
|
||||
/>
|
||||
|
||||
<GroupedInsetListActionCell onPress={exportLocalDatabase} label="Export local database" />
|
||||
<GroupedInsetListActionCell
|
||||
onPress={exportLocalDatabase}
|
||||
label={t("data_control.export_local_database.label")}
|
||||
/>
|
||||
</GroupedInsetListCard>
|
||||
|
||||
{/* Utils */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Utils" />
|
||||
<GroupedInsetListSectionHeader label={t("data_control.utils")} />
|
||||
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListActionCell
|
||||
onPress={() => {
|
||||
Alert.alert(
|
||||
"Rebuild database?",
|
||||
"This will delete all your offline cached data and rebuild the database, and after that the app will reload.",
|
||||
t("general.rebuild_database.title"),
|
||||
t("general.rebuild_database.warning.line1"),
|
||||
[
|
||||
{
|
||||
text: "Cancel",
|
||||
text: t("general.rebuild_database.cancel"),
|
||||
style: "cancel",
|
||||
},
|
||||
{
|
||||
text: "Rebuild",
|
||||
text: t("general.rebuild_database.button"),
|
||||
style: "destructive",
|
||||
onPress: async () => {
|
||||
const dbPath = getDbPath()
|
||||
@@ -77,33 +85,36 @@ export const DataScreen = () => {
|
||||
],
|
||||
)
|
||||
}}
|
||||
label="Rebuild database"
|
||||
description="If you are experiencing rendering issues, rebuilding the database may solve them."
|
||||
label={t("general.rebuild_database.label")}
|
||||
description={t("general.rebuild_database.description")}
|
||||
/>
|
||||
|
||||
<GroupedInsetListActionCell
|
||||
onPress={() => {
|
||||
Alert.alert("Clear cache?", "This will clear all temporary files and cached data.", [
|
||||
{
|
||||
text: "Cancel",
|
||||
style: "cancel",
|
||||
},
|
||||
{
|
||||
text: "Clear",
|
||||
|
||||
isPreferred: true,
|
||||
onPress: async () => {
|
||||
const cacheDir = FileSystem.cacheDirectory
|
||||
if (cacheDir) {
|
||||
await FileSystem.deleteAsync(cacheDir, { idempotent: true })
|
||||
}
|
||||
toast.success("Cache cleared")
|
||||
Alert.alert(
|
||||
t("data_control.clean_cache.button"),
|
||||
t("data_control.clean_cache.description"),
|
||||
[
|
||||
{
|
||||
text: t("data_control.clean_cache.cancel"),
|
||||
style: "cancel",
|
||||
},
|
||||
},
|
||||
])
|
||||
{
|
||||
text: t("data_control.clean_cache.clear"),
|
||||
isPreferred: true,
|
||||
onPress: async () => {
|
||||
const cacheDir = FileSystem.cacheDirectory
|
||||
if (cacheDir) {
|
||||
await FileSystem.deleteAsync(cacheDir, { idempotent: true })
|
||||
}
|
||||
toast.success("Cache cleared")
|
||||
},
|
||||
},
|
||||
],
|
||||
)
|
||||
}}
|
||||
label="Clear cache"
|
||||
description="Clear temporary files and cached data to free up storage space."
|
||||
label={t("data_control.clean_cache.button")}
|
||||
description={t("data_control.clean_cache.description")}
|
||||
/>
|
||||
</GroupedInsetListCard>
|
||||
</SafeNavigationScrollView>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Text, View } from "react-native"
|
||||
|
||||
import {
|
||||
@@ -25,9 +26,10 @@ export const EditConditionScreen: NavigationControllerView<{
|
||||
groupIndex: number
|
||||
conditionIndex: number
|
||||
}> = (params) => {
|
||||
const { t } = useTranslation("settings")
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Edit Condition" />
|
||||
<NavigationBlurEffectHeader title={t("actions.edit_condition")} />
|
||||
|
||||
<ConditionForm index={params} />
|
||||
</SafeNavigationScrollView>
|
||||
@@ -35,6 +37,7 @@ export const EditConditionScreen: NavigationControllerView<{
|
||||
}
|
||||
|
||||
function ConditionForm({ index }: { index: ConditionIndex }) {
|
||||
const { t } = useTranslation("settings")
|
||||
const item = useActionRuleCondition(index)!
|
||||
const currentField = filterFieldOptions.find((field) => field.value === item.field)
|
||||
const currentOperator = filterOperatorOptions.find((field) => field.value === item.operator)
|
||||
@@ -42,15 +45,16 @@ function ConditionForm({ index }: { index: ConditionIndex }) {
|
||||
currentField?.type === "view"
|
||||
? views.find((view) => view.view === Number(item.value))
|
||||
: undefined
|
||||
const { t: tCommon } = useTranslation("common")
|
||||
|
||||
return (
|
||||
<>
|
||||
<GroupedInsetListSectionHeader label="Condition" />
|
||||
<GroupedInsetListSectionHeader label={t("actions.condition")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListBaseCell className="flex flex-row justify-between">
|
||||
<Text className="text-label">Field</Text>
|
||||
<Text className="text-label">{t("actions.action_card.field")}</Text>
|
||||
<Select
|
||||
options={filterFieldOptions}
|
||||
options={filterFieldOptions.map((i) => ({ ...i, label: t(i.label) }))}
|
||||
value={currentField?.value}
|
||||
onValueChange={(value) => {
|
||||
actionActions.pathCondition(index, {
|
||||
@@ -62,11 +66,11 @@ function ConditionForm({ index }: { index: ConditionIndex }) {
|
||||
</GroupedInsetListBaseCell>
|
||||
|
||||
<GroupedInsetListBaseCell className="flex flex-row justify-between">
|
||||
<Text className="text-label">Operator</Text>
|
||||
<Text className="text-label">{t("actions.action_card.operator")}</Text>
|
||||
<Select
|
||||
options={filterOperatorOptions.filter((operator) =>
|
||||
operator.types.includes(currentField?.type ?? "text"),
|
||||
)}
|
||||
options={filterOperatorOptions
|
||||
.map((i) => ({ ...i, label: t(i.label) }))
|
||||
.filter((operator) => operator.types.includes(currentField?.type ?? "text"))}
|
||||
value={currentOperator?.value}
|
||||
onValueChange={(value) => {
|
||||
actionActions.pathCondition(index, {
|
||||
@@ -78,11 +82,11 @@ function ConditionForm({ index }: { index: ConditionIndex }) {
|
||||
</GroupedInsetListBaseCell>
|
||||
|
||||
<GroupedInsetListBaseCell className="flex flex-row justify-between">
|
||||
<Text className="text-label">Value</Text>
|
||||
<Text className="text-label">{t("actions.action_card.value")}</Text>
|
||||
{currentField?.type === "view" ? (
|
||||
<Select
|
||||
options={views.map((field) => ({
|
||||
label: field.name,
|
||||
label: tCommon(field.name),
|
||||
value: String(field.view),
|
||||
}))}
|
||||
value={currentView?.view ? String(currentView.view) : undefined}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Text } from "react-native"
|
||||
|
||||
import {
|
||||
@@ -16,16 +17,20 @@ import { useActionRule } from "@/src/store/action/hooks"
|
||||
import { actionActions } from "@/src/store/action/store"
|
||||
|
||||
export const EditRewriteRulesScreen: NavigationControllerView<{ index: number }> = ({ index }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const rule = useActionRule(index)
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Edit Rewrite Rules" />
|
||||
<GroupedInsetListSectionHeader label="Rewrite Rules" marginSize="small" />
|
||||
<NavigationBlurEffectHeader title={t("actions.edit_rewrite_rule")} />
|
||||
<GroupedInsetListSectionHeader
|
||||
label={t("actions.action_card.rewrite_rules")}
|
||||
marginSize="small"
|
||||
/>
|
||||
{rule?.result.rewriteRules?.map((rewriteRule, rewriteRuleIndex) => (
|
||||
<GroupedInsetListCard key={rewriteRuleIndex} className="mb-4">
|
||||
<GroupedInsetListBaseCell className="flex-row">
|
||||
<Text>From</Text>
|
||||
<Text className="text-label">{t("actions.action_card.from")}</Text>
|
||||
<PlainTextField
|
||||
className="w-full flex-1 text-right"
|
||||
value={rewriteRule.from}
|
||||
@@ -40,7 +45,7 @@ export const EditRewriteRulesScreen: NavigationControllerView<{ index: number }>
|
||||
/>
|
||||
</GroupedInsetListBaseCell>
|
||||
<GroupedInsetListBaseCell className="flex-row">
|
||||
<Text>To</Text>
|
||||
<Text className="text-label">{t("actions.action_card.to")}</Text>
|
||||
<PlainTextField
|
||||
className="w-full flex-1 text-right"
|
||||
value={rewriteRule.to}
|
||||
@@ -58,7 +63,7 @@ export const EditRewriteRulesScreen: NavigationControllerView<{ index: number }>
|
||||
))}
|
||||
<GroupedInsetListCard>
|
||||
<GroupedPlainButtonCell
|
||||
label="Add"
|
||||
label={t("actions.action_card.add")}
|
||||
onPress={() => {
|
||||
actionActions.addRewriteRule(index)
|
||||
}}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Text, View } from "react-native"
|
||||
import * as DropdownMenu from "zeego/dropdown-menu"
|
||||
|
||||
@@ -27,6 +28,7 @@ import { availableActionList, filterFieldOptions, filterOperatorOptions } from "
|
||||
import { EditConditionScreen } from "./EditCondition"
|
||||
|
||||
export const EditRuleScreen: NavigationControllerView<{ index: number }> = ({ index }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const rule = useActionRule(index)
|
||||
|
||||
return (
|
||||
@@ -34,7 +36,9 @@ export const EditRuleScreen: NavigationControllerView<{ index: number }> = ({ in
|
||||
className="bg-system-grouped-background"
|
||||
contentContainerClassName="mt-6"
|
||||
>
|
||||
<NavigationBlurEffectHeader title={`Edit Rule - ${rule?.name}`} />
|
||||
<NavigationBlurEffectHeader
|
||||
title={`${t("actions.edit_rule")}${rule?.name ? ` - ${rule.name}` : ""}`}
|
||||
/>
|
||||
<RuleImpl index={index} />
|
||||
</SafeNavigationScrollView>
|
||||
)
|
||||
@@ -63,9 +67,14 @@ const RuleImpl: React.FC<{ index: number }> = ({ index }) => {
|
||||
}
|
||||
|
||||
const NameSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
return (
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell label="Name" leftClassName="flex-none" rightClassName="flex-1">
|
||||
<GroupedInsetListCell
|
||||
label={t("actions.action_card.name")}
|
||||
leftClassName="flex-none"
|
||||
rightClassName="flex-1"
|
||||
>
|
||||
<View className="flex-1">
|
||||
<PlainTextField
|
||||
className="text-secondary-label w-full flex-1 text-right"
|
||||
@@ -83,20 +92,24 @@ const NameSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
}
|
||||
|
||||
const FilterSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const hasCustomFilters = rule.condition.length > 0
|
||||
return (
|
||||
<View>
|
||||
<GroupedInsetListSectionHeader label="When feeds match..." marginSize="small" />
|
||||
<GroupedInsetListSectionHeader
|
||||
label={t("actions.action_card.when_feeds_match")}
|
||||
marginSize="small"
|
||||
/>
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListActionCellRadio
|
||||
label="All"
|
||||
label={t("actions.action_card.all")}
|
||||
selected={!hasCustomFilters}
|
||||
onPress={() => {
|
||||
actionActions.toggleRuleFilter(rule.index)
|
||||
}}
|
||||
/>
|
||||
<GroupedInsetListActionCellRadio
|
||||
label="Custom filters"
|
||||
label={t("actions.action_card.custom_filters")}
|
||||
selected={hasCustomFilters}
|
||||
onPress={() => {
|
||||
actionActions.toggleRuleFilter(rule.index)
|
||||
@@ -108,13 +121,15 @@ const FilterSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
}
|
||||
|
||||
const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ filter, index }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { t: tCommon } = useTranslation("common")
|
||||
const navigation = useNavigation()
|
||||
const colors = useColors()
|
||||
|
||||
if (filter.length === 0) return null
|
||||
return (
|
||||
<View>
|
||||
<GroupedInsetListSectionHeader label="Conditions" marginSize="small" />
|
||||
<GroupedInsetListSectionHeader label={t("actions.conditions")} marginSize="small" />
|
||||
|
||||
{filter.map((group, groupIndex) => {
|
||||
if (!Array.isArray(group)) {
|
||||
@@ -129,7 +144,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
)
|
||||
const currentValue =
|
||||
currentField?.type === "view"
|
||||
? views.find((view) => view.view === Number(item.value))?.name
|
||||
? tCommon(views.find((view) => view.view === Number(item.value))?.name!)
|
||||
: item.value
|
||||
return (
|
||||
<SwipeableItem
|
||||
@@ -137,7 +152,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
swipeRightToCallAction
|
||||
rightActions={[
|
||||
{
|
||||
label: "Delete",
|
||||
label: tCommon("words.delete"),
|
||||
onPress: () => {
|
||||
actionActions.deleteConditionItem({
|
||||
ruleIndex: index,
|
||||
@@ -148,7 +163,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
backgroundColor: colors.red,
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
label: tCommon("words.edit"),
|
||||
onPress: () => {
|
||||
navigation.pushControllerView(EditConditionScreen, {
|
||||
ruleIndex: index,
|
||||
@@ -162,7 +177,11 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
>
|
||||
<GroupedInsetListActionCell
|
||||
label={
|
||||
[currentField?.label, currentOperator?.label, currentValue]
|
||||
[
|
||||
currentField?.label ? t(currentField.label) : "",
|
||||
currentOperator?.label ? t(currentOperator.label) : "",
|
||||
currentValue,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ") || "Unknown"
|
||||
}
|
||||
@@ -178,7 +197,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
)
|
||||
})}
|
||||
<GroupedPlainButtonCell
|
||||
label="And"
|
||||
label={t("actions.action_card.and")}
|
||||
onPress={() => {
|
||||
actionActions.addConditionItem({ ruleIndex: index, groupIndex })
|
||||
setTimeout(() => {
|
||||
@@ -195,7 +214,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
})}
|
||||
<GroupedInsetListCard>
|
||||
<GroupedPlainButtonCell
|
||||
label="Or"
|
||||
label={t("actions.action_card.or")}
|
||||
onPress={() => {
|
||||
actionActions.addConditionGroup({ ruleIndex: index })
|
||||
}}
|
||||
@@ -206,6 +225,7 @@ const ConditionSection: React.FC<{ filter: ActionFilter; index: number }> = ({ f
|
||||
}
|
||||
|
||||
const ActionSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const enabledActions = availableActionList.filter(
|
||||
(action) => rule.result[action.value] !== undefined,
|
||||
)
|
||||
@@ -218,14 +238,14 @@ const ActionSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
|
||||
return (
|
||||
<View>
|
||||
<GroupedInsetListSectionHeader label="Then do..." marginSize="small" />
|
||||
<GroupedInsetListSectionHeader label={t("actions.action_card.then_do")} marginSize="small" />
|
||||
<GroupedInsetListCard>
|
||||
{enabledActions.map((action) => (
|
||||
<SwipeableItem
|
||||
key={action.value}
|
||||
rightActions={[
|
||||
{
|
||||
label: "Delete",
|
||||
label: t("words.delete", { ns: "common" }),
|
||||
onPress: () => {
|
||||
actionActions.deleteRuleAction(rule.index, action.value)
|
||||
},
|
||||
@@ -237,12 +257,12 @@ const ActionSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
<action.component rule={rule} />
|
||||
) : action.onNavigate ? (
|
||||
<GroupedInsetListActionCell
|
||||
label={action.label}
|
||||
label={t(action.label)}
|
||||
onPress={() => action.onNavigate?.(navigation, rule.index)}
|
||||
/>
|
||||
) : (
|
||||
<GroupedInsetListCell
|
||||
label={action.label}
|
||||
label={t(action.label)}
|
||||
leftClassName="flex-none"
|
||||
rightClassName="flex-1 flex-row justify-end"
|
||||
/>
|
||||
@@ -252,7 +272,7 @@ const ActionSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
{notEnabledActions.length > 0 && (
|
||||
<DropdownMenu.Root>
|
||||
<DropdownMenu.Trigger asChild>
|
||||
<GroupedPlainButtonCell label="Add" />
|
||||
<GroupedPlainButtonCell label={t("actions.action_card.add")} />
|
||||
</DropdownMenu.Trigger>
|
||||
<DropdownMenu.Content>
|
||||
{notEnabledActions.map((action) => (
|
||||
@@ -266,7 +286,7 @@ const ActionSection: React.FC<{ rule: ActionRule }> = ({ rule }) => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<DropdownMenu.ItemTitle>{action.label}</DropdownMenu.ItemTitle>
|
||||
<DropdownMenu.ItemTitle>{t(action.label)}</DropdownMenu.ItemTitle>
|
||||
</DropdownMenu.Item>
|
||||
))}
|
||||
</DropdownMenu.Content>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Text } from "react-native"
|
||||
|
||||
import {
|
||||
@@ -16,12 +17,13 @@ import { useActionRule } from "@/src/store/action/hooks"
|
||||
import { actionActions } from "@/src/store/action/store"
|
||||
|
||||
export const EditWebhooksScreen: NavigationControllerView<{ index: number }> = ({ index }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const rule = useActionRule(index)
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Edit Webhooks" />
|
||||
<GroupedInsetListSectionHeader label="Webhooks" marginSize="small" />
|
||||
<NavigationBlurEffectHeader title={t("actions.edit_webhook")} />
|
||||
<GroupedInsetListSectionHeader label={t("actions.action_card.webhooks")} marginSize="small" />
|
||||
<GroupedInsetListCard>
|
||||
{rule?.result.webhooks?.map((webhook, webhookIndex) => (
|
||||
<GroupedInsetListBaseCell className="flex-row" key={webhookIndex}>
|
||||
@@ -36,7 +38,7 @@ export const EditWebhooksScreen: NavigationControllerView<{ index: number }> = (
|
||||
</GroupedInsetListBaseCell>
|
||||
))}
|
||||
<GroupedInsetButtonCell
|
||||
label="Add"
|
||||
label={t("actions.action_card.add")}
|
||||
onPress={() => {
|
||||
actionActions.addWebhook(index)
|
||||
}}
|
||||
|
||||
@@ -23,7 +23,8 @@ import { updateDayjsLocale } from "@/src/lib/i18n"
|
||||
import type { NavigationControllerView } from "@/src/lib/navigation/types"
|
||||
|
||||
function LanguageSelect({ settingKey }: { settingKey: "language" | "actionLanguage" }) {
|
||||
const { t } = useTranslation("lang")
|
||||
const { t } = useTranslation("settings")
|
||||
const { t: tLang } = useTranslation("lang")
|
||||
const languageMapWithTranslation = useMemo(() => {
|
||||
const languageKeys =
|
||||
settingKey === "language"
|
||||
@@ -33,16 +34,18 @@ function LanguageSelect({ settingKey }: { settingKey: "language" | "actionLangua
|
||||
)
|
||||
|
||||
return languageKeys.map((key) => ({
|
||||
subLabel: settingKey === "language" ? t(`langs.${key}`, { lng: key }) : undefined,
|
||||
label: t(`langs.${key}`),
|
||||
subLabel: settingKey === "language" ? tLang(`langs.${key}`, { lng: key }) : undefined,
|
||||
label: tLang(`langs.${key}`),
|
||||
value: key,
|
||||
}))
|
||||
}, [settingKey, t])
|
||||
}, [settingKey, tLang])
|
||||
const language = useGeneralSettingKey(settingKey)
|
||||
|
||||
return (
|
||||
<GroupedInsetListBaseCell>
|
||||
<Text className="text-label">Language</Text>
|
||||
<Text className="text-label">
|
||||
{settingKey === "language" ? t("general.language") : t("general.action_language.label")}
|
||||
</Text>
|
||||
|
||||
<View className="w-[150px]">
|
||||
<Select
|
||||
@@ -54,7 +57,7 @@ function LanguageSelect({ settingKey }: { settingKey: "language" | "actionLangua
|
||||
updateDayjsLocale(value)
|
||||
}
|
||||
}}
|
||||
displayValue={t(`langs.${language}` as any)}
|
||||
displayValue={tLang(`langs.${language}` as any)}
|
||||
options={languageMapWithTranslation}
|
||||
/>
|
||||
</View>
|
||||
@@ -63,9 +66,12 @@ function LanguageSelect({ settingKey }: { settingKey: "language" | "actionLangua
|
||||
}
|
||||
|
||||
export const GeneralScreen: NavigationControllerView = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
|
||||
const translation = useGeneralSettingKey("translation")
|
||||
const summary = useGeneralSettingKey("summary")
|
||||
const autoGroup = useGeneralSettingKey("autoGroup")
|
||||
// TODO: support autoGroup
|
||||
// const autoGroup = useGeneralSettingKey("autoGroup")
|
||||
const showUnreadOnLaunch = useGeneralSettingKey("unreadOnly")
|
||||
// const groupByDate = useGeneralSettingKey("groupByDate")
|
||||
const expandLongSocialMedia = useGeneralSettingKey("autoExpandLongSocialMedia")
|
||||
@@ -75,18 +81,18 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="General" />
|
||||
<NavigationBlurEffectHeader title={t("titles.general")} />
|
||||
{/* Language */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Language" />
|
||||
<GroupedInsetListSectionHeader label={t("general.language")} />
|
||||
<GroupedInsetListCard>
|
||||
<LanguageSelect settingKey="language" />
|
||||
</GroupedInsetListCard>
|
||||
|
||||
{/* Content Behavior */}
|
||||
<GroupedInsetListSectionHeader label="Action" />
|
||||
<GroupedInsetListSectionHeader label={t("general.action.title")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell label="AI Summary">
|
||||
<GroupedInsetListCell label={t("general.action.summary")}>
|
||||
<Switch
|
||||
size="sm"
|
||||
value={summary}
|
||||
@@ -95,7 +101,7 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
}}
|
||||
/>
|
||||
</GroupedInsetListCell>
|
||||
<GroupedInsetListCell label="AI Translation">
|
||||
<GroupedInsetListCell label={t("general.action.translation")}>
|
||||
<Switch
|
||||
size="sm"
|
||||
value={translation}
|
||||
@@ -109,11 +115,11 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
|
||||
{/* Subscriptions */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Subscriptions" />
|
||||
{/* <GroupedInsetListSectionHeader label={t("general.subscriptions")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell
|
||||
label="Auto Group"
|
||||
description="Automatically group feeds by site domain."
|
||||
label={t("general.auto_group.label")}
|
||||
description={t("general.auto_group.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -123,13 +129,13 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
}}
|
||||
/>
|
||||
</GroupedInsetListCell>
|
||||
</GroupedInsetListCard>
|
||||
</GroupedInsetListCard> */}
|
||||
|
||||
{/* Timeline */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Timeline" />
|
||||
<GroupedInsetListSectionHeader label={t("general.timeline")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell label="Show unread content on launch">
|
||||
<GroupedInsetListCell label={t("general.show_unread_on_launch.label")}>
|
||||
<Switch
|
||||
size="sm"
|
||||
value={showUnreadOnLaunch}
|
||||
@@ -150,8 +156,8 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
</GroupedInsetListCell> */}
|
||||
|
||||
<GroupedInsetListCell
|
||||
label="Expand long social media"
|
||||
description="Automatically expand social media entries containing long text."
|
||||
label={t("general.auto_expand_long_social_media.label")}
|
||||
description={t("general.auto_expand_long_social_media.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -165,11 +171,11 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
|
||||
{/* Unread */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Unread" />
|
||||
<GroupedInsetListSectionHeader label={t("general.unread")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell
|
||||
label="Mark as read when scrolling"
|
||||
description="Automatically mark entries as read when scrolled out of the view."
|
||||
label={t("general.mark_as_read.scroll.label")}
|
||||
description={t("general.mark_as_read.scroll.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -181,8 +187,8 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
</GroupedInsetListCell>
|
||||
|
||||
<GroupedInsetListCell
|
||||
label="Mark as read when in the view"
|
||||
description="Automatically mark single-level entries (e.g. social media posts, pictures, video views) as read when they enter the view."
|
||||
label={t("general.mark_as_read.render.label")}
|
||||
description={t("general.mark_as_read.render.description")}
|
||||
>
|
||||
<Switch
|
||||
size="sm"
|
||||
@@ -196,9 +202,9 @@ export const GeneralScreen: NavigationControllerView = () => {
|
||||
|
||||
{/* Content Behavior */}
|
||||
|
||||
<GroupedInsetListSectionHeader label="Content" />
|
||||
<GroupedInsetListSectionHeader label={t("general.content")} />
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInsetListCell label="Open Links in app">
|
||||
<GroupedInsetListCell label={t("general.open_links_in_app.label")}>
|
||||
<Switch
|
||||
size="sm"
|
||||
value={openLinksInApp}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { cn } from "@follow/utils"
|
||||
import { useMutation, useQuery } from "@tanstack/react-query"
|
||||
import dayjs from "dayjs"
|
||||
import { setStringAsync } from "expo-clipboard"
|
||||
import { Trans, useTranslation } from "react-i18next"
|
||||
import { Pressable, Text, View } from "react-native"
|
||||
|
||||
import { useServerConfigs } from "@/src/atoms/server-configs"
|
||||
@@ -50,6 +51,7 @@ const useInvitationsLimitationQuery = () => {
|
||||
|
||||
const numberFormatter = new Intl.NumberFormat("en-US")
|
||||
export const InvitationsScreen: NavigationControllerView = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const serverConfigs = useServerConfigs()
|
||||
|
||||
const { data: invitations, isLoading } = useInvitationsQuery()
|
||||
@@ -60,32 +62,57 @@ export const InvitationsScreen: NavigationControllerView = () => {
|
||||
}
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Invitations" headerRight={<GenerateButton />} />
|
||||
<NavigationBlurEffectHeader
|
||||
title={t("titles.invitations")}
|
||||
headerRight={<GenerateButton />}
|
||||
/>
|
||||
<View className="mt-6">
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInformationCell
|
||||
title="Invitations"
|
||||
title={t("titles.invitations")}
|
||||
icon={<LoveCuteFiIcon height={40} width={40} color="#fff" />}
|
||||
iconBackgroundColor={accentColor}
|
||||
>
|
||||
<Text className="text-label mt-3 text-base leading-tight">
|
||||
Follow is currently in <Text className="font-bold">early access</Text> and requires an
|
||||
invitation code to use. You can spend {serverConfigs?.INVITATION_PRICE}{" "}
|
||||
<View style={{ transform: [{ translateY: 6 }, { translateX: -2 }] }}>
|
||||
<PowerIcon color={accentColor} height={16} width={16} />
|
||||
</View>
|
||||
Power to generate an invitation code for your friends.
|
||||
</Text>
|
||||
|
||||
<Text className="text-label mt-3 text-base leading-tight">
|
||||
Based on your usage time, you can generate up to{" "}
|
||||
{numberFormatter.format(limitation ?? 0)} invitation codes.
|
||||
</Text>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="invitation.earlyAccess"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label mt-3 text-base leading-tight">{children}</Text>
|
||||
)}
|
||||
components={{ strong: <Text className="font-bold" /> }}
|
||||
/>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="invitation.generateCost"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label mt-3 text-base leading-tight">{children}</Text>
|
||||
)}
|
||||
values={{
|
||||
INVITATION_PRICE: serverConfigs?.INVITATION_PRICE,
|
||||
}}
|
||||
components={{
|
||||
PowerIcon: (
|
||||
<View style={{ transform: [{ translateY: 6 }, { translateX: -2 }] }}>
|
||||
<PowerIcon color={accentColor} height={16} width={16} />
|
||||
</View>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Trans
|
||||
ns="settings"
|
||||
i18nKey="invitation.limitationMessage"
|
||||
parent={({ children }: { children: React.ReactNode }) => (
|
||||
<Text className="text-label mt-3 text-base leading-tight">{children}</Text>
|
||||
)}
|
||||
values={{
|
||||
limitation: numberFormatter.format(limitation ?? 0),
|
||||
}}
|
||||
/>
|
||||
</GroupedInformationCell>
|
||||
</GroupedInsetListCard>
|
||||
</View>
|
||||
|
||||
<GroupedInsetListSectionHeader label="Invitations" />
|
||||
<GroupedInsetListSectionHeader label={t("titles.invitations")} />
|
||||
<GroupedInsetListCard>
|
||||
{isLoading && <GroupedInsetActivityIndicatorCell />}
|
||||
{invitations?.data?.map((invitation) => (
|
||||
@@ -99,10 +126,11 @@ export const InvitationsScreen: NavigationControllerView = () => {
|
||||
className={cn("text-label", !invitation.users && "text-secondary-label")}
|
||||
numberOfLines={1}
|
||||
>
|
||||
{invitation.users?.name || (!invitation.users ? "Not used" : "")}
|
||||
{invitation.users?.name || (!invitation.users ? t("invitation.notUsed") : "")}
|
||||
</Text>
|
||||
<Text className="text-secondary-label text-sm">
|
||||
Created at {dayjs(invitation.createdAt).format("YYYY/MM/DD")}
|
||||
{t("invitation.created_at")}{" "}
|
||||
{dayjs(invitation.createdAt).format("YYYY/MM/DD")}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -129,6 +157,7 @@ export const InvitationsScreen: NavigationControllerView = () => {
|
||||
}
|
||||
|
||||
const GenerateButton = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const limitation = useInvitationsLimitationQuery()
|
||||
const { data: invitations } = useInvitationsQuery()
|
||||
const disabled = !limitation || (invitations && invitations?.data?.length >= limitation)
|
||||
@@ -145,7 +174,7 @@ const GenerateButton = () => {
|
||||
!disabled ? "text-accent" : "text-secondary-label",
|
||||
)}
|
||||
>
|
||||
Generate
|
||||
{t("invitation.generate")}
|
||||
</Text>
|
||||
</UINavigationHeaderActionButton>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createContext, createElement, useCallback, useContext, useMemo } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import type { ListRenderItem } from "react-native"
|
||||
import { ActivityIndicator, Image, StyleSheet, Text, View } from "react-native"
|
||||
import Animated, { LinearTransition } from "react-native-reanimated"
|
||||
@@ -34,13 +35,14 @@ import { ManageListScreen } from "./ManageList"
|
||||
|
||||
const ListContext = createContext({} as Record<string, HonoApiClient.List_List_Get>)
|
||||
export const ListsScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { isLoading, data } = usePrefetchOwnedLists()
|
||||
const lists = useOwnedLists()
|
||||
|
||||
return (
|
||||
<SafeNavigationScrollView nestedScrollEnabled className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader
|
||||
title="Lists"
|
||||
title={t("titles.lists")}
|
||||
headerRight={useCallback(
|
||||
() => (
|
||||
<AddListButton />
|
||||
@@ -52,8 +54,8 @@ export const ListsScreen = () => {
|
||||
<View className="mt-6">
|
||||
<GroupedInsetListCard>
|
||||
<GroupedInformationCell
|
||||
title="Lists"
|
||||
description="Lists are collections of feeds that you can share or sell for others to subscribe to. Subscribers will synchronize and access all feeds in the list."
|
||||
title={t("titles.lists")}
|
||||
description={t("lists.info")}
|
||||
icon={<RadaCuteFiIcon height={40} width={40} color="#fff" />}
|
||||
iconBackgroundColor="#34D399"
|
||||
/>
|
||||
@@ -128,6 +130,7 @@ const ListItemCell: ListRenderItem<ListModel> = (props) => {
|
||||
return <ListItemCellImpl {...props} />
|
||||
}
|
||||
const ListItemCellImpl: ListRenderItem<ListModel> = ({ item: list }) => {
|
||||
const { t } = useTranslation("common")
|
||||
const { title, description } = list
|
||||
const listData = useContext(ListContext)[list.id]
|
||||
|
||||
@@ -139,14 +142,14 @@ const ListItemCellImpl: ListRenderItem<ListModel> = ({ item: list }) => {
|
||||
swipeRightToCallAction
|
||||
rightActions={[
|
||||
{
|
||||
label: "Manage",
|
||||
label: t("words.manage"),
|
||||
onPress: () => {
|
||||
navigation.pushControllerView(ManageListScreen, { id: list.id })
|
||||
},
|
||||
backgroundColor: accentColor,
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
label: t("words.edit"),
|
||||
onPress: () => {
|
||||
navigation.presentControllerView(ListScreen, { listId: list.id })
|
||||
},
|
||||
@@ -185,7 +188,9 @@ const ListItemCellImpl: ListRenderItem<ListModel> = ({ item: list }) => {
|
||||
height: 16,
|
||||
width: 16,
|
||||
})}
|
||||
<Text className="text-secondary-label text-base">{views[list.view]?.name}</Text>
|
||||
{!!views[list.view]?.name && (
|
||||
<Text className="text-secondary-label text-base">{t(views[list.view]!.name)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import type { MutableRefObject } from "react"
|
||||
import { createContext, useContext, useEffect, useMemo, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { PixelRatio, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import { HeaderSubmitButton } from "@/src/components/layouts/header/HeaderElements"
|
||||
@@ -50,6 +51,7 @@ export const ManageListScreen: NavigationControllerView<{ id: string }> = ({ id
|
||||
}
|
||||
|
||||
const ListImpl: React.FC<{ id: string }> = ({ id }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const list = useList(id)!
|
||||
usePrefetchSubscription(list.view)
|
||||
|
||||
@@ -80,7 +82,7 @@ const ListImpl: React.FC<{ id: string }> = ({ id }) => {
|
||||
return (
|
||||
<ManageListContext.Provider value={ctxValue}>
|
||||
<NavigationBlurEffectHeader
|
||||
title={`Manage List - ${list?.title}`}
|
||||
title={`${t("lists.manage_list")} - ${list?.title}`}
|
||||
headerRight={() => (
|
||||
<UINavigationHeaderActionButton>
|
||||
<HeaderSubmitButton
|
||||
@@ -101,7 +103,7 @@ const ListImpl: React.FC<{ id: string }> = ({ id }) => {
|
||||
</UINavigationHeaderActionButton>
|
||||
)}
|
||||
/>
|
||||
<GroupedInsetListSectionHeader label="Select feeds to add to the current list" />
|
||||
<GroupedInsetListSectionHeader label={t("lists.select_feeds")} />
|
||||
<GroupedInsetListCard SeparatorComponent={SeparatorComponent}>
|
||||
{sortedSubscriptionIds.map((id) => (
|
||||
<FeedCell key={id} feedId={id} isSelected={list.feedIds.includes(id)} />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import {
|
||||
NavigationBlurEffectHeader,
|
||||
SafeNavigationScrollView,
|
||||
@@ -10,13 +12,14 @@ import { useNavigation } from "@/src/lib/navigation/hooks"
|
||||
import { TermsScreen } from "@/src/screens/(headless)/terms"
|
||||
|
||||
export const PrivacyScreen = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { pushControllerView } = useNavigation()
|
||||
return (
|
||||
<SafeNavigationScrollView className="bg-system-grouped-background">
|
||||
<NavigationBlurEffectHeader title="Privacy" />
|
||||
<NavigationBlurEffectHeader title={t("titles.privacy")} />
|
||||
<GroupedInsetListCard className="mt-4">
|
||||
<GroupedInsetListNavigationLink
|
||||
label="Terms"
|
||||
label={t("privacy.terms")}
|
||||
onPress={() => {
|
||||
pushControllerView(TermsScreen)
|
||||
}}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { FeedViewType } from "@follow/constants"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { memo, useEffect, useState } from "react"
|
||||
import { Controller, useForm } from "react-hook-form"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { View } from "react-native"
|
||||
import { z } from "zod"
|
||||
|
||||
@@ -56,6 +57,7 @@ const defaultValues = {
|
||||
export const ListScreen: NavigationControllerView<{
|
||||
listId?: string
|
||||
}> = ({ listId }) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const list = useList(listId || "")
|
||||
const form = useForm({
|
||||
defaultValues: list || defaultValues,
|
||||
@@ -79,7 +81,7 @@ export const ListScreen: NavigationControllerView<{
|
||||
}}
|
||||
render={({ field: { onChange, onBlur, ref, value } }) => (
|
||||
<TextField
|
||||
label="Title"
|
||||
label={t("lists.title")}
|
||||
required={true}
|
||||
wrapperClassName="mt-2"
|
||||
placeholder=""
|
||||
@@ -98,7 +100,7 @@ export const ListScreen: NavigationControllerView<{
|
||||
control={form.control}
|
||||
render={({ field: { onChange, onBlur, ref, value } }) => (
|
||||
<TextField
|
||||
label="Description"
|
||||
label={t("lists.description")}
|
||||
wrapperClassName="mt-2"
|
||||
placeholder=""
|
||||
onBlur={onBlur}
|
||||
@@ -118,7 +120,7 @@ export const ListScreen: NavigationControllerView<{
|
||||
render={({ field: { onChange, onBlur, ref, value } }) => (
|
||||
<TextField
|
||||
autoCapitalize="none"
|
||||
label="Image"
|
||||
label={t("lists.image")}
|
||||
wrapperClassName="mt-2"
|
||||
placeholder="https://"
|
||||
onBlur={onBlur}
|
||||
@@ -134,7 +136,7 @@ export const ListScreen: NavigationControllerView<{
|
||||
</View>
|
||||
|
||||
<View className="mt-4">
|
||||
<FormLabel label="View" className="mb-4 pl-2.5" optional />
|
||||
<FormLabel label={t("lists.view")} className="mb-4 pl-2.5" optional />
|
||||
<Controller
|
||||
name="view"
|
||||
control={form.control}
|
||||
@@ -150,7 +152,7 @@ export const ListScreen: NavigationControllerView<{
|
||||
control={form.control}
|
||||
render={({ field: { onChange, onBlur, ref, value } }) => (
|
||||
<NumberField
|
||||
label="Fee"
|
||||
label={t("lists.fee.label")}
|
||||
wrapperClassName="mt-2"
|
||||
placeholder="0"
|
||||
onBlur={onBlur}
|
||||
@@ -168,12 +170,15 @@ export const ListScreen: NavigationControllerView<{
|
||||
{isEditing && (
|
||||
<GroupedInsetListCard className="mt-6">
|
||||
<GroupedInsetButtonCell
|
||||
label="Delete"
|
||||
label={t("words.delete", { ns: "common" })}
|
||||
style="destructive"
|
||||
onPress={() => {
|
||||
showActionSheetWithOptions(
|
||||
{
|
||||
options: ["Delete", "Cancel"],
|
||||
options: [
|
||||
t("words.delete", { ns: "common" }),
|
||||
t("words.cancel", { ns: "common" }),
|
||||
],
|
||||
cancelButtonIndex: 1,
|
||||
destructiveButtonIndex: 0,
|
||||
},
|
||||
@@ -198,6 +203,7 @@ interface ScreenOptionsProps {
|
||||
listId?: string
|
||||
}
|
||||
const ScreenOptions = memo(({ title, listId }: ScreenOptionsProps) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const form = useFormContext()
|
||||
|
||||
const { isValid, isDirty } = form.formState
|
||||
@@ -215,7 +221,7 @@ const ScreenOptions = memo(({ title, listId }: ScreenOptionsProps) => {
|
||||
|
||||
return (
|
||||
<NavigationBlurEffectHeader
|
||||
title={title ? `Edit List - ${title}` : "Create List"}
|
||||
title={title ? `${t("lists.edit.label")} - ${title}` : t("lists.create")}
|
||||
headerRight={
|
||||
<FormProvider form={form}>
|
||||
<HeaderSubmitButton
|
||||
|
||||
@@ -46,6 +46,7 @@ export function Settings() {
|
||||
)
|
||||
}
|
||||
const SettingHeader = ({ scrollY }: { scrollY: SharedValue<number> }) => {
|
||||
const { t } = useTranslation()
|
||||
const frame = useSafeAreaFrame()
|
||||
const insets = useSafeAreaInsets()
|
||||
const headerHeight = getDefaultHeaderHeight(frame, false, insets.top)
|
||||
@@ -66,7 +67,9 @@ const SettingHeader = ({ scrollY }: { scrollY: SharedValue<number> }) => {
|
||||
style={styles}
|
||||
>
|
||||
<BlurEffect />
|
||||
<Text className="text-label flex-1 text-center text-[17px] font-semibold">Settings</Text>
|
||||
<Text className="text-label flex-1 text-center text-[17px] font-semibold">
|
||||
{t("tabs.settings")}
|
||||
</Text>
|
||||
</Animated.View>
|
||||
{!!whoami?.id && <EditProfileButton />}
|
||||
</View>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"close": "إغلاق",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "ملفات صوتية",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "الأمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "رجوع",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.close": "إغلاق",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تعديل",
|
||||
"words.entry": "إدخال",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "صوتيات",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -17,6 +15,8 @@
|
||||
"time.yesterday": "الأمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "رجوع",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تحرير",
|
||||
"words.entry": "إدخال",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "مقاطع صوتية",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -17,6 +15,8 @@
|
||||
"time.yesterday": "الأمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "رجوع",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تحرير",
|
||||
"words.entry": "إدخال",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"close": "إغلاق",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "ملفات صوتية",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "الأمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "الرجوع",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.close": "إغلاق",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تحرير",
|
||||
"words.entry": "إدخال",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"close": "إغلاق",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "ملفات صوتية",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "أمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "عودة",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.close": "إغلاق",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تحرير",
|
||||
"words.entry": "إدخال",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "تم النسخ إلى الحافظة",
|
||||
"cancel": "إلغاء",
|
||||
"confirm": "تأكيد",
|
||||
"feed_view_type.articles": "مقالات",
|
||||
"feed_view_type.audios": "مقاطع صوتية",
|
||||
"feed_view_type.notifications": "إشعارات",
|
||||
@@ -17,6 +15,8 @@
|
||||
"time.yesterday": "الأمس",
|
||||
"tips.load-lng-error": "فشل في تحميل حزمة اللغة",
|
||||
"words.back": "عودة",
|
||||
"words.cancel": "إلغاء",
|
||||
"words.confirm": "تأكيد",
|
||||
"words.copy": "نسخ",
|
||||
"words.edit": "تعديل",
|
||||
"words.entry": "مدخل",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "In die Zwischenablage kopiert",
|
||||
"cancel": "Abbrechen",
|
||||
"close": "Schließen",
|
||||
"confirm": "Bestätigen",
|
||||
"feed_view_type.articles": "Artikel",
|
||||
"feed_view_type.audios": "Audios",
|
||||
"feed_view_type.notifications": "Benachrichtigungen",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "Gestern",
|
||||
"tips.load-lng-error": "Fehler beim Laden des Sprachpakets",
|
||||
"words.back": "Zurück",
|
||||
"words.cancel": "Abbrechen",
|
||||
"words.close": "Schließen",
|
||||
"words.confirm": "Bestätigen",
|
||||
"words.copy": "Kopieren",
|
||||
"words.edit": "Bearbeiten",
|
||||
"words.entry": "Eintrag",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Copied to clipboard",
|
||||
"cancel": "Cancel",
|
||||
"close": "Close",
|
||||
"confirm": "Confirm",
|
||||
"discover.category.all": "All",
|
||||
"discover.category.anime": "ACG",
|
||||
"discover.category.bbs": "BBS",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "ago",
|
||||
"words.all": "All",
|
||||
"words.back": "Back",
|
||||
"words.cancel": "Cancel",
|
||||
"words.close": "Close",
|
||||
"words.confirm": "Confirm",
|
||||
"words.copy": "Copy",
|
||||
"words.create": "Create",
|
||||
"words.default": "Default",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Copiado al portapapeles",
|
||||
"cancel": "Cancelar",
|
||||
"close": "Cerrar",
|
||||
"confirm": "Confirmar",
|
||||
"feed_view_type.articles": "Artículos",
|
||||
"feed_view_type.audios": "Audios",
|
||||
"feed_view_type.notifications": "Notificaciones",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "Ayer",
|
||||
"tips.load-lng-error": "Error al cargar el paquete de idioma",
|
||||
"words.back": "Atrás",
|
||||
"words.cancel": "Cancelar",
|
||||
"words.close": "Cerrar",
|
||||
"words.confirm": "Confirmar",
|
||||
"words.copy": "Copiar",
|
||||
"words.edit": "Editar",
|
||||
"words.entry": "Entrada",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Kopioitu leikepöydälle",
|
||||
"cancel": "Peruuta",
|
||||
"confirm": "Vahvista",
|
||||
"feed_view_type.articles": "Artikkelit",
|
||||
"feed_view_type.audios": "Äänitteet",
|
||||
"feed_view_type.notifications": "Ilmoitukset",
|
||||
@@ -17,6 +15,8 @@
|
||||
"time.yesterday": "Eilen",
|
||||
"tips.load-lng-error": "Kielipaketin lataaminen epäonnistui",
|
||||
"words.back": "Takaisin",
|
||||
"words.cancel": "Peruuta",
|
||||
"words.confirm": "Vahvista",
|
||||
"words.copy": "Kopioi",
|
||||
"words.edit": "Muokkaa",
|
||||
"words.entry": "Merkintä",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Copié dans le presse-papier",
|
||||
"cancel": "Annuler",
|
||||
"close": "Fermer",
|
||||
"confirm": "Confirmer",
|
||||
"feed_view_type.articles": "Articles",
|
||||
"feed_view_type.audios": "Audios",
|
||||
"feed_view_type.notifications": "Notifications",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "Hier",
|
||||
"tips.load-lng-error": "Échec du chargement du pack de langue",
|
||||
"words.back": "Retour",
|
||||
"words.cancel": "Annuler",
|
||||
"words.close": "Fermer",
|
||||
"words.confirm": "Confirmer",
|
||||
"words.copy": "Copier",
|
||||
"words.edit": "Éditer",
|
||||
"words.entry": "Entrée",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Copiato negli appunti",
|
||||
"cancel": "Annulla",
|
||||
"confirm": "Conferma",
|
||||
"feed_view_type.articles": "Articoli",
|
||||
"feed_view_type.audios": "Audio",
|
||||
"feed_view_type.notifications": "Notifiche",
|
||||
@@ -17,6 +15,8 @@
|
||||
"time.yesterday": "Ieri",
|
||||
"tips.load-lng-error": "Errore nel caricamento del pacchetto linguistico",
|
||||
"words.back": "Indietro",
|
||||
"words.cancel": "Annulla",
|
||||
"words.confirm": "Conferma",
|
||||
"words.copy": "Copia",
|
||||
"words.edit": "Modifica",
|
||||
"words.entry": "Voce",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "クリップボードにコピーしました",
|
||||
"cancel": "キャンセル",
|
||||
"close": "閉じる",
|
||||
"confirm": "確認",
|
||||
"discover.category.all": "すべて",
|
||||
"discover.category.anime": "ACG",
|
||||
"discover.category.bbs": "BBS",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "前",
|
||||
"words.all": "すべて",
|
||||
"words.back": "戻る",
|
||||
"words.cancel": "キャンセル",
|
||||
"words.close": "閉じる",
|
||||
"words.confirm": "確認",
|
||||
"words.copy": "コピー",
|
||||
"words.create": "作成",
|
||||
"words.delete": "削除",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "클립보드에 복사됨",
|
||||
"cancel": "취소",
|
||||
"close": "닫기",
|
||||
"confirm": "확인",
|
||||
"discover.category.all": "전체",
|
||||
"discover.category.anime": "ACG",
|
||||
"discover.category.bbs": "BBS",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "전",
|
||||
"words.all": "전체",
|
||||
"words.back": "뒤로",
|
||||
"words.cancel": "취소",
|
||||
"words.close": "닫기",
|
||||
"words.confirm": "확인",
|
||||
"words.copy": "복사",
|
||||
"words.create": "생성",
|
||||
"words.delete": "삭제",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Copiado para a área de transferência",
|
||||
"cancel": "Cancelar",
|
||||
"close": "Fechar",
|
||||
"confirm": "Confirmar",
|
||||
"feed_view_type.articles": "記事",
|
||||
"feed_view_type.audios": "オーディオ",
|
||||
"feed_view_type.notifications": "通知",
|
||||
@@ -18,6 +15,9 @@
|
||||
"time.yesterday": "Ontem",
|
||||
"tips.load-lng-error": "Falha ao carregar o pacote de idioma",
|
||||
"words.back": "Voltar",
|
||||
"words.cancel": "Cancelar",
|
||||
"words.close": "Fechar",
|
||||
"words.confirm": "Confirmar",
|
||||
"words.copy": "Copiar",
|
||||
"words.edit": "Editar",
|
||||
"words.entry": "Entrada",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Скопировано в буфер обмена",
|
||||
"cancel": "Отменить",
|
||||
"close": "Закрыть",
|
||||
"confirm": "Подтвердить",
|
||||
"discover.category.all": "Все",
|
||||
"discover.category.anime": "Аниме",
|
||||
"discover.category.bbs": "BBS",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "назад",
|
||||
"words.all": "Все",
|
||||
"words.back": "Назад",
|
||||
"words.cancel": "Отменить",
|
||||
"words.close": "Закрыть",
|
||||
"words.confirm": "Подтвердить",
|
||||
"words.copy": "Копировать",
|
||||
"words.create": "Создать",
|
||||
"words.delete": "Удалить",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "Panoya kopyalandı",
|
||||
"cancel": "İptal",
|
||||
"close": "Kapat",
|
||||
"confirm": "Onayla",
|
||||
"feed_view_type.articles": "Makaleler",
|
||||
"feed_view_type.audios": "Sesler",
|
||||
"feed_view_type.notifications": "Bildirimler",
|
||||
@@ -19,6 +16,9 @@
|
||||
"tips.load-lng-error": "Dil paketi yüklenemedi",
|
||||
"words.actions": "İşlemler",
|
||||
"words.back": "Geri",
|
||||
"words.cancel": "İptal",
|
||||
"words.close": "Kapat",
|
||||
"words.confirm": "Onayla",
|
||||
"words.copy": "Kopyala",
|
||||
"words.create": "Oluştur",
|
||||
"words.edit": "Düzenle",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "已复制到剪贴板",
|
||||
"cancel": "取消",
|
||||
"close": "关闭",
|
||||
"confirm": "确认",
|
||||
"discover.category.all": "全部",
|
||||
"discover.category.anime": "二次元",
|
||||
"discover.category.bbs": "论坛",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "前",
|
||||
"words.all": "全部",
|
||||
"words.back": "返回",
|
||||
"words.cancel": "取消",
|
||||
"words.close": "关闭",
|
||||
"words.confirm": "确认",
|
||||
"words.copy": "复制",
|
||||
"words.create": "创建",
|
||||
"words.default": "默认",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "已複製到剪貼簿",
|
||||
"cancel": "取消",
|
||||
"close": "關閉",
|
||||
"confirm": "確認",
|
||||
"discover.category.all": "全部",
|
||||
"discover.category.anime": "ACG",
|
||||
"discover.category.bbs": "討論區",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "前",
|
||||
"words.all": "全部",
|
||||
"words.back": "返回",
|
||||
"words.cancel": "取消",
|
||||
"words.close": "關閉",
|
||||
"words.confirm": "確認",
|
||||
"words.copy": "複製",
|
||||
"words.create": "建立",
|
||||
"words.default": "預設",
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"app.copied_to_clipboard": "已複製到剪貼簿",
|
||||
"cancel": "取消",
|
||||
"close": "關閉",
|
||||
"confirm": "確認",
|
||||
"discover.category.all": "全部",
|
||||
"discover.category.anime": "動漫",
|
||||
"discover.category.bbs": "論壇",
|
||||
@@ -45,6 +42,9 @@
|
||||
"words.ago": "前",
|
||||
"words.all": "全部",
|
||||
"words.back": "返回",
|
||||
"words.cancel": "取消",
|
||||
"words.close": "關閉",
|
||||
"words.confirm": "確認",
|
||||
"words.copy": "複製",
|
||||
"words.create": "創建",
|
||||
"words.delete": "刪除",
|
||||
|
||||
@@ -47,6 +47,13 @@
|
||||
"actions.action_card.value": "Value",
|
||||
"actions.action_card.webhooks": "Webhooks",
|
||||
"actions.action_card.when_feeds_match": "When feeds match…",
|
||||
"actions.condition": "Condition",
|
||||
"actions.conditions": "Conditions",
|
||||
"actions.edit_condition": "Edit Condition",
|
||||
"actions.edit_rewrite_rule": "Edit Rewrite Rule",
|
||||
"actions.edit_rule": "Edit Rule",
|
||||
"actions.edit_webhook": "Edit Webhook",
|
||||
"actions.info": "Action are collections of rules that you can automate to perform tasks on server or client side.",
|
||||
"actions.navigate.prompt": "You have unsaved Action changes. Are you sure you want to leave?",
|
||||
"actions.newRule": "New Rule",
|
||||
"actions.save": "Save",
|
||||
@@ -89,9 +96,12 @@
|
||||
"appearance.reduce_motion.label": "Reduce motion",
|
||||
"appearance.save": "Save",
|
||||
"appearance.show_dock_badge.label": "Show as Dock badge",
|
||||
"appearance.show_unread_count.description": "Show unread count in the subscription list",
|
||||
"appearance.show_unread_count.label": "Show unread count",
|
||||
"appearance.sidebar": "Sidebar",
|
||||
"appearance.sidebar_show_unread_count.label": "Show in sidebar",
|
||||
"appearance.sidebar_title": "Appearance",
|
||||
"appearance.subscriptions": "Subscriptions",
|
||||
"appearance.text_size.default": "Default",
|
||||
"appearance.text_size.label": "Global Text Size",
|
||||
"appearance.text_size.large": "Large",
|
||||
@@ -122,8 +132,14 @@
|
||||
"data_control.app_cache_limit.description": "The maximum size of the app cache. Once the cache reaches this size, the oldest items will be deleted to free up space.",
|
||||
"data_control.app_cache_limit.label": "App Cache Limit",
|
||||
"data_control.clean_cache.button": "Clean Cache",
|
||||
"data_control.clean_cache.cancel": "Cancel",
|
||||
"data_control.clean_cache.clear": "Clear",
|
||||
"data_control.clean_cache.description": "Clean the app cache to free up space.",
|
||||
"data_control.clean_cache.description_web": "Clean the web app service worker cache to free up space.",
|
||||
"data_control.data_sources": "Data Sources",
|
||||
"data_control.export_local_database.label": "Export local database",
|
||||
"data_control.import_opml.label": "Import subscriptions from OPML",
|
||||
"data_control.utils": "Utils",
|
||||
"feeds.claimTips": "To claim your feeds and receive tips, right-click on the feed in your subscription list and select Claim.",
|
||||
"feeds.noFeeds": "No claimed feeds",
|
||||
"feeds.tableHeaders.name": "Name",
|
||||
@@ -141,6 +157,7 @@
|
||||
"general.auto_group.description": "Automatically group feeds by site domain.",
|
||||
"general.auto_group.label": "Auto Group",
|
||||
"general.cache": "Cache",
|
||||
"general.content": "Content",
|
||||
"general.data": "Data",
|
||||
"general.data_file.label": "Data File",
|
||||
"general.data_persist.description": "Persist data locally to enable offline access and local search.",
|
||||
@@ -177,10 +194,12 @@
|
||||
"general.minimize_to_tray.description": "Minimize to system tray when closing window",
|
||||
"general.minimize_to_tray.label": "Minimize to tray",
|
||||
"general.network": "Network",
|
||||
"general.open_links_in_app.label": "Open links in app",
|
||||
"general.privacy": "Privacy",
|
||||
"general.proxy.description": "Set proxy for network traffic routing, e.g., socks://proxy.example.com:1080",
|
||||
"general.proxy.label": "Proxy",
|
||||
"general.rebuild_database.button": "Rebuild",
|
||||
"general.rebuild_database.cancel": "Cancel",
|
||||
"general.rebuild_database.description": "If you are experiencing rendering issues, rebuilding the database may solve them.",
|
||||
"general.rebuild_database.label": "Rebuild Database",
|
||||
"general.rebuild_database.title": "Rebuild Database",
|
||||
@@ -197,6 +216,7 @@
|
||||
"general.startup_screen.subscription": "Subscription",
|
||||
"general.startup_screen.timeline": "Timeline",
|
||||
"general.startup_screen.title": "Startup Screen",
|
||||
"general.subscriptions": "Subscriptions",
|
||||
"general.timeline": "Timeline",
|
||||
"general.unread": "Unread",
|
||||
"general.voices": "Voices",
|
||||
@@ -246,8 +266,10 @@
|
||||
"invitation.confirmModal.continue": "Continue",
|
||||
"invitation.confirmModal.message": "Generating an invitation code will cost you {{INVITATION_PRICE}} <PowerIcon /> Power.",
|
||||
"invitation.confirmModal.title": "Confirm",
|
||||
"invitation.created_at": "Created at",
|
||||
"invitation.earlyAccess": "Folo is currently in <strong>early access</strong> and requires an invitation code to use.",
|
||||
"invitation.earlyAccessMessage": "😰 Sorry, Folo is currently in early access and requires an invitation code to use.",
|
||||
"invitation.generate": "Generate",
|
||||
"invitation.generateButton": "Generate new code",
|
||||
"invitation.generateCost": "You can spend {{INVITATION_PRICE}} <PowerIcon /> Power to generate an invitation code for your friends.",
|
||||
"invitation.getCodeMessage": "You can get an invitation code through the following methods:",
|
||||
@@ -288,15 +310,20 @@
|
||||
"lists.feeds.title": "Title",
|
||||
"lists.image": "Image",
|
||||
"lists.info": "Lists are collections of feeds that you can share or sell for others to subscribe to. Subscribers will synchronize and access all feeds in the list.",
|
||||
"lists.manage_list": "Manage List",
|
||||
"lists.noLists": "No lists",
|
||||
"lists.select_feeds": "Select feeds to add to the current list",
|
||||
"lists.submit": "Submit",
|
||||
"lists.subscriptions": "Subs",
|
||||
"lists.title": "Title",
|
||||
"lists.view": "View",
|
||||
"privacy.terms": "Terms",
|
||||
"profile.avatar.label": "Avatar",
|
||||
"profile.change_password.label": "Change Password",
|
||||
"profile.confirm_password.label": "Confirm Password",
|
||||
"profile.current_password.label": "Current Password",
|
||||
"profile.danger_zone": "Danger Zone",
|
||||
"profile.delete_account.label": "Delete Account",
|
||||
"profile.email.change": "Change Email",
|
||||
"profile.email.changed": "Email changed.",
|
||||
"profile.email.changed_verification_sent": "Email to verify the new email has been sent.",
|
||||
@@ -317,6 +344,7 @@
|
||||
"profile.no_password": "<Link>Reset</Link> your password to set a new one.",
|
||||
"profile.password.label": "Password",
|
||||
"profile.reset_password_mail_sent": "Reset password mail sent.",
|
||||
"profile.security": "Security",
|
||||
"profile.sidebar_title": "Profile",
|
||||
"profile.submit": "Submit",
|
||||
"profile.title": "Profile Settings",
|
||||
|
||||
@@ -237,10 +237,12 @@
|
||||
"invitation.confirmModal.continue": "继续",
|
||||
"invitation.confirmModal.message": "生成邀请码将花费 {{INVITATION_PRICE}} <PowerIcon>Power</PowerIcon>。",
|
||||
"invitation.confirmModal.title": "确认",
|
||||
"invitation.created_at": "创建于",
|
||||
"invitation.earlyAccess": "Folo 目前处于<strong>早期开发</strong>状态,需要邀请码才能使用。",
|
||||
"invitation.earlyAccessMessage": "😰 抱歉,Folo 目前处于抢先体验阶段,需要邀请码才能使用。",
|
||||
"invitation.generate": "生成",
|
||||
"invitation.generateButton": "生成邀请码",
|
||||
"invitation.generateCost": "你可以花费 {{INVITATION_PRICE}} <PowerIcon>Power</PowerIcon> 为你的朋友生成邀请码。",
|
||||
"invitation.generateCost": "你可以花费 {{INVITATION_PRICE}} <PowerIcon /> Power 为你的朋友生成邀请码。",
|
||||
"invitation.getCodeMessage": "通过以下方式获取邀请码:",
|
||||
"invitation.limitationMessage": "根据你的使用时间,你可以生成最多 {{limitation}} 个邀请码。",
|
||||
"invitation.newInvitationSuccess": "🎉 邀请码已生成,已复制到剪贴板",
|
||||
|
||||
+15
-39
@@ -1,45 +1,20 @@
|
||||
import fs from "node:fs"
|
||||
import path from "node:path"
|
||||
|
||||
const sourceDir = "./locales/app"
|
||||
const sourceDir = "./locales/common"
|
||||
const targetDir = "./locales/common"
|
||||
const keysToCopy: string[] = [
|
||||
"feed_view_type.articles",
|
||||
"feed_view_type.audios",
|
||||
"feed_view_type.notifications",
|
||||
"feed_view_type.pictures",
|
||||
"feed_view_type.social_media",
|
||||
"feed_view_type.videos",
|
||||
// kept the duplicate keys in locales/app
|
||||
"words.starred",
|
||||
"words.inbox",
|
||||
"words.feeds",
|
||||
"words.lists",
|
||||
"words.search",
|
||||
"discover.category.all",
|
||||
"discover.category.anime",
|
||||
"discover.category.bbs",
|
||||
"discover.category.blog",
|
||||
"discover.category.design",
|
||||
"discover.category.finance",
|
||||
"discover.category.forecast",
|
||||
"discover.category.game",
|
||||
"discover.category.government",
|
||||
"discover.category.journal",
|
||||
"discover.category.live",
|
||||
"discover.category.multimedia",
|
||||
"discover.category.new-media",
|
||||
"discover.category.picture",
|
||||
"discover.category.program-update",
|
||||
"discover.category.programming",
|
||||
"discover.category.reading",
|
||||
"discover.category.shopping",
|
||||
"discover.category.social-media",
|
||||
"discover.category.study",
|
||||
"discover.category.traditional-media",
|
||||
"discover.category.travel",
|
||||
"discover.category.university",
|
||||
// // kept the duplicate keys in locales/app
|
||||
// "words.starred",
|
||||
// "words.inbox",
|
||||
// "words.feeds",
|
||||
// "words.lists",
|
||||
// "words.search",
|
||||
"cancel",
|
||||
"close",
|
||||
"confirm",
|
||||
]
|
||||
const keysToPlace = ["words.cancel", "words.close", "words.confirm"]
|
||||
|
||||
const copyTranslations = (sourceDir: string, targetDir: string) => {
|
||||
const sourceFiles = fs.readdirSync(sourceDir)
|
||||
@@ -57,9 +32,10 @@ const copyTranslations = (sourceDir: string, targetDir: string) => {
|
||||
? JSON.parse(fs.readFileSync(targetFilePath, "utf-8"))
|
||||
: {}
|
||||
|
||||
keysToCopy.forEach((key) => {
|
||||
if (sourceContent[key] && !targetContent[key]) {
|
||||
targetContent[key] = sourceContent[key]
|
||||
keysToCopy.forEach((key, index) => {
|
||||
const targetKey = keysToPlace[index] ?? key
|
||||
if (sourceContent[key] && !targetContent[targetKey]) {
|
||||
targetContent[targetKey] = sourceContent[key]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user