diff --git a/src/components/PluginSettings/ContributorModal.tsx b/src/components/PluginSettings/ContributorModal.tsx
index 022160c2e..2ab897d06 100644
--- a/src/components/PluginSettings/ContributorModal.tsx
+++ b/src/components/PluginSettings/ContributorModal.tsx
@@ -108,9 +108,11 @@ function ContributorModal({ user }: { user: User; }) {
-
-
-
+
+
+
+
+
{!!plugins.length && (
diff --git a/src/plugins/_core/translation.ts b/src/plugins/_core/translation.ts
new file mode 100644
index 000000000..aeb6cb547
--- /dev/null
+++ b/src/plugins/_core/translation.ts
@@ -0,0 +1,27 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2024 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import { Devs } from "@utils/constants";
+import { setLocale } from "@utils/translation";
+import definePlugin from "@utils/types";
+import { i18n } from "@webpack/common";
+
+export default definePlugin({
+ name: "Translation",
+ required: true,
+ description: "Assists with translating Vencord",
+ authors: [Devs.lewisakura],
+
+ flux: {
+ USER_SETTINGS_PROTO_UPDATE({ settings }) {
+ setLocale(settings.proto.localization.locale.value);
+ }
+ },
+
+ start() {
+ setLocale(i18n.getLocale());
+ }
+});
diff --git a/src/utils/translation.tsx b/src/utils/translation.tsx
index 14ea8657f..6da989bea 100644
--- a/src/utils/translation.tsx
+++ b/src/utils/translation.tsx
@@ -5,28 +5,31 @@
*/
import { negotiateLanguages } from "@fluent/langneg";
-import { FluxDispatcher, i18n, React } from "@webpack/common";
+import { React } from "@webpack/common";
import translations from "~translations";
+import { localStorage } from "./localStorage";
import { Logger } from "./Logger";
const logger = new Logger("Translations", "#7bc876");
let loadedLocale: Record;
-let lastDiscordLocale = i18n.getLocale();
+let lastDiscordLocale: string = localStorage.getItem("vcLocale")!;
let bestLocale: string;
-FluxDispatcher.subscribe("USER_SETTINGS_PROTO_UPDATE", ({ settings }) => {
- if (settings.proto.localization.locale.value !== lastDiscordLocale) {
- lastDiscordLocale = settings.proto.localization.locale.value;
+export function setLocale(locale: string) {
+ if (locale === lastDiscordLocale) return;
- reloadLocale();
- }
-});
+ localStorage.setItem("vcLocale", locale);
-reloadLocale();
+ lastDiscordLocale = locale;
+
+ reloadLocale();
+}
+
+if (lastDiscordLocale) reloadLocale();
function reloadLocale() {
// finds the best locale based on the available ones
diff --git a/translations/de/vencord.json b/translations/de/vencord.json
index e0eb9c77a..da9941495 100644
--- a/translations/de/vencord.json
+++ b/translations/de/vencord.json
@@ -1,3 +1,13 @@
{
- "hello": "Hallo {name}!"
+ "components": {
+ "pluginSettings": {
+ "contributorModal": {
+ "contributed": {
+ "zero": "Diese Person hat keine Plugins erstellt. Sie haben wahrscheinlich auf andere Weise <0>zu Vencord beigetragen0>!",
+ "one": "Diese Person hat zu einem Plugin <0>beigetragen0>!",
+ "other": "Diese Person hat zu {count} Plugins <0>beigetragen0>!"
+ }
+ }
+ }
+ }
}