Do not include expected wait_for responses in translated strings #5364

Merged
Jackenmen merged 4 commits from V3/do_not_include_prompt_in_translation_string into V3/develop 2021-10-16 00:02:36 +02:00
Jackenmen commented 2021-10-02 19:09:36 +02:00 (Migrated from github.com)

Description of the changes

This should remove all occurrences of translatable strings including the responses expected by us in bot.wait_for() even though we do not actually support translated variants. Also, expands (y/n) to full (yes/no) to avoid any confusion on what these mean.

Fixes #5363

### Description of the changes This should remove all occurrences of translatable strings including the responses expected by us in `bot.wait_for()` even though we do not actually support translated variants. Also, expands `(y/n)` to full `(yes/no)` to avoid any confusion on what these mean. Fixes #5363
TrustyJAID (Migrated from github.com) reviewed 2021-10-02 19:09:36 +02:00
Jackenmen commented 2021-10-02 20:54:45 +02:00 (Migrated from github.com)

This should now include all occurrences of the strings including the response expected by us when we use bot.wait_for().

This should now include all occurrences of the strings including the response expected by us when we use `bot.wait_for()`.
Dav-Git (Migrated from github.com) requested changes 2021-10-13 11:41:10 +02:00
Dav-Git (Migrated from github.com) left a comment

There's a few things that would make the code better readable, but from a functional perspective everything looks fine.

There's a few things that would make the code better readable, but from a functional perspective everything looks fine.
@ -30,0 +24,4 @@
"\n\nBy typing '{confirmation_message}' you declare that you have read and"
" fully understand the above message. This message won't be "
"shown again until the next reboot.\n\nYou have **30** seconds"
" to reply to this message."
Dav-Git (Migrated from github.com) commented 2021-10-13 11:39:45 +02:00

I see why you put the .format() here. If we're already moving the text that needs to be typed into the function, you'll probably want to use the same string here as in line 34.

confirmation_message="I agree"
await ctx.send(T_(REPO_INSTALL_MESSAGE).fornmat(confirmation_message=bold(confirmation_message)))
# ...
await ctx.bot.wait_for(
	"message", check=MessagePredicate.lower_equal_to(confirmation_message.lower(), ctx), timeout=30
)

That way there's only one place to look for the correct string.

I see why you put the `.format()` here. If we're already moving the text that needs to be typed into the function, you'll probably want to use the same string here as in line 34. ```py confirmation_message="I agree" await ctx.send(T_(REPO_INSTALL_MESSAGE).fornmat(confirmation_message=bold(confirmation_message))) # ... await ctx.bot.wait_for( "message", check=MessagePredicate.lower_equal_to(confirmation_message.lower(), ctx), timeout=30 ) ``` That way there's only one place to look for the correct string.
Dav-Git (Migrated from github.com) commented 2021-10-13 11:33:46 +02:00

Having this closer to where the variables were defined would make this code a lot more readable.

Having this closer to where the variables were defined would make this code a lot more readable.
Jackenmen (Migrated from github.com) reviewed 2021-10-13 23:47:39 +02:00
Jackenmen (Migrated from github.com) commented 2021-10-13 23:47:39 +02:00

I'm not sure I agree - these variables are defined right above the definition of msg variable which makes it easy to see what are the contents of the replacement fields in that text.

I'm not sure I agree - these variables are defined right above the definition of `msg` variable which makes it easy to see what are the contents of the replacement fields in that text.
Jackenmen (Migrated from github.com) reviewed 2021-10-13 23:48:40 +02:00
@ -30,0 +24,4 @@
"\n\nBy typing '{confirmation_message}' you declare that you have read and"
" fully understand the above message. This message won't be "
"shown again until the next reboot.\n\nYou have **30** seconds"
" to reply to this message."
Jackenmen (Migrated from github.com) commented 2021-10-13 23:48:40 +02:00

Done 👍

Done 👍
Dav-Git (Migrated from github.com) reviewed 2021-10-14 01:06:12 +02:00
Flame442 (Migrated from github.com) requested changes 2021-10-14 20:52:19 +02:00
Flame442 (Migrated from github.com) left a comment

Mild formatting issues.

Mild formatting issues.
@ -983,9 +989,9 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
command_2 = f"{ctx.clean_prefix}muteset makerole"
Flame442 (Migrated from github.com) commented 2021-10-14 20:51:46 +02:00

There is no space between the previous line and this one (same behavior as the old code, but incorrect)

There is no space between the previous line and this one (same behavior as the old code, but incorrect)
@ -2688,8 +2688,9 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
await ctx.send(
Flame442 (Migrated from github.com) commented 2021-10-14 20:51:49 +02:00

This one still needs a leading space

This one still needs a leading space
Flame442 (Migrated from github.com) approved these changes 2021-10-15 18:59:07 +02:00
red-githubbot[bot] commented 2021-10-16 00:02:38 +02:00 (Migrated from github.com)

Thanks jack1142 for the PR 🎉. I'm working now to backport this PR to: 3.4.

Thanks jack1142 for the PR 🎉. I'm working now to backport this PR to: 3.4.
red-githubbot[bot] commented 2021-10-16 00:02:47 +02:00 (Migrated from github.com)

#5396 is a backport of this pull request to Red 3.4.

#5396 is a backport of this pull request to [Red 3.4](https://github.com/Cog-Creators/Red-DiscordBot/tree/3.4).
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!5364
No description provided.