mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 06:33:03 -04:00
Merge branch 'i18n' into dev
This commit is contained in:
commit
f414ba9381
38 changed files with 104 additions and 97 deletions
|
@ -15,7 +15,7 @@ interface ColorPickerProps {
|
||||||
showEyeDropper?: boolean;
|
showEyeDropper?: boolean;
|
||||||
onChange(value: number | null): void;
|
onChange(value: number | null): void;
|
||||||
}
|
}
|
||||||
const ColorPicker = findComponentByCodeLazy<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
|
const ColorPicker = findComponentByCodeLazy<ColorPickerProps>("#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}", ".BACKGROUND_PRIMARY)");
|
||||||
|
|
||||||
// TinyColor is completely unmangled and it's duplicated in two modules! Fun!
|
// TinyColor is completely unmangled and it's duplicated in two modules! Fun!
|
||||||
const TinyColor: tinycolor.Constructor = findByCodeLazy("this._gradientType=");
|
const TinyColor: tinycolor.Constructor = findByCodeLazy("this._gradientType=");
|
||||||
|
|
|
@ -74,10 +74,10 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Settings, sidebar
|
// Settings, sidebar
|
||||||
find: "Messages.BILLING_SETTINGS",
|
find: "#{intl::BILLING_SETTINGS}",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(?<=Messages.BILLING_SETTINGS,)/,
|
match: /(?<=#{intl::BILLING_SETTINGS}\),)/,
|
||||||
replace: "capitalism:true,"
|
replace: "capitalism:true,"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Emoji list
|
// Emoji list
|
||||||
find: "Messages.EMOJI_PICKER_CREATE_EMOJI_TITLE,size:",
|
find: "#{intl::EMOJI_PICKER_CREATE_EMOJI_TITLE}),size:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\i)=\i\|\|!\i&&\i.\i.isEmojiCategoryNitroLocked\(\{[^}]*\}\);/,
|
match: /(\i)=\i\|\|!\i&&\i.\i.isEmojiCategoryNitroLocked\(\{[^}]*\}\);/,
|
||||||
replace: "$&$1||"
|
replace: "$&$1||"
|
||||||
|
@ -108,7 +108,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Emoji category list
|
// Emoji category list
|
||||||
find: "Messages.EMOJI_CATEGORY_TOP_GUILD_EMOJI.format({",
|
find: "#{intl::EMOJI_CATEGORY_TOP_GUILD_EMOJI}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/,
|
match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/,
|
||||||
replace: "$2.isNitroLocked||"
|
replace: "$2.isNitroLocked||"
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default definePlugin({
|
||||||
settings,
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.GUILD_OWNER,",
|
find: "#{intl::GUILD_OWNER}),",
|
||||||
replacement:
|
replacement:
|
||||||
{
|
{
|
||||||
// We add the banner as a property while we can still access the user id
|
// We add the banner as a property while we can still access the user id
|
||||||
|
|
|
@ -8,8 +8,9 @@ import "./style.css";
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { Button, Forms, i18n, TextInput } from "@webpack/common";
|
import { Button, Forms, TextInput } from "@webpack/common";
|
||||||
|
|
||||||
function ReasonsComponent() {
|
function ReasonsComponent() {
|
||||||
const { reasons } = settings.use(["reasons"]);
|
const { reasons } = settings.use(["reasons"]);
|
||||||
|
@ -72,9 +73,9 @@ export default definePlugin({
|
||||||
authors: [Devs.Inbestigator],
|
authors: [Devs.Inbestigator],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Messages.BAN_MULTIPLE_CONFIRM_TITLE",
|
find: "#{intl::BAN_MULTIPLE_CONFIRM_TITLE}",
|
||||||
replacement: [{
|
replacement: [{
|
||||||
match: /\[\{name:\i\.\i\.Messages\.BAN_REASON_OPTION_SPAM_ACCOUNT.+?\}\]/,
|
match: /\[\{name:\i\.\i\.string\(\i\.\i#{intl::BAN_REASON_OPTION_SPAM_ACCOUNT}\).+?\}\]/,
|
||||||
replace: "$self.getReasons()"
|
replace: "$self.getReasons()"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -87,9 +88,9 @@ export default definePlugin({
|
||||||
const reasons = settings.store.reasons.length
|
const reasons = settings.store.reasons.length
|
||||||
? settings.store.reasons
|
? settings.store.reasons
|
||||||
: [
|
: [
|
||||||
i18n.Messages.BAN_REASON_OPTION_SPAM_ACCOUNT,
|
getIntlMessage("BAN_REASON_OPTION_SPAM_ACCOUNT"),
|
||||||
i18n.Messages.BAN_REASON_OPTION_HACKED_ACCOUNT,
|
getIntlMessage("BAN_REASON_OPTION_HACKED_ACCOUNT"),
|
||||||
i18n.Messages.BAN_REASON_OPTION_BREAKING_RULES
|
getIntlMessage("BAN_REASON_OPTION_BREAKING_RULES")
|
||||||
];
|
];
|
||||||
return reasons.map(s => ({ name: s, value: s }));
|
return reasons.map(s => ({ name: s, value: s }));
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,10 +37,10 @@ export default definePlugin({
|
||||||
authors: [EquicordDevs.iamme],
|
authors: [EquicordDevs.iamme],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.HUB_INVITE_ANOTHER_SCHOOL_LINK",
|
find: "#{intl::HUB_INVITE_ANOTHER_SCHOOL_LINK}",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /,(\i)&&(\(.{0,15}\i\.TooltipContainer.+)(\i\.\i\.Messages.GUEST_MEMBERSHIP_EXPLANATION)/,
|
match: /,(\i)&&(\(.{0,15}\i\.TooltipContainer.+)(\i\.\i\.string\(\i\.\i#{intl::GUEST_MEMBERSHIP_EXPLANATION}\))/,
|
||||||
replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)"
|
replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".ADD_REACTION_NAMED.format",
|
find: "#{intl::ADD_REACTION_NAMED}",
|
||||||
group: true,
|
group: true,
|
||||||
replacement: [
|
replacement: [
|
||||||
// Override limit of emojis to display with offset hook.
|
// Override limit of emojis to display with offset hook.
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default definePlugin({
|
||||||
description: "Reworks the user area styling to fit more buttons and overall look nicer",
|
description: "Reworks the user area styling to fit more buttons and overall look nicer",
|
||||||
authors: [Devs.Samwich],
|
authors: [Devs.Samwich],
|
||||||
patches: [{
|
patches: [{
|
||||||
find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",
|
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
|
||||||
replacement:
|
replacement:
|
||||||
[
|
[
|
||||||
// add a custom class to make things easier
|
// add a custom class to make things easier
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
import { closeModal, openModal } from "@utils/modal";
|
import { closeModal, openModal } from "@utils/modal";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import { Avatar, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, i18n, Menu, ReadStateStore, ReadStateUtils, Text, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore } from "@webpack/common";
|
import { Avatar, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, Menu, ReadStateStore, ReadStateUtils, Text, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, CircleQuestionIcon, isBookmarkFolder, settings, switchChannel, useBookmarks } from "../util";
|
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, CircleQuestionIcon, isBookmarkFolder, settings, switchChannel, useBookmarks } from "../util";
|
||||||
import { NotificationDot } from "./ChannelTab";
|
import { NotificationDot } from "./ChannelTab";
|
||||||
|
@ -108,7 +109,7 @@ function BookmarkFolderOpenMenu(props: BookmarkProps) {
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
key="mark-as-read"
|
key="mark-as-read"
|
||||||
id="mark-as-read"
|
id="mark-as-read"
|
||||||
label={i18n.Messages.MARK_AS_READ}
|
label={getIntlMessage("MARK_AS_READ")}
|
||||||
disabled={!ReadStateStore.hasUnread(b.channelId)}
|
disabled={!ReadStateStore.hasUnread(b.channelId)}
|
||||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(b.channelId))}
|
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(b.channelId))}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import { getUniqueUsername } from "@utils/discord";
|
import { getIntlMessage, getUniqueUsername } from "@utils/discord";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||||
import { Avatar, ChannelStore, ContextMenuApi, Dots, GuildStore, i18n, PresenceStore, ReadStateStore, Text, TypingStore, useDrag, useDrop, useRef, UserStore, useStateFromStores } from "@webpack/common";
|
import { Avatar, ChannelStore, ContextMenuApi, Dots, GuildStore, PresenceStore, ReadStateStore, Text, TypingStore, useDrag, useDrop, useRef, UserStore, useStateFromStores } from "@webpack/common";
|
||||||
import { Channel, Guild, User } from "discord-types/general";
|
import { Channel, Guild, User } from "discord-types/general";
|
||||||
|
|
||||||
import { ChannelTabsProps, CircleQuestionIcon, closeTab, isTabSelected, moveDraggedTabs, moveToTab, openedTabs, settings } from "../util";
|
import { ChannelTabsProps, CircleQuestionIcon, closeTab, isTabSelected, moveDraggedTabs, moveToTab, openedTabs, settings } from "../util";
|
||||||
|
@ -113,22 +113,22 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
else {
|
else {
|
||||||
let name = `${i18n.Messages.UNKNOWN_CHANNEL} (${channelId})`;
|
let name = `${getIntlMessage("UNKNOWN_CHANNEL")} (${channelId})`;
|
||||||
switch (channelId) {
|
switch (channelId) {
|
||||||
case "customize-community":
|
case "customize-community":
|
||||||
name = i18n.Messages.CHANNELS_AND_ROLES;
|
name = getIntlMessage("CHANNELS_AND_ROLES");
|
||||||
break;
|
break;
|
||||||
case "channel-browser":
|
case "channel-browser":
|
||||||
name = i18n.Messages.GUILD_SIDEBAR_CHANNEL_BROWSER;
|
name = getIntlMessage("GUILD_SIDEBAR_CHANNEL_BROWSER");
|
||||||
break;
|
break;
|
||||||
case "shop":
|
case "shop":
|
||||||
name = i18n.Messages.GUILD_SHOP_CHANNEL_LABEL;
|
name = getIntlMessage("GUILD_SHOP_CHANNEL_LABEL");
|
||||||
break;
|
break;
|
||||||
case "member-safety":
|
case "member-safety":
|
||||||
name = i18n.Messages.MEMBER_SAFETY_CHANNEL_TITLE;
|
name = getIntlMessage("MEMBER_SAFETY_CHANNEL_TITLE");
|
||||||
break;
|
break;
|
||||||
case "@home":
|
case "@home":
|
||||||
name = i18n.Messages.SERVER_GUIDE;
|
name = getIntlMessage("SERVER_GUIDE");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -168,7 +168,7 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ChannelIcon channel={channel} />
|
<ChannelIcon channel={channel} />
|
||||||
{!compact && <Text className={cl("name-text")}>{channel?.name || i18n.Messages.GROUP_DM}</Text>}
|
{!compact && <Text className={cl("name-text")}>{channel?.name || getIntlMessage("GROUP_DM")}</Text>}
|
||||||
<NotificationDot channelIds={[channel.id]} />
|
<NotificationDot channelIds={[channel.id]} />
|
||||||
<TypingIndicator isTyping={isTyping} />
|
<TypingIndicator isTyping={isTyping} />
|
||||||
</>
|
</>
|
||||||
|
@ -180,14 +180,14 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FriendsIcon />
|
<FriendsIcon />
|
||||||
{!compact && <Text className={cl("name-text")}>{i18n.Messages.FRIENDS}</Text>}
|
{!compact && <Text className={cl("name-text")}>{getIntlMessage("FRIENDS")}</Text>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CircleQuestionIcon />
|
<CircleQuestionIcon />
|
||||||
{!compact && <Text className={cl("name-text")}>{i18n.Messages.UNKNOWN_CHANNEL}</Text>}
|
{!compact && <Text className={cl("name-text")}>{getIntlMessage("UNKNOWN_CHANNEL")}</Text>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { closeModal, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from "@utils/modal";
|
import { closeModal, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from "@utils/modal";
|
||||||
import { Button, ChannelStore, FluxDispatcher, Forms, i18n, Menu, ReadStateStore, ReadStateUtils, Select, Text, TextInput, useState } from "@webpack/common";
|
import { Button, ChannelStore, FluxDispatcher, Forms, Menu, ReadStateStore, ReadStateUtils, Select, Text, TextInput, useState } from "@webpack/common";
|
||||||
|
|
||||||
import { bookmarkFolderColors, bookmarkPlaceholderName, closeOtherTabs, closeTab, closeTabsToTheLeft, closeTabsToTheRight, createTab, hasClosedTabs, isBookmarkFolder, openedTabs, reopenClosedTab, settings, toggleCompactTab } from "../util";
|
import { bookmarkFolderColors, bookmarkPlaceholderName, closeOtherTabs, closeTab, closeTabsToTheLeft, closeTabsToTheRight, createTab, hasClosedTabs, isBookmarkFolder, openedTabs, reopenClosedTab, settings, toggleCompactTab } from "../util";
|
||||||
import { Bookmark, BookmarkFolder, Bookmarks, ChannelTabsProps, UseBookmarkMethods } from "../util/types";
|
import { Bookmark, BookmarkFolder, Bookmarks, ChannelTabsProps, UseBookmarkMethods } from "../util/types";
|
||||||
|
@ -177,7 +178,7 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
||||||
{bookmarkNotificationDot && !isFolder &&
|
{bookmarkNotificationDot && !isFolder &&
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id="mark-as-read"
|
id="mark-as-read"
|
||||||
label={i18n.Messages.MARK_AS_READ}
|
label={getIntlMessage("MARK_AS_READ")}
|
||||||
disabled={!ReadStateStore.hasUnread(bookmark.channelId)}
|
disabled={!ReadStateStore.hasUnread(bookmark.channelId)}
|
||||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(bookmark.channelId))}
|
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(bookmark.channelId))}
|
||||||
/>
|
/>
|
||||||
|
@ -287,7 +288,7 @@ export function TabContextMenu({ tab }: { tab: ChannelTabsProps; }) {
|
||||||
{channel &&
|
{channel &&
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id="mark-as-read"
|
id="mark-as-read"
|
||||||
label={i18n.Messages.MARK_AS_READ}
|
label={getIntlMessage("MARK_AS_READ")}
|
||||||
disabled={!ReadStateStore.hasUnread(channel.id)}
|
disabled={!ReadStateStore.hasUnread(channel.id)}
|
||||||
action={() => ReadStateUtils.ackChannel(channel)}
|
action={() => ReadStateUtils.ackChannel(channel)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -167,7 +167,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
// "1 blocked message"
|
// "1 blocked message"
|
||||||
{
|
{
|
||||||
find: "Messages.BLOCKED_MESSAGES_HIDE.format",
|
find: "#{intl::BLOCKED_MESSAGES_HIDE}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i.memo\(function\(\i\){/,
|
match: /\i.memo\(function\(\i\){/,
|
||||||
replace: "$&return null;"
|
replace: "$&return null;"
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default definePlugin({
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
patches: [{
|
patches: [{
|
||||||
find: "MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format",
|
find: "#{intl::MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL}",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(?<=\i=\i\?)\(0,\i\.\i\)\((\i),"LT"\):\(0,\i\.\i\)\(\i\)/,
|
match: /(?<=\i=\i\?)\(0,\i\.\i\)\((\i),"LT"\):\(0,\i\.\i\)\(\i\)/,
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL",
|
find: "#{intl::FORUM_POST_AUTHOR_A11Y_LABEL}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=\}=(\i),\{(user:\i,author:\i)\}=.{0,400}?\(\i\.Fragment,{children:)\i(?=}\),)/,
|
match: /(?<=\}=(\i),\{(user:\i,author:\i)\}=.{0,400}?\(\i\.Fragment,{children:)\i(?=}\),)/,
|
||||||
replace: "$self.wrapForumAuthor({...$1,$2},$&)"
|
replace: "$self.wrapForumAuthor({...$1,$2},$&)"
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default definePlugin({
|
||||||
generateSearchResults: generateSearchResults,
|
generateSearchResults: generateSearchResults,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".QUICKSWITCHER_PLACEHOLDER",
|
find: "#{intl::QUICKSWITCHER_PLACEHOLDER}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /let{selectedIndex:\i,results:\i}/,
|
match: /let{selectedIndex:\i,results:\i}/,
|
||||||
replace: "this.props.results = $self.generateSearchResults(this.state.query);$&"
|
replace: "this.props.results = $self.generateSearchResults(this.state.query);$&"
|
||||||
|
|
|
@ -212,7 +212,7 @@ export default definePlugin({
|
||||||
queryFriendTags: queryFriendTags,
|
queryFriendTags: queryFriendTags,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".QUICKSWITCHER_PLACEHOLDER",
|
find: "#{intl::QUICKSWITCHER_PLACEHOLDER}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /let{selectedIndex:\i,results:\i}/,
|
match: /let{selectedIndex:\i,results:\i}/,
|
||||||
replace: "if(this.state.query.includes(\"&\")){ this.props.results = $self.queryFriendTags(this.state.query); }$&"
|
replace: "if(this.state.query.includes(\"&\")){ this.props.results = $self.queryFriendTags(this.state.query); }$&"
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "UNKNOWN_ROLE_PLACEHOLDER]",
|
find: "#{intl::UNKNOWN_ROLE_PLACEHOLDER})]",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(hidePersonalInformation.*?)return/,
|
match: /(hidePersonalInformation.*?)return/,
|
||||||
replace: "$1return $self.patchChatboxMention(arguments[0]);"
|
replace: "$1return $self.patchChatboxMention(arguments[0]);"
|
||||||
|
|
|
@ -88,7 +88,7 @@ function CopyPresetComponent() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ColorPicker = findComponentByCodeLazy(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
|
const ColorPicker = findComponentByCodeLazy("#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}", ".BACKGROUND_PRIMARY)");
|
||||||
|
|
||||||
export function generateAndApplyProceduralTheme() {
|
export function generateAndApplyProceduralTheme() {
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default definePlugin({
|
||||||
find: '("guildsnav")',
|
find: '("guildsnav")',
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(?<=Messages\.SERVERS,children:.{0,300}?)(\i)(\)?\.map\(\i\))/,
|
match: /(?<=#{intl::SERVERS}\),children:.{0,300}?)(\i)(\)?\.map\(\i\))/,
|
||||||
replace: "$self.useFilteredGuilds($1)$2",
|
replace: "$self.useFilteredGuilds($1)$2",
|
||||||
},
|
},
|
||||||
// despite my best efforts, the above doesnt trigger a rerender
|
// despite my best efforts, the above doesnt trigger a rerender
|
||||||
|
@ -88,7 +88,7 @@ export default definePlugin({
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "QUICKSWITCHER_PROTIP.format",
|
find: "#{intl::QUICKSWITCHER_PROTIP}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=renderResults\(\){)let{query/,
|
match: /(?<=renderResults\(\){)let{query/,
|
||||||
replace: "this.props.results = $self.filteredGuildResults(this.props.results);$&",
|
replace: "this.props.results = $self.filteredGuildResults(this.props.results);$&",
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.DISCODO_DISABLED",
|
find: "#{intl::DISCODO_DISABLED}",
|
||||||
replacement:
|
replacement:
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,7 +140,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "DefaultCustomizationSections",
|
find: "DefaultCustomizationSections",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=USER_SETTINGS_AVATAR_DECORATION},"decoration"\),)/,
|
match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}\)},"decoration"\),)/,
|
||||||
replace: "$self.ResetCard(),"
|
replace: "$self.ResetCard(),"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default definePlugin({
|
||||||
authors: [Devs.D3SOX],
|
authors: [Devs.D3SOX],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Messages.NEW_TERMS_TITLE",
|
find: "#{intl::NEW_TERMS_TITLE}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /function (\i)\((\i)\)\{let\{transitionState:(\i)\}=(\i)/g,
|
match: /function (\i)\((\i)\)\{let\{transitionState:(\i)\}=(\i)/g,
|
||||||
replace: "function $1($2){return $self.closeModal($2);let{transitionState:$3}=$4"
|
replace: "function $1($2){return $self.closeModal($2);let{transitionState:$3}=$4"
|
||||||
|
|
|
@ -33,7 +33,7 @@ const recentMentionsPopoutClass = findByPropsLazy("recentMentionsPopout");
|
||||||
const tabClass = findByPropsLazy("inboxTitle", "tab");
|
const tabClass = findByPropsLazy("inboxTitle", "tab");
|
||||||
const buttonClass = findByPropsLazy("size36");
|
const buttonClass = findByPropsLazy("size36");
|
||||||
const MenuHeader = findByCodeLazy(".getUnseenInviteCount())");
|
const MenuHeader = findByCodeLazy(".getUnseenInviteCount())");
|
||||||
const Popout = findByCodeLazy(".Messages.UNBLOCK_TO_JUMP_TITLE", "canCloseAllMessages:");
|
const Popout = findByCodeLazy("#{intl::UNBLOCK_TO_JUMP_TITLE}", "canCloseAllMessages:");
|
||||||
const createMessageRecord = findByCodeLazy(".createFromServer(", ".isBlockedForMessage", "messageReference:");
|
const createMessageRecord = findByCodeLazy(".createFromServer(", ".isBlockedForMessage", "messageReference:");
|
||||||
const KEYWORD_ENTRIES_KEY = "KeywordNotify_keywordEntries";
|
const KEYWORD_ENTRIES_KEY = "KeywordNotify_keywordEntries";
|
||||||
const KEYWORD_LOG_KEY = "KeywordNotify_log";
|
const KEYWORD_LOG_KEY = "KeywordNotify_log";
|
||||||
|
@ -313,14 +313,14 @@ export default definePlugin({
|
||||||
settings,
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Messages.UNREADS_TAB_LABEL}",
|
find: "#{intl::UNREADS_TAB_LABEL}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\?\(0,\i\.jsxs\)\(\i\.TabBar\.Item/,
|
match: /\i\?\(0,\i\.jsxs\)\(\i\.TabBar\.Item/,
|
||||||
replace: "$self.keywordTabBar(),$&"
|
replace: "$self.keywordTabBar(),$&"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "location:\"RecentsPopout\"})",
|
find: "location:\"RecentsPopout\"});",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /:(\i)===\i\.\i\.MENTIONS\?\(0,.+?setTab:(\i),onJump:(\i),badgeState:\i,closePopout:(\i)/,
|
match: /:(\i)===\i\.\i\.MENTIONS\?\(0,.+?setTab:(\i),onJump:(\i),badgeState:\i,closePopout:(\i)/,
|
||||||
replace: ": $1 === 8 ? $self.tryKeywordMenu($2, $3, $4) $&"
|
replace: ": $1 === 8 ? $self.tryKeywordMenu($2, $3, $4) $&"
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { Button, Forms, i18n, Menu } from "@webpack/common";
|
import { Button, Forms, Menu } from "@webpack/common";
|
||||||
import { ReactElement } from "react";
|
import { ReactElement } from "react";
|
||||||
|
|
||||||
import { preload, unload } from "./images";
|
import { preload, unload } from "./images";
|
||||||
|
@ -33,7 +34,7 @@ export default definePlugin({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button size={Button.Sizes.SMALL} onClick={openQrModal}>
|
<Button size={Button.Sizes.SMALL} onClick={openQrModal}>
|
||||||
{i18n.Messages.USER_SETTINGS_SCAN_QR_CODE}
|
{getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -58,13 +59,13 @@ export default definePlugin({
|
||||||
replacement: {
|
replacement: {
|
||||||
// Find the Edit User Profile button and insert our custom button.
|
// Find the Edit User Profile button and insert our custom button.
|
||||||
// A bit jank, but whatever
|
// A bit jank, but whatever
|
||||||
match: /,(.{11}\.Button,.{58}\.USER_SETTINGS_EDIT_USER_PROFILE}\))/,
|
match: /,(.{0,20}\.Button,.{0,100}#{intl::USER_SETTINGS_EDIT_USER_PROFILE}\)}\))/,
|
||||||
replace: ",$self.insertScanQrButton($1)",
|
replace: ",$self.insertScanQrButton($1)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Insert a Scan QR Code MenuItem in the Swith Accounts popout
|
// Insert a Scan QR Code MenuItem in the Swith Accounts popout
|
||||||
{
|
{
|
||||||
find: ".SWITCH_ACCOUNTS_MANAGE_ACCOUNTS,",
|
find: 'id:"manage-accounts"',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(id:"manage-accounts",.*?)}\)\)(,\i)/,
|
match: /(id:"manage-accounts",.*?)}\)\)(,\i)/,
|
||||||
replace: "$1}),$self.ScanQrMenuItem)$2"
|
replace: "$1}),$self.ScanQrMenuItem)$2"
|
||||||
|
@ -94,21 +95,21 @@ export default definePlugin({
|
||||||
insertScanQrButton: (button: ReactElement) => (
|
insertScanQrButton: (button: ReactElement) => (
|
||||||
<div className={cl("settings-btns")}>
|
<div className={cl("settings-btns")}>
|
||||||
<Button size={Button.Sizes.SMALL} onClick={openQrModal}>
|
<Button size={Button.Sizes.SMALL} onClick={openQrModal}>
|
||||||
{i18n.Messages.USER_SETTINGS_SCAN_QR_CODE}
|
{getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")}
|
||||||
</Button>
|
</Button>
|
||||||
{button}
|
{button}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
get ScanQrMenuItem() {
|
get ScanQrMenuItem() {
|
||||||
return <Menu.MenuItem id="scan-qr" label={i18n.Messages.USER_SETTINGS_SCAN_QR_CODE} action={openQrModal} />;
|
return <Menu.MenuItem id="scan-qr" label={getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")} action={openQrModal} />;
|
||||||
},
|
},
|
||||||
get ScanQrSettingsSheet() {
|
get ScanQrSettingsSheet() {
|
||||||
return {
|
return {
|
||||||
section: i18n.Messages.USER_SETTINGS_SCAN_QR_CODE,
|
section: getIntlMessage("USER_SETTINGS_SCAN_QR_CODE"),
|
||||||
onClick: openQrModal,
|
onClick: openQrModal,
|
||||||
searchableTitles: [i18n.Messages.USER_SETTINGS_SCAN_QR_CODE],
|
searchableTitles: [getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")],
|
||||||
label: i18n.Messages.USER_SETTINGS_SCAN_QR_CODE,
|
label: getIntlMessage("USER_SETTINGS_SCAN_QR_CODE"),
|
||||||
ariaLabel: i18n.Messages.USER_SETTINGS_SCAN_QR_CODE
|
ariaLabel: getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import {
|
import {
|
||||||
ModalContent,
|
ModalContent,
|
||||||
ModalHeader,
|
ModalHeader,
|
||||||
|
@ -15,7 +16,6 @@ import {
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
i18n,
|
|
||||||
RestAPI,
|
RestAPI,
|
||||||
Text,
|
Text,
|
||||||
useEffect,
|
useEffect,
|
||||||
|
@ -372,7 +372,7 @@ function QrModal(props: ModalProps) {
|
||||||
tag="h1"
|
tag="h1"
|
||||||
style={{ flexGrow: 1 }}
|
style={{ flexGrow: 1 }}
|
||||||
>
|
>
|
||||||
{i18n.Messages.USER_SETTINGS_SCAN_QR_CODE}
|
{getIntlMessage("USER_SETTINGS_SCAN_QR_CODE")}
|
||||||
</Text>
|
</Text>
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
<ModalContent scrollbarType="none">
|
<ModalContent scrollbarType="none">
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import {
|
import {
|
||||||
ModalContent,
|
ModalContent,
|
||||||
ModalFooter,
|
ModalFooter,
|
||||||
|
@ -15,7 +16,6 @@ import {
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
i18n,
|
|
||||||
RestAPI,
|
RestAPI,
|
||||||
Text,
|
Text,
|
||||||
useEffect,
|
useEffect,
|
||||||
|
@ -131,14 +131,14 @@ function VerifyModal({
|
||||||
tag="h1"
|
tag="h1"
|
||||||
className={cl("device-header")}
|
className={cl("device-header")}
|
||||||
>
|
>
|
||||||
{i18n.Messages.QR_CODE_LOGIN_SUCCESS}
|
{getIntlMessage("QR_CODE_LOGIN_SUCCESS")}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
variant="text-md/semibold"
|
variant="text-md/semibold"
|
||||||
color="text-normal"
|
color="text-normal"
|
||||||
style={{ width: "30rem" }}
|
style={{ width: "30rem" }}
|
||||||
>
|
>
|
||||||
{i18n.Messages.QR_CODE_LOGIN_SUCCESS_FLAVOR}
|
{getIntlMessage("QR_CODE_LOGIN_SUCCESS_FLAVOR")}
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
</>
|
||||||
) : state === VerifyState.NotFound ? (
|
) : state === VerifyState.NotFound ? (
|
||||||
|
@ -155,14 +155,14 @@ function VerifyModal({
|
||||||
tag="h1"
|
tag="h1"
|
||||||
className={cl("device-header")}
|
className={cl("device-header")}
|
||||||
>
|
>
|
||||||
{i18n.Messages.QR_CODE_NOT_FOUND}
|
{getIntlMessage("QR_CODE_NOT_FOUND")}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
variant="text-md/semibold"
|
variant="text-md/semibold"
|
||||||
color="text-normal"
|
color="text-normal"
|
||||||
style={{ width: "30rem" }}
|
style={{ width: "30rem" }}
|
||||||
>
|
>
|
||||||
{i18n.Messages.QR_CODE_NOT_FOUND_DESCRIPTION}
|
{getIntlMessage("QR_CODE_NOT_FOUND_DESCRIPTION")}
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
@ -179,7 +179,7 @@ function VerifyModal({
|
||||||
tag="h1"
|
tag="h1"
|
||||||
className={cl("device-header")}
|
className={cl("device-header")}
|
||||||
>
|
>
|
||||||
{i18n.Messages.QR_CODE_LOGIN_CONFIRM}
|
{getIntlMessage("QR_CODE_LOGIN_CONFIRM")}
|
||||||
</Text>
|
</Text>
|
||||||
<Text variant="text-md/semibold" color="text-danger">
|
<Text variant="text-md/semibold" color="text-danger">
|
||||||
Never scan a login QR code from another user or application.
|
Never scan a login QR code from another user or application.
|
||||||
|
@ -205,7 +205,7 @@ function VerifyModal({
|
||||||
<ModalFooter className={cl("device-footer")}>
|
<ModalFooter className={cl("device-footer")}>
|
||||||
{state === VerifyState.LoggedIn ? (
|
{state === VerifyState.LoggedIn ? (
|
||||||
<Button onClick={props.onClose}>
|
<Button onClick={props.onClose}>
|
||||||
{i18n.Messages.QR_CODE_LOGIN_FINISH_BUTTON}
|
{getIntlMessage("QR_CODE_LOGIN_FINISH_BUTTON")}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
|
@ -214,8 +214,8 @@ function VerifyModal({
|
||||||
onClick={props.onClose}
|
onClick={props.onClose}
|
||||||
>
|
>
|
||||||
{state === VerifyState.NotFound
|
{state === VerifyState.NotFound
|
||||||
? i18n.Messages.CLOSE
|
? getIntlMessage("CLOSE")
|
||||||
: i18n.Messages.CANCEL}
|
: getIntlMessage("CANCEL")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
|
|
|
@ -101,7 +101,7 @@ export default definePlugin({
|
||||||
predicate: () => settings.store.onLink,
|
predicate: () => settings.store.onLink,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "Messages.REPLY_QUOTE_MESSAGE_NOT_LOADED",
|
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
|
||||||
replacement: {
|
replacement: {
|
||||||
// Should match two places
|
// Should match two places
|
||||||
match: /(\i\.Clickable),\{/g,
|
match: /(\i\.Clickable),\{/g,
|
||||||
|
@ -110,7 +110,7 @@ export default definePlugin({
|
||||||
predicate: () => settings.store.onReply,
|
predicate: () => settings.store.onReply,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "Messages.MESSAGE_FORWARDED}",
|
find: "#{intl::MESSAGE_FORWARDED}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\i\.Clickable),\{/,
|
match: /(\i\.Clickable),\{/,
|
||||||
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
|
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "STICKER_BUTTON_LABEL,",
|
find: "#{intl::STICKER_BUTTON_LABEL}",
|
||||||
replacement: [{
|
replacement: [{
|
||||||
match: /(children:\(0,\w\.jsx\)\()([\w.]+?)(,{innerClassName.{10,30}\.stickerButton)/,
|
match: /(children:\(0,\w\.jsx\)\()([\w.]+?)(,{innerClassName.{10,30}\.stickerButton)/,
|
||||||
replace: (_, head, button, tail) => {
|
replace: (_, head, button, tail) => {
|
||||||
|
@ -64,11 +64,11 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".Messages.EXPRESSION_PICKER_GIF",
|
find: "#{intl::EXPRESSION_PICKER_GIF}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /role:"tablist",.+?\.Messages\.EXPRESSION_PICKER_CATEGORIES_A11Y_LABEL,children:(\[.*?\)\]}\)}\):null,)(.*?closePopout:\w.*?:null)/s,
|
match: /role:"tablist",.+?#{intl::EXPRESSION_PICKER_CATEGORIES_A11Y_LABEL}\),children:(\[.*?\)\]}\)}\):null,)(.*?closePopout:\w.*?:null)/s,
|
||||||
replace: m => {
|
replace: m => {
|
||||||
const stickerTabRegex = /(\w+?)\?(\([^()]+?\))\((.{1,2}),{.{0,128},isActive:(.{1,2})===.{1,150},children:(.{1,10}Messages.EXPRESSION_PICKER_STICKER).*?:null/s;
|
const stickerTabRegex = /(\w+?)\?(\([^()]+?\))\((.{1,2}),{.{0,128},isActive:(.{1,2})===.{1,150},children:(.{1,10}#{intl::EXPRESSION_PICKER_STICKER}).*?:null/s;
|
||||||
const res = m.replace(stickerTabRegex, (_m, canUseStickers, jsx, tabHeaderComp, currentTab, stickerText) => {
|
const res = m.replace(stickerTabRegex, (_m, canUseStickers, jsx, tabHeaderComp, currentTab, stickerText) => {
|
||||||
const isActive = `${currentTab}==="stickers+"`;
|
const isActive = `${currentTab}==="stickers+"`;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -14,10 +14,10 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ",APP_TAG:\"",
|
find: "#{intl::APP_TAG})",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /APP_TAG:".*?"/,
|
match: /\i\.\i\.string\(\i\.\i#{intl::APP_TAG}\)/,
|
||||||
replace: "APP_TAG:\"BOT\""
|
replace: '"BOT"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
||||||
import { ChannelStore, GuildStore, i18n, RelationshipStore, UserStore } from "@webpack/common";
|
import { ChannelStore, GuildStore, RelationshipStore, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
const { getName } = findByPropsLazy("getName", "useName", "getNickname");
|
const { getName } = findByPropsLazy("getName", "useName", "getNickname");
|
||||||
const computeChannelName = findByCodeLazy(".isThread())return'\"'.concat(");
|
const computeChannelName = findByCodeLazy(".isThread())return'\"'.concat(");
|
||||||
|
@ -39,7 +40,7 @@ export default definePlugin({
|
||||||
if (message.type === MessageTypes.REPLY && message.referenced_message?.author) {
|
if (message.type === MessageTypes.REPLY && message.referenced_message?.author) {
|
||||||
const replyUser = UserStore.getUser(message.referenced_message.author.id);
|
const replyUser = UserStore.getUser(message.referenced_message.author.id);
|
||||||
const replyUsername = getName(channel.guild_id, channel.id, replyUser);
|
const replyUsername = getName(channel.guild_id, channel.id, replyUser);
|
||||||
title = i18n.Messages.CHANNEL_MESSAGE_REPLY_A11Y_LABEL.format({
|
title = getIntlMessage("CHANNEL_MESSAGE_REPLY_A11Y_LABEL", {
|
||||||
author: username,
|
author: username,
|
||||||
repliedAuthor: replyUsername,
|
repliedAuthor: replyUsername,
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,9 +27,9 @@ export default definePlugin({
|
||||||
authors: [EquicordDevs.iamme],
|
authors: [EquicordDevs.iamme],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Messages.MESSAGE_EDITED,",
|
find: "#{intl::MESSAGE_EDITED}),",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /Messages\.MESSAGE_EDITED,(?:[^}]*[}]){3}\)/,
|
match: /#{intl::MESSAGE_EDITED}\),(?:[^}]*[}]){3}\)/,
|
||||||
replace: "$&,$self.PinnedIcon(arguments[0].message)"
|
replace: "$&,$self.PinnedIcon(arguments[0].message)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import definePlugin from "@utils/types";
|
||||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||||
import badges from "plugins/_api/badges";
|
import badges from "plugins/_api/badges";
|
||||||
const roleIconClassName = findByPropsLazy("roleIcon", "separator").roleIcon;
|
const roleIconClassName = findByPropsLazy("roleIcon", "separator").roleIcon;
|
||||||
const RoleIconComponent = findComponentByCodeLazy(".Messages.ROLE_ICON_ALT_TEXT");
|
const RoleIconComponent = findComponentByCodeLazy("#{intl::ROLE_ICON_ALT_TEXT}");
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
|
|
||||||
import { User } from "discord-types/general";
|
import { User } from "discord-types/general";
|
||||||
|
|
|
@ -34,7 +34,7 @@ const { HeaderBar, HeaderBarIcon } = mapMangledModuleLazy(".themedMobile]:", {
|
||||||
});
|
});
|
||||||
const Chat = findComponentByCodeLazy("filterAfterTimestamp:", "chatInputType");
|
const Chat = findComponentByCodeLazy("filterAfterTimestamp:", "chatInputType");
|
||||||
const Resize = findComponentByCodeLazy("sidebarType:", "homeSidebarWidth");
|
const Resize = findComponentByCodeLazy("sidebarType:", "homeSidebarWidth");
|
||||||
const ChannelHeader = findComponentByCodeLazy(".Messages.HUB_DIRECTORY_CHANNEL_TITLE.format({");
|
const ChannelHeader = findComponentByCodeLazy("#{intl::HUB_DIRECTORY_CHANNEL_TITLE}");
|
||||||
const ChatInputTypes = findByPropsLazy("FORM", "NORMAL");
|
const ChatInputTypes = findByPropsLazy("FORM", "NORMAL");
|
||||||
const Sidebars = findByPropsLazy("ThreadSidebar", "MessageRequestSidebar");
|
const Sidebars = findByPropsLazy("ThreadSidebar", "MessageRequestSidebar");
|
||||||
|
|
||||||
|
|
|
@ -131,14 +131,14 @@ export default definePlugin({
|
||||||
dependencies: ["UserSettingsAPI"],
|
dependencies: ["UserSettingsAPI"],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Messages.CUSTOM_STATUS_SET_CUSTOM_STATUS}",
|
find: "#{intl::CUSTOM_STATUS_SET_CUSTOM_STATUS}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\.ModalFooter,.{0,70}\.Messages\.SAVE\}\)/,
|
match: /\.ModalFooter,.{0,70}\i\.\i\.string\(\i\.\i#{intl::SAVE}\)\}\)/,
|
||||||
replace: "$&,$self.renderRememberButton(this.state)"
|
replace: "$&,$self.renderRememberButton(this.state)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: /"aria-label":.{0,3}\.Messages.STATUS_MENU_LABEL/,
|
find: /"aria-label":.{0,1}\.\i\.string\(\i\.\i#{intl::STATUS_MENU_LABEL}/,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /!\i&&(.{0,15}\i\.Fragment.{0,55}null==(\i).{0,200}customEmojiPlaceholder\}\),onClick:([^}]+}))/,
|
match: /!\i&&(.{0,15}\i\.Fragment.{0,55}null==(\i).{0,200}customEmojiPlaceholder\}\),onClick:([^}]+}))/,
|
||||||
replace: "$self.render($2, $3),false&&$1"
|
replace: "$self.render($2, $3),false&&$1"
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { Devs } from "@utils/constants";
|
||||||
import { openModal } from "@utils/modal";
|
import { openModal } from "@utils/modal";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import { i18n, Menu, Tooltip, useEffect, useState } from "@webpack/common";
|
import { Menu, Tooltip, useEffect, useState } from "@webpack/common";
|
||||||
import { Message, User } from "discord-types/general";
|
import { Message, User } from "discord-types/general";
|
||||||
|
|
||||||
import { SetTimezoneModal } from "./TimezoneModal";
|
import { SetTimezoneModal } from "./TimezoneModal";
|
||||||
|
@ -27,6 +27,7 @@ export let timezones: Record<string, string | null> = {};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const classes = findByPropsLazy("timestamp", "compact", "contentOnly");
|
const classes = findByPropsLazy("timestamp", "compact", "contentOnly");
|
||||||
|
const locale = findByPropsLazy("getLocale");
|
||||||
|
|
||||||
export const settings = definePluginSettings({
|
export const settings = definePluginSettings({
|
||||||
"24h Time": {
|
"24h Time": {
|
||||||
|
@ -50,7 +51,7 @@ export const settings = definePluginSettings({
|
||||||
|
|
||||||
function getTime(timezone: string, timestamp: string | number, props: Intl.DateTimeFormatOptions = {}) {
|
function getTime(timezone: string, timestamp: string | number, props: Intl.DateTimeFormatOptions = {}) {
|
||||||
const date = new Date(timestamp);
|
const date = new Date(timestamp);
|
||||||
const formatter = new Intl.DateTimeFormat(i18n?.getLocale?.() ?? "en-US", {
|
const formatter = new Intl.DateTimeFormat(locale.getLocale() ?? "en-US", {
|
||||||
hour12: !settings.store["24h Time"],
|
hour12: !settings.store["24h Time"],
|
||||||
timeZone: timezone,
|
timeZone: timezone,
|
||||||
...props
|
...props
|
||||||
|
|
|
@ -8,10 +8,11 @@ import { NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||||
import { CodeBlock } from "@components/CodeBlock";
|
import { CodeBlock } from "@components/CodeBlock";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { closeModal, ModalCloseButton, ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
import { closeModal, ModalCloseButton, ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { Forms, i18n, Menu, Text } from "@webpack/common";
|
import { Forms, Menu, Text } from "@webpack/common";
|
||||||
import { Message } from "discord-types/general";
|
import { Message } from "discord-types/general";
|
||||||
|
|
||||||
type CustomMessage = Message & { editHistory?: any; deleted?: any; firstEditTimestamp?: any; };
|
type CustomMessage = Message & { editHistory?: any; deleted?: any; firstEditTimestamp?: any; };
|
||||||
|
@ -64,7 +65,7 @@ function openViewRawModal(obj: any, type: string, isMessage?: boolean) {
|
||||||
|
|
||||||
function makeContextCallback(name: string, action: (any) => void): NavContextMenuPatchCallback {
|
function makeContextCallback(name: string, action: (any) => void): NavContextMenuPatchCallback {
|
||||||
return (children, props) => {
|
return (children, props) => {
|
||||||
if (props.label === i18n.Messages.CHANNEL_ACTIONS_MENU_LABEL) return; // random shit like notification settings
|
if (props.label === getIntlMessage("CHANNEL_ACTIONS_MENU_LABEL")) return; // random shit like notification settings
|
||||||
|
|
||||||
const value = props[name];
|
const value = props[name];
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
|
|
|
@ -601,7 +601,7 @@ export default definePlugin({
|
||||||
authors: [EquicordDevs.creations],
|
authors: [EquicordDevs.creations],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.EMOJI_MATCHING",
|
find: "#{intl::EMOJI_MATCHING}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /renderResults\((\i)\){/,
|
match: /renderResults\((\i)\){/,
|
||||||
replace: "$&$1.results.emojis=$self.filterEmojis($1);if($1.results.emojis.length===0)return;"
|
replace: "$&$1.results.emojis=$self.filterEmojis($1);if($1.results.emojis.length===0)return;"
|
||||||
|
|
|
@ -9,12 +9,12 @@ import { classNameFactory } from "@api/Styles";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import { openUserProfile } from "@utils/discord";
|
import { getIntlMessage, openUserProfile } from "@utils/discord";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
||||||
import { Clickable, Forms, i18n, RelationshipStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common";
|
import { Clickable, Forms, RelationshipStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common";
|
||||||
import { User } from "discord-types/general";
|
import { User } from "discord-types/general";
|
||||||
|
|
||||||
interface WatchingProps {
|
interface WatchingProps {
|
||||||
|
@ -46,7 +46,7 @@ function Watching({ userIds, guildId }: WatchingProps): JSX.Element {
|
||||||
<div className={cl("content")}>
|
<div className={cl("content")}>
|
||||||
{userIds.length ?
|
{userIds.length ?
|
||||||
(<>
|
(<>
|
||||||
<Forms.FormTitle>{i18n.Messages.SPECTATORS.format({ numViewers: userIds.length })}</Forms.FormTitle>
|
<Forms.FormTitle>{getIntlMessage("SPECTATORS", { numViewers: userIds.length })}</Forms.FormTitle>
|
||||||
<Flex flexDirection="column" style={{ gap: 6 }} >
|
<Flex flexDirection="column" style={{ gap: 6 }} >
|
||||||
{users.map(user => (
|
{users.map(user => (
|
||||||
<Flex flexDirection="row" style={{ gap: 6, alignContent: "center" }} className={cl("user")} >
|
<Flex flexDirection="row" style={{ gap: 6, alignContent: "center" }} className={cl("user")} >
|
||||||
|
@ -54,7 +54,7 @@ function Watching({ userIds, guildId }: WatchingProps): JSX.Element {
|
||||||
{getUsername(user)}
|
{getUsername(user)}
|
||||||
</Flex>
|
</Flex>
|
||||||
))}
|
))}
|
||||||
{missingUsers > 0 && <span className={cl("more_users")}>{`+${i18n.Messages.NUM_USERS.format({ num: missingUsers })}`}</span>}
|
{missingUsers > 0 && <span className={cl("more_users")}>{`+${getIntlMessage("NUM_USERS", { num: missingUsers })}`}</span>}
|
||||||
</Flex>
|
</Flex>
|
||||||
</>)
|
</>)
|
||||||
: (<span className={cl("no_viewers")}>No spectators</span>)}
|
: (<span className={cl("no_viewers")}>No spectators</span>)}
|
||||||
|
@ -121,7 +121,7 @@ export default definePlugin({
|
||||||
{users.length ?
|
{users.length ?
|
||||||
<>
|
<>
|
||||||
<Forms.FormTitle tag="h3" style={{ marginTop: 8, marginBottom: 0, textTransform: "uppercase" }}>
|
<Forms.FormTitle tag="h3" style={{ marginTop: 8, marginBottom: 0, textTransform: "uppercase" }}>
|
||||||
{i18n.Messages.SPECTATORS.format({ numViewers: userIds.length })}
|
{getIntlMessage("SPECTATORS", { numViewers: userIds.length })}
|
||||||
</Forms.FormTitle>
|
</Forms.FormTitle>
|
||||||
<UserSummaryItem
|
<UserSummaryItem
|
||||||
users={users}
|
users={users}
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default definePlugin({
|
||||||
authors: [Devs.arHSM],
|
authors: [Devs.arHSM],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.SUPPRESS_ALL_EMBEDS",
|
find: "#{intl::SUPPRESS_ALL_EMBEDS}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /case (\i\.\i\.VIDEO):(case \i\.\i\.\i:)*break;default:(\i)=(?:(this\.renderDescription)\(\))\}/,
|
match: /case (\i\.\i\.VIDEO):(case \i\.\i\.\i:)*break;default:(\i)=(?:(this\.renderDescription)\(\))\}/,
|
||||||
replace: "$2 break; case $1: $3 = $self.ToggleableDescriptionWrapper({ embed: this.props.embed, original: $4.bind(this) }); break; default: $3 = $4() }"
|
replace: "$2 break; case $1: $3 = $self.ToggleableDescriptionWrapper({ embed: this.props.embed, original: $4.bind(this) }); break; default: $3 = $4() }"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue