From df410529b05ec26eccbb73e74685506185dae322 Mon Sep 17 00:00:00 2001 From: Dav Date: Sun, 21 Jun 2020 18:38:31 +0000 Subject: [PATCH] [i18n/Streams] Change strings mentioning commands to use {command} variable (#3938) * hopefully all strings in streams.py * black streams.py * don't touch docstrings * uniformity is good * thx draper Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com> * aaaaaaaaaaaaaaaaaaaaaa * translate more * sure, joining some strings for jack Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * more strings to join Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * yup... I missed this Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * jaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaack blaaaaaaaaaaaaaaaaaaaaaack Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> --- redbot/cogs/streams/streams.py | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/redbot/cogs/streams/streams.py b/redbot/cogs/streams/streams.py index 62c2fa172..5fe23c1cd 100644 --- a/redbot/cogs/streams/streams.py +++ b/redbot/cogs/streams/streams.py @@ -141,11 +141,14 @@ class Streams(commands.Cog): '2. Click "Manage" on your application.\n' '3. Click on "New secret".\n' "5. Copy your client ID and your client secret into:\n" - "`[p]set api twitch client_id " - "client_secret `\n\n" - "Note: These tokens are sensitive and should " - "only be used in a private channel " + "{command}" + "\n\n" + "Note: These tokens are sensitive and should only be used in a private channel " "or in DM with the bot." + ).format( + command="`[p]set api twitch client_id {} client_secret {}`".format( + _(""), _("") + ) ) if notified_owner_missing_twitch_secret is False: await send_to_owners_with_prefix_replaced(self.bot, message) @@ -250,17 +253,15 @@ class Streams(commands.Cog): await ctx.send(_("That channel doesn't seem to exist.")) except InvalidTwitchCredentials: await ctx.send( - _( - "The Twitch token is either invalid or has not been set. See " - "`{prefix}streamset twitchtoken`." - ).format(prefix=ctx.clean_prefix) + _("The Twitch token is either invalid or has not been set. See {command}.").format( + command=f"`{ctx.clean_prefix}streamset twitchtoken`" + ) ) except InvalidYoutubeCredentials: await ctx.send( _( - "The YouTube API key is either invalid or has not been set. See " - "`{prefix}streamset youtubekey`." - ).format(prefix=ctx.clean_prefix) + "The YouTube API key is either invalid or has not been set. See {command}." + ).format(command=f"`{ctx.clean_prefix}streamset youtubekey`") ) except APIError: await ctx.send( @@ -405,17 +406,16 @@ class Streams(commands.Cog): except InvalidTwitchCredentials: await ctx.send( _( - "The Twitch token is either invalid or has not been set. See " - "`{prefix}streamset twitchtoken`." - ).format(prefix=ctx.clean_prefix) + "The Twitch token is either invalid or has not been set. See {command}." + ).format(command=f"`{ctx.clean_prefix}streamset twitchtoken`") ) return except InvalidYoutubeCredentials: await ctx.send( _( "The YouTube API key is either invalid or has not been set. See " - "`{prefix}streamset youtubekey`." - ).format(prefix=ctx.clean_prefix) + "{command}." + ).format(command=f"`{ctx.clean_prefix}streamset youtubekey`") ) return except APIError: @@ -452,7 +452,6 @@ class Streams(commands.Cog): @checks.is_owner() async def twitchtoken(self, ctx: commands.Context): """Explain how to set the twitch token.""" - message = _( "To set the twitch API tokens, follow these steps:\n" "1. Go to this page: https://dev.twitch.tv/dashboard/apps.\n" @@ -461,11 +460,15 @@ class Streams(commands.Cog): "select an Application Category of your choosing.\n" "4. Click *Register*.\n" "5. Copy your client ID and your client secret into:\n" - "`{prefix}set api twitch client_id " - "client_secret `\n\n" + "{command}" + "\n\n" "Note: These tokens are sensitive and should only be used in a private channel\n" "or in DM with the bot.\n" - ).format(prefix=ctx.clean_prefix) + ).format( + command="`{}set api twitch client_id {} client_secret {}`".format( + ctx.clean_prefix, _(""), _("") + ) + ) await ctx.maybe_send_embed(message) @@ -483,10 +486,14 @@ class Streams(commands.Cog): "3. Set up your API key \n" "(see https://support.google.com/googleapi/answer/6158862 for instructions)\n" "4. Copy your API key and run the command " - "`{prefix}set api youtube api_key `\n\n" + "{command}\n\n" "Note: These tokens are sensitive and should only be used in a private channel\n" "or in DM with the bot.\n" - ).format(prefix=ctx.clean_prefix) + ).format( + command="`{}set api youtube api_key {}`".format( + ctx.clean_prefix, _("") + ) + ) await ctx.maybe_send_embed(message)