diff --git a/i18n/en/translation.json b/i18n/en/translation.json index b51c4dd25..f9cdbfd6f 100644 --- a/i18n/en/translation.json +++ b/i18n/en/translation.json @@ -1,8 +1,8 @@ { - "description": "Assists with translating Vencord", + "description": "Assists with translating Equicord", "settings": { "forceLocale": { - "description": "Force a different locale for Vencord to use", + "description": "Force a different locale for Equicord to use", "followDiscord": "Default (follow Discord)" }, "showMissingKeys": "If the current locale is missing translations, show the keys instead of falling back to English" diff --git a/i18n/en/vencord.json b/i18n/en/vencord.json index 57bc72cb9..86c4981f6 100644 --- a/i18n/en/vencord.json +++ b/i18n/en/vencord.json @@ -1,4 +1,22 @@ { + "donate": "Donate", + "invite": "Invite", + "loading": "Loading...", + "logs": { + "cancel": "Cancel", + "clearLog": "Clear Log", + "clearLogConfirmation": "Are you sure you would like to clear this log? This can't be undone.", + "logCleared": "Log has been cleared", + "clearLogs": "Clear Logs", + "clearLogsConfirmation": "Are you sure you would like to clear these logs? This can't be undone.", + "logsCleared": "Selected logs have been cleared", + "hideLogs": "Hide Logs", + "showLogs": "Show Logs", + "clearAllLogs": "Clear All Logs", + "clearAll": "Clear All", + "clearAllLogsConfirmation": "Are you sure you would like to clear all logs? This can't be undone.", + "allLogsCleared": "All logs have been cleared" + }, "addonCard": { "new": "NEW" }, @@ -18,8 +36,6 @@ "subtitle": "Thank you for contributing!", "title": "Contributions" }, - "donate": "Donate", - "invite": "Invite", "donorCard": { "donated": { "vencordDescription": "All Vencord users can see your badge! You can manage your perks by messaging @{v}.", @@ -68,13 +84,74 @@ "plugins_one": "This person has <0>contributed to {count} plugin!", "plugins_other": "This person has <0>contributed to {count} plugins!" } - } + }, + "requiredToFunction": "This plugin is required for Equicord to function", + "pluginRequiredBy": "This plugin is required by: {pluginNames}", + "noDescription": "No description available", + }, + "changelog": { + "manager": { + "minutes_one": "{count} minute ago", + "minutes_other": "{count} minutes ago", + "hours_one": "{count} hour ago", + "hours_other": "{count} hours ago", + "days_one": "{count} day ago", + "days_other": "{count} days ago" + }, + "updateCard": { + "upToDate": "Repository check: {fromHash} (up to date)", + "outOfDate": "Repository check: {fromHash} → {toHash}", + "update": "Update: {fromHash} → {toHash}", + "commits_zero": " • No new commits", + "commits_one": " • {count} commit available", + "commits_other": " • {count} commits available", + "newPluginsCount": " • {plugins} new plugins", + "updatedPluginsCount": " • {plugins} updated plugins", + "newSettingsCount": " • {settings} new settings", + "updatedPlugins": "Updated Plugins", + "newSettings": "New Settings", + "newSettingInPlugin": "New setting in {pluginName}" + }, + "newPluginsSection": { + "newPluginsCount": "New Plugins ({count})", + "recentlyAddedPlugins": "The following plugins have been added in recent updates:", + "numMorePlugins_one": "+{count} more plugin", + "numMorePlugins_other": "+{count} more plugins" + }, + "missingRepoInfo": "Failed to retrieve repository information", + "alreadyUpToDate": "Already up todate with repository", + "foundCommits_zero": "No new commits", + "foundCommits_one": "Found {count} commit from repository", + "foundCommits_other": "Found {count} commits from repository", + "loggedCommits": "Logged commits from your latest update", + "upToDateLocalCopy": "Repository is up to date with your local copy", + "failedToFetchRepo": "Failed to fetch from repository", + "checkYourConnection": "Failed to connect to repository. Check your internet connection", + "failedtoFetchCommits": "Could not fetch commits from repository", + "repository": "Repository", + "viewRecentChanges": "View the most recent changes to Equicord. This fetches commits directly from the repository to show you what's new", + "failedToRetrieve": "Failed to retrieve - check console", + "upToDate": "Repository Up To Date", + "fetchRepo": "Fetch from Repository", + "checkYourInternet": "Make sure you have an internet connection and try again", + "recentChanges": "Recent Changes", + "updatedPluginsCount": "Updated Plugins ({plugins})", + "codeChanges_zero": "No Code Changes", + "codeChanges_one": "Code Changes ({count} commit)", + "codeChanges_other": "Code Changes ({count} commits)", + "emptyChangelog": "No commits available ahead of your current version. Click \"Fetch from Repository\" to check for new changes", + "updateLogs_zero": "No Update Logs", + "updateLogs_one": "Update Logs ({count} log)", + "updateLogs_other": "Update Logs ({count} logs)", + "previousSessions": "Previous update sessions with their commit history and plugin changes", + "title": "Changelog" }, "restartRequired": { "body": "A restart is required to apply this change", "cancel": "Later!", "confirm": "Restart now", - "title": "Restart Required" + "title": "Restart Required", + "plugins": "The following plugins require a restart:" }, "title": "Settings", "transparent": { diff --git a/src/components/settings/tabs/changelog/NewPluginsSection.tsx b/src/components/settings/tabs/changelog/NewPluginsSection.tsx index 8d0b42af0..129251db7 100644 --- a/src/components/settings/tabs/changelog/NewPluginsSection.tsx +++ b/src/components/settings/tabs/changelog/NewPluginsSection.tsx @@ -13,6 +13,7 @@ import { PluginCard } from "@components/settings/tabs/plugins/PluginCard"; import { ChangeList } from "@utils/ChangeList"; import { Margins } from "@utils/margins"; import { useForceUpdater } from "@utils/react"; +import { t } from "@utils/translation"; import { Button, React, Tooltip } from "@webpack/common"; import Plugins from "~plugins"; @@ -78,11 +79,11 @@ export function NewPluginsSection({ return (
- New Plugins ({sortedPlugins.length}) + {t("vencord.settings.changelog.newPluginsSection.newPluginsCount", { count: sortedPlugins.length })} - The following plugins have been added in recent updates: + {t("vencord.settings.changelog.newPluginsSection.recentlyAddedPlugins")}
@@ -94,7 +95,7 @@ export function NewPluginsSection({ ) || plugin.name.endsWith("API"); const tooltipText = plugin.required - ? "This plugin is required for Equicord to function." + ? t("vencord.settings.plugins.requiredToFunction") : makeDependencyList( depMap[plugin.name]?.filter( d => settings.plugins[d].enabled, @@ -152,7 +153,7 @@ export function NewPluginsSection({ - The following plugins require a restart: + {t("vencord.settings.restartRequired.plugins")}
    {changes.map(p => ( @@ -170,7 +171,7 @@ export function NewPluginsSection({ onClick={() => location.reload()} className={Margins.top16} > - Restart Required + {t("vencord.settings.restartRequired.title")} )} @@ -202,11 +203,9 @@ function CompactPluginCard({ depMap[plugin.name]?.some(d => settings.plugins[d].enabled); const tooltipText = plugin.required - ? "This plugin is required for Equicord to function." + ? t("vencord.settings.plugins.requiredToFunction") : depMap[plugin.name]?.length > 0 - ? `This plugin is required by: ${depMap[plugin.name] - ?.filter(d => settings.plugins[d].enabled) - .join(", ")}` + ? t("vencord.settings.plugins.pluginRequiredBy", { pluginNames: depMap[plugin.name]?.filter(d => settings.plugins[d].enabled).join(", ") }) : null; return ( @@ -221,7 +220,7 @@ function CompactPluginCard({
- {plugin.description || "No description available"} + {plugin.description || t("vencord.settings.plugins.noDescription")}
{tooltipText && (
{tooltipText}
@@ -272,7 +271,7 @@ export function NewPluginsCompact({ {hasMore && (
- +{newPlugins.length - maxDisplay} more plugins + {t("vencord.settings.changelog.newPluginsSection.numMorePlugins", { count: newPlugins.length - maxDisplay })}
)} diff --git a/src/components/settings/tabs/changelog/changelogManager.ts b/src/components/settings/tabs/changelog/changelogManager.ts index c7ea9730c..216722979 100644 --- a/src/components/settings/tabs/changelog/changelogManager.ts +++ b/src/components/settings/tabs/changelog/changelogManager.ts @@ -5,6 +5,7 @@ */ import { DataStore } from "@api/index"; +import { t } from "@utils/translation"; import gitHash from "~git-hash"; import plugins from "~plugins"; @@ -479,11 +480,11 @@ export function formatTimestamp(timestamp: number): string { const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); if (diffMinutes < 60) { - return `${diffMinutes} minute${diffMinutes !== 1 ? "s" : ""} ago`; + return t("vencord.settings.changelog.manager.minutes", { count: diffMinutes }); } else if (diffHours < 24) { - return `${diffHours} hour${diffHours !== 1 ? "s" : ""} ago`; + return t("vencord.settings.changelog.manager.hours", { count: diffHours }); } else if (diffDays < 7) { - return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`; + return t("vencord.settings.changelog.manager.days", { count: diffDays }); } else { return date.toLocaleDateString(); } diff --git a/src/components/settings/tabs/changelog/index.tsx b/src/components/settings/tabs/changelog/index.tsx index f0c68b040..c107edd55 100644 --- a/src/components/settings/tabs/changelog/index.tsx +++ b/src/components/settings/tabs/changelog/index.tsx @@ -15,14 +15,13 @@ import { Link } from "@components/Link"; import { Paragraph } from "@components/Paragraph"; import { SettingsTab, wrapTab } from "@components/settings/tabs/BaseTab"; import { HashLink } from "@components/settings/tabs/updater/Components"; -import { gitHashShort } from "@shared/vencordUserAgent"; +import { gitHash, gitHashShort } from "@shared/vencordUserAgent"; import { Margins } from "@utils/margins"; import { useAwaiter } from "@utils/react"; +import { t } from "@utils/translation"; import { getRepo, UpdateLogger } from "@utils/updater"; import { Alerts, Button, React, Toasts } from "@webpack/common"; -import gitHash from "~git-hash"; - import { ChangelogEntry, ChangelogHistory, @@ -111,9 +110,10 @@ function UpdateLogCard({ {isRepositoryFetch ? isUpToDate - ? `Repository check: ${log.fromHash.slice(0, 7)} (up to date)` - : `Repository check: ${log.fromHash.slice(0, 7)} → ${log.toHash.slice(0, 7)}` - : `Update: ${log.fromHash.slice(0, 7)} → ${log.toHash.slice(0, 7)}`} + ? t("vencord.settings.changelog.updateCard.upToDate", { fromHash: log.fromHash.slice(0, 7) }) + : t("vencord.settings.changelog.updateCard.outOfDate", { fromHash: log.fromHash.slice(0, 7), toHash: log.toHash.slice(0, 7) }) + : t("vencord.settings.changelog.updateCard.update", { fromHash: log.fromHash.slice(0, 7), toHash: log.toHash.slice(0, 7) }) + }
0 && (
- Updated Plugins + {t("vencord.settings.changelog.updateCard.updatedPlugins")} 0 && (
- New Settings + {t("vencord.settings.changelog.updateCard.newSettings")}
{getNewSettingsEntries(log.newSettings).map( @@ -194,7 +192,7 @@ function UpdateLogCard({ {pluginName}.{setting} @@ -226,7 +224,7 @@ function UpdateLogCard({ function ChangelogContent() { const [repo, repoErr, repoPending] = useAwaiter(getRepo, { - fallbackValue: "Loading...", + fallbackValue: t("vencord.loading"), }); const [changelog, setChangelog] = React.useState([]); const [changelogHistory, setChangelogHistory] = @@ -256,7 +254,7 @@ function ChangelogContent() { React.useEffect(() => { if (repoErr) { UpdateLogger.error("Failed to retrieve repo", repoErr); - setError("Failed to retrieve repository information"); + setError(t("vencord.settings.changelog.missingRepoInfo")); } }, [repoErr]); @@ -354,7 +352,7 @@ function ChangelogContent() { if (!logged) { setChangelog([]); Toasts.show({ - message: "Already up to date with repository", + message: t("vencord.settings.changelog.alreadyUpToDate"), id: Toasts.genId(), type: Toasts.Type.MESSAGE, options: { @@ -386,7 +384,7 @@ function ChangelogContent() { setRecentlyChecked(true); Toasts.show({ - message: `Found ${updates.value.length} commit${updates.value.length === 1 ? "" : "s"} from repository`, + message: t("vencord.settings.changelog.foundCommits", { count: updates.value.length }), id: Toasts.genId(), type: Toasts.Type.SUCCESS, options: { @@ -398,8 +396,8 @@ function ChangelogContent() { setRecentlyChecked(true); Toasts.show({ message: logged - ? "Logged commits from your latest update" - : "Repository is up to date with your local copy", + ? t("vencord.settings.changelog.loggedCommits") + : t("vencord.settings.changelog.upToDateLocalCopy"), id: Toasts.genId(), type: logged ? Toasts.Type.SUCCESS : Toasts.Type.MESSAGE, options: { @@ -412,19 +410,19 @@ function ChangelogContent() { } } else if (!updates.ok) { throw new Error( - updates.error?.message || "Failed to fetch from repository", + updates.error?.message || t("vencord.settings.changelog.missingRepoInfo"), ); } } catch (err: any) { UpdateLogger.error("Failed to fetch commits from repository", err); const errorMessage = err?.message || - "Failed to connect to repository. Check your internet connection."; + t("vencord.settings.changelog.checkYourConnection"); setError(errorMessage); // funny little error toast hopefully doesn't happen! Toasts.show({ - message: "Could not fetch commits from repository", + message: t("vencord.settings.changelog.failedtoFetchCommits"), id: Toasts.genId(), type: Toasts.Type.FAILURE, options: { @@ -479,16 +477,15 @@ function ChangelogContent() { return ( <> - View the most recent changes to Equicord. This fetches commits - directly from the repository to show you what's new. + {t("vencord.settings.changelog.viewRecentChanges")} - Repository + {t("vencord.settings.changelog.repository")} {repoPending ? ( repo ) : repoErr ? ( - "Failed to retrieve - check console" + t("vencord.settings.changelog.failedToRetrieve") ) : ( {repo.split("/").slice(-2).join("/")} @@ -513,10 +510,11 @@ function ChangelogContent() { } > {isLoading - ? "Loading..." + ? t("vencord.loading") : recentlyChecked - ? "Repository Up to Date" - : "Fetch from Repository"} + ? t("vencord.settings.changelog.upToDate") + : t("vencord.settings.changelog.fetchRepo") + } {changelogHistory.length > 0 && ( @@ -531,25 +529,24 @@ function ChangelogContent() { onClick={() => setShowHistory(!showHistory)} style={{ marginLeft: "8px" }} > - {showHistory ? "Hide Logs" : "Show Logs"} + {showHistory ? t("vencord.logs.hideLogs") : t("vencord.logs.showLogs")} )} @@ -577,7 +574,7 @@ function ChangelogContent() { color: "var(--text-muted)", }} > - Make sure you have an internet connection and try again. + {t("vencord.settings.changelog.checkYourInternet")} )} @@ -588,7 +585,7 @@ function ChangelogContent() { {hasCurrentChanges ? (
- Recent Changes + {t("vencord.settings.changelog.recentChanges")} {/* New Plugins Section */} @@ -607,7 +604,7 @@ function ChangelogContent() { {updatedPlugins.length > 0 && (
- Updated Plugins ({updatedPlugins.length}) + {t("vencord.settings.changelog.updatedPluginsCount", { plugins: updatedPlugins.length })}
@@ -617,8 +614,7 @@ function ChangelogContent() { {changelog.length > 0 && (
- Code Changes ({changelog.length}{" "} - {changelog.length === 1 ? "commit" : "commits"}) + {t("vencord.settings.changelog.codeChanges", { count: changelog.length })}
{changelog.map(entry => ( @@ -638,9 +634,7 @@ function ChangelogContent() { !error && ( - No commits available ahead of your current version. - Click "Fetch from Repository" to check for new - changes. + {t("vencord.settings.changelog.emptyChangelog")} ) @@ -654,12 +648,10 @@ function ChangelogContent() { style={{ marginBottom: "1em" }} /> - Update Logs ({changelogHistory.length}{" "} - {changelogHistory.length === 1 ? "log" : "logs"}) + {t("vencord.settings.changelog.updateLogs", { count: changelogHistory.length })} - Previous update sessions with their commit history and - plugin changes. + {t("vencord.settings.changelog.previousSessions")}
@@ -673,11 +665,11 @@ function ChangelogContent() { onToggleExpand={() => toggleLogExpanded(log.id)} onClearLog={logId => { Alerts.show({ - title: "Clear Log", - body: "Are you sure you would like to clear this log? This can't be undone.", - confirmText: "Clear Log", + title: t("vencord.logs.clearLog"), + body: t("vencord.logs.clearLogConfirmation"), + confirmText: t("vencord.logs.clearLog"), confirmColor: "danger", - cancelText: "Cancel", + cancelText: t("vencord.logs.cancel"), onConfirm: async () => { await clearIndividualLog(logId); await loadChangelogHistory(); @@ -691,7 +683,7 @@ function ChangelogContent() { ), ); Toasts.show({ - message: "Log has been cleared", + message: t("vencord.logs.logCleared"), id: Toasts.genId(), type: Toasts.Type.SUCCESS, options: { @@ -713,10 +705,10 @@ function ChangelogContent() { function ChangelogTab() { return ( - + ); } -export default wrapTab(ChangelogTab, "Changelog"); +export default wrapTab(ChangelogTab, t("vencord.settings.changelog.title")); diff --git a/src/components/settings/tabs/plugins/ContributorModal.tsx b/src/components/settings/tabs/plugins/ContributorModal.tsx index dfa5ce347..bba9f240d 100644 --- a/src/components/settings/tabs/plugins/ContributorModal.tsx +++ b/src/components/settings/tabs/plugins/ContributorModal.tsx @@ -11,6 +11,7 @@ import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { HeadingPrimary } from "@components/Heading"; import { Link } from "@components/Link"; +import { Paragraph } from "@components/Paragraph"; import { EquicordDevsById, VencordDevsById } from "@utils/constants"; import { fetchUserProfile } from "@utils/discord"; import { classes } from "@utils/misc"; @@ -94,16 +95,20 @@ function ContributorModal({ user }: { user: User; }) {
{plugins.length ? ( - - This person has {ContributedHyperLink} to some plugins! - + + + This person has {ContributedHyperLink} to some plugins! + + ) : ( - - This person has not made any plugins. They likely {ContributedHyperLink} - to Vencord in other ways! - + + + This person has not made any plugins. They likely {ContributedHyperLink} + to Equicord in other ways! + + )} {!!plugins.length && ( diff --git a/src/components/settings/tabs/vencord/index.tsx b/src/components/settings/tabs/vencord/index.tsx index 6d000cd3b..886ea9673 100644 --- a/src/components/settings/tabs/vencord/index.tsx +++ b/src/components/settings/tabs/vencord/index.tsx @@ -334,11 +334,14 @@ function DonateButtonComponent() { + style={{ marginTop: "1em" }} + link="https://github.com/sponsors/thororen1234" + /> + style={{ marginTop: "1em" }} + /> ); }