From 32b860c352615d3c2d0902c1efeb24aee30a09cf Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 10 May 2025 22:32:19 -0400 Subject: [PATCH] add UI for testing word mutes --- locales/index.d.ts | 24 ++++ .../pages/settings/mute-block.word-mute.vue | 105 ++++++++++++------ sharkey-locales/en-US.yml | 7 ++ 3 files changed, 102 insertions(+), 34 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 9679cc3acf..2beb0ae454 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -12969,6 +12969,30 @@ export interface Locale extends ILocale { */ "text": string; }; + /** + * Test word mutes + */ + "wordMuteTestLabel": string; + /** + * Enter some text here to test your word mute patterns. The matched words, if any, will be displayed below. + */ + "wordMuteTestDescription": string; + /** + * Test + */ + "wordMuteTestTest": string; + /** + * Matched words: {words} + */ + "wordMuteTestMatch": ParameterizedString<"words">; + /** + * No results yet, enter some text and click "Test" to check it. + */ + "wordMuteTestNoResults": string; + /** + * Text does not match any word mutes. + */ + "wordMuteTestNoMatch": string; } declare const locales: { [lang: string]: Locale; diff --git a/packages/frontend/src/pages/settings/mute-block.word-mute.vue b/packages/frontend/src/pages/settings/mute-block.word-mute.vue index f5837abe98..52aa2ff230 100644 --- a/packages/frontend/src/pages/settings/mute-block.word-mute.vue +++ b/packages/frontend/src/pages/settings/mute-block.word-mute.vue @@ -11,16 +11,33 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + +
+ + + +
{{ i18n.ts.wordMuteTestTest }}
+
{{ i18n.ts.wordMuteTestNoResults}}
+
{{ i18n.ts.wordMuteTestNoMatch }}
+
{{ i18n.tsx.wordMuteTestMatch({ words: testMatches }) }}
+
+
+ {{ i18n.ts.save }} diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 034d995b01..a42486c4d1 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -543,3 +543,10 @@ enableProxyAccountDescription: "If disabled, then the proxy account will not be _confirmPollEdit: title: Are you sure you want to edit this poll text: Editing this poll will cause it to lose all previous votes + +wordMuteTestLabel: "Test word mutes" +wordMuteTestDescription: "Enter some text here to test your word mute patterns. The matched words, if any, will be displayed below." +wordMuteTestTest: "Test" +wordMuteTestMatch: "Matched words: {words}" +wordMuteTestNoResults: "No results yet, enter some text and click \"Test\" to check it." +wordMuteTestNoMatch: "Text does not match any word mutes."