t (#526)
This commit is contained in:
parent
cbac8d4349
commit
0b23e7c802
6 changed files with 28 additions and 25 deletions
|
|
@ -59,7 +59,7 @@ async function syncSettings() {
|
|||
if (Settings.cloud.authenticated) {
|
||||
// User switched to an account that isn't connected to cloud
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Cloud sync was disabled because this account isn't connected to the cloud App. You can enable it again by connecting this account in Cloud Settings. (note: it will store your preferences separately)",
|
||||
color: "var(--yellow-360)",
|
||||
onClick: () => SettingsRouter.open("VencordCloud")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { showNotification } from "@api/Notifications";
|
|||
import { PlainSettings, Settings } from "@api/Settings";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { relaunch } from "@utils/native";
|
||||
import { t } from "@utils/translation";
|
||||
import { SettingsRouter } from "@webpack/common";
|
||||
import { deflateSync, inflateSync } from "fflate";
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ export async function putCloudSettings(manual?: boolean) {
|
|||
if (!res.ok) {
|
||||
logger.error(`Failed to sync up, API returned ${res.status}`);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not synchronize settings to cloud (API returned ${res.status}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -47,7 +48,7 @@ export async function putCloudSettings(manual?: boolean) {
|
|||
|
||||
if (manual) {
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Synchronized settings to the cloud!",
|
||||
noPersist: true,
|
||||
});
|
||||
|
|
@ -55,7 +56,7 @@ export async function putCloudSettings(manual?: boolean) {
|
|||
} catch (e: any) {
|
||||
logger.error("Failed to sync up", e);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not synchronize settings to the cloud (${e.toString()}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -76,7 +77,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
if (res.status === 401) {
|
||||
// User switched to an account that isn't connected to cloud
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Cloud sync was disabled because this account isn't connected to the cloud App. You can enable it again by connecting this account in Cloud Settings. (note: it will store your preferences separately)",
|
||||
color: "var(--yellow-360)",
|
||||
onClick: () => SettingsRouter.open("VencordCloud")
|
||||
|
|
@ -90,7 +91,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
logger.info("No settings on the cloud");
|
||||
if (shouldNotify)
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "There are no settings in the cloud.",
|
||||
noPersist: true
|
||||
});
|
||||
|
|
@ -101,7 +102,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
logger.info("Settings up to date");
|
||||
if (shouldNotify)
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Your settings are up to date.",
|
||||
noPersist: true
|
||||
});
|
||||
|
|
@ -111,7 +112,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
if (!res.ok) {
|
||||
logger.error(`Failed to sync down, API returned ${res.status}`);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not synchronize settings from the cloud (API returned ${res.status}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -125,7 +126,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
if (!force && written < localWritten) {
|
||||
if (shouldNotify)
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Your local settings are newer than the cloud ones.",
|
||||
noPersist: true,
|
||||
});
|
||||
|
|
@ -144,7 +145,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
logger.info("Settings loaded from cloud successfully");
|
||||
if (shouldNotify)
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Your settings have been updated! Click here to restart to fully apply changes!",
|
||||
color: "var(--green-360)",
|
||||
onClick: IS_WEB ? () => location.reload() : relaunch,
|
||||
|
|
@ -155,7 +156,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {
|
|||
} catch (e: any) {
|
||||
logger.error("Failed to sync down", e);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not synchronize settings from the cloud (${e.toString()}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -174,7 +175,7 @@ export async function deleteCloudSettings() {
|
|||
if (!res.ok) {
|
||||
logger.error(`Failed to delete, API returned ${res.status}`);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not delete settings (API returned ${res.status}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -183,14 +184,14 @@ export async function deleteCloudSettings() {
|
|||
|
||||
logger.info("Settings deleted from cloud successfully");
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: "Settings deleted from cloud!",
|
||||
color: "var(--green-360)"
|
||||
});
|
||||
} catch (e: any) {
|
||||
logger.error("Failed to delete", e);
|
||||
showNotification({
|
||||
title: "Cloud Settings",
|
||||
title: t("vencord.cloud.settings.header"),
|
||||
body: `Could not delete settings (${e.toString()}).`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -206,7 +207,7 @@ export async function eraseAllCloudData() {
|
|||
if (!res.ok) {
|
||||
logger.error(`Failed to erase data, API returned ${res.status}`);
|
||||
showNotification({
|
||||
title: "Cloud Integrations",
|
||||
title: t("vencord.cloud.integrations.header"),
|
||||
body: `Could not erase all data (API returned ${res.status}), please contact support.`,
|
||||
color: "var(--red-360)"
|
||||
});
|
||||
|
|
@ -217,7 +218,7 @@ export async function eraseAllCloudData() {
|
|||
await deauthorizeCloud();
|
||||
|
||||
showNotification({
|
||||
title: "Cloud Integrations",
|
||||
title: t("vencord.cloud.integrations.header"),
|
||||
body: "Successfully erased all data.",
|
||||
color: "var(--green-360)"
|
||||
});
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ function ThemesTab() {
|
|||
Icon={RestartIcon}
|
||||
/>
|
||||
<QuickAction
|
||||
text="Edit QuickCSS"
|
||||
text={t("vencord.quickActions.editQuickCSS")}
|
||||
action={() => VencordNative.quickCss.openEditor()}
|
||||
Icon={PaintbrushIcon}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { classNameFactory } from "@api/Styles";
|
|||
import { BaseText } from "@components/BaseText";
|
||||
import { Switch } from "@components/settings";
|
||||
import { AddonBadge } from "@components/settings/PluginBadge";
|
||||
import { t } from "@utils/translation";
|
||||
import { useRef } from "@webpack/common";
|
||||
import type { MouseEventHandler, ReactNode } from "react";
|
||||
|
||||
|
|
@ -101,7 +102,7 @@ export function OnlineThemeCard({
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
{isNew && <AddonBadge text="NEW" color="#ED4245" />}
|
||||
{isNew && <AddonBadge text={t("vencord.addonCard.new")} color="#ED4245" />}
|
||||
</BaseText>
|
||||
|
||||
{!!author && (
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import { Logger } from "@utils/Logger";
|
|||
import { Margins } from "@utils/margins";
|
||||
import { classes } from "@utils/misc";
|
||||
import { useAwaiter, useIntersection } from "@utils/react";
|
||||
import { t } from "@utils/translation";
|
||||
import { Alerts, Button, lodash, Parser, React, Select, TextInput, Toasts, Tooltip, useMemo, useState } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
|
|
@ -153,7 +154,7 @@ export default function PluginSettings() {
|
|||
const remainingCount = allChanges.length - displayed.length;
|
||||
|
||||
Alerts.show({
|
||||
title: "Restart required",
|
||||
title: t("vencord.settings.restartRequired.title"),
|
||||
body: (
|
||||
<div>
|
||||
{displayed.map((s, i) => (
|
||||
|
|
@ -165,8 +166,8 @@ export default function PluginSettings() {
|
|||
{remainingCount > 0 && <span> and {remainingCount} more</span>}
|
||||
</div>
|
||||
),
|
||||
confirmText: "Restart now",
|
||||
cancelText: "Later!",
|
||||
confirmText: t("vencord.settings.restartRequired.confirm"),
|
||||
cancelText: t("vencord.settings.restartRequired.cancel"),
|
||||
onConfirm: () => location.reload()
|
||||
});
|
||||
};
|
||||
|
|
@ -325,15 +326,15 @@ export default function PluginSettings() {
|
|||
|
||||
if (restartNeeded) {
|
||||
Alerts.show({
|
||||
title: "Restart Required",
|
||||
title: t("vencord.settings.restartRequired.title"),
|
||||
body: (
|
||||
<>
|
||||
<p style={{ textAlign: "center" }}>Some plugins require a restart to fully disable.</p>
|
||||
<p style={{ textAlign: "center" }}>Would you like to restart now?</p>
|
||||
</>
|
||||
),
|
||||
confirmText: "Restart Now",
|
||||
cancelText: "Later",
|
||||
confirmText: t("vencord.settings.restartRequired.confirm"),
|
||||
cancelText: t("vencord.settings.restartRequired.cancel"),
|
||||
onConfirm: () => location.reload()
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ function EquicordSettings() {
|
|||
)}
|
||||
|
||||
<section>
|
||||
<Heading>Quick Actions</Heading>
|
||||
<Heading>{t("vencord.quickActions.title")}</Heading>
|
||||
|
||||
<QuickActionCard>
|
||||
<QuickAction
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue