[i18n/Streams] Change strings mentioning commands to use {command} variable #3938

Merged
Dav-Git merged 12 commits from V3/develop into V3/develop 2020-06-21 20:38:31 +02:00
Dav-Git commented 2020-06-07 17:57:45 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Changing all strings that mention a command to use the {command} variable and a .format method to put the command in place. This prevents commands from being translated by crowdin volunteers.

This does things mentioned in #3919 (but doesn't close)

### Type - [ ] Bugfix - [X] Enhancement - [ ] New feature ### Description of the changes Changing all strings that mention a command to use the {command} variable and a .format method to put the command in place. This prevents commands from being translated by crowdin volunteers. This does things mentioned in #3919 (but doesn't close)
palmtree5 (Migrated from github.com) reviewed 2020-06-07 17:57:45 +02:00
Twentysix26 (Migrated from github.com) reviewed 2020-06-07 17:57:45 +02:00
Drapersniper commented 2020-06-07 17:58:53 +02:00 (Migrated from github.com)

Can you please ... do cogs individually if its not asking too much, makes conflict and review easier as it breaks it up.

Can you please ... do cogs individually if its not asking too much, makes conflict and review easier as it breaks it up.
Dav-Git commented 2020-06-07 17:59:13 +02:00 (Migrated from github.com)

Good point

Good point
Dav-Git commented 2020-06-07 18:02:48 +02:00 (Migrated from github.com)

@jack1142 @Kowlin , @Drapersniper and me were wondering if I can just format the docstrings like that or if that would break something...

@jack1142 @Kowlin , @Drapersniper and me were wondering if I can just format the docstrings like that or if that would break something...
Jackenmen commented 2020-06-07 18:06:22 +02:00 (Migrated from github.com)

No, you can't. Docstring must be a literal string. If you really need to, you could use format_text_for_context but ehh I don't think the added complexity is worth it.

Edit: just to be clear, this is surely not the only solution, but I can't think of any that would be very simple while keeping i18n support properly.

No, you can't. Docstring must be a literal string. If you *really need to*, you *could* use `format_text_for_context` but ehh I don't think the added complexity is worth it. Edit: just to be clear, this is surely not the only solution, but I can't think of any that would be very simple while keeping i18n support properly.
Dav-Git commented 2020-06-07 18:07:14 +02:00 (Migrated from github.com)

Copy, i'll revert that in a bit then

Copy, i'll revert that in a bit then
Dav-Git commented 2020-06-07 18:07:24 +02:00 (Migrated from github.com)

I am dumb

I am dumb
Drapersniper (Migrated from github.com) reviewed 2020-06-18 14:18:34 +02:00
Drapersniper (Migrated from github.com) left a comment
No description provided.
LGTM as long as the 2 comments below are addressed
Jackenmen commented 2020-06-18 14:51:58 +02:00 (Migrated from github.com)

I wonder, wouldn't it actually make sense to translate <your_client_id_here>? It's probably not worth the additional trouble but I want to at least mention this 😛

I wonder, wouldn't it actually make sense to translate `<your_client_id_here>`? It's probably not worth the additional trouble but I want to at least mention this 😛
Drapersniper commented 2020-06-18 14:58:34 +02:00 (Migrated from github.com)

I wonder, wouldn't it actually make sense to translate <your_client_id_here>? It's probably not worth the additional trouble but I want to at least mention this 😛

I mean could just simplify by saying <client_id> but i can see people running the command like this and not replacing their client id... but yeah thats a good point thanslating that does make sense

> I wonder, wouldn't it actually make sense to translate `<your_client_id_here>`? It's probably not worth the additional trouble but I want to at least mention this 😛 I mean could just simplify by saying `<client_id>` but i can see people running the command like this and not replacing their client id... but yeah thats a good point thanslating that does make sense
Dav-Git commented 2020-06-18 15:00:38 +02:00 (Migrated from github.com)

Would you put that as a seperate string then? Otherwise the start message will be pretty fucked up in crowdin

Would you put that as a seperate string then? Otherwise the start message will be pretty fucked up in crowdin
Kowlin commented 2020-06-18 15:02:36 +02:00 (Migrated from github.com)

No, keep it all as one string as that would make more sense, Crowdin marks stuff in { } and alikes to not be translated by the translators. And will alert them of such.

No, keep it all as one string as that would make more sense, Crowdin marks stuff in ``{ }`` and alikes to not be translated by the translators. And will alert them of such.
Jackenmen commented 2020-06-18 15:02:43 +02:00 (Migrated from github.com)

Would you put that as a seperate string then? Otherwise the start message will be pretty fucked up in crowdin

Something like this would probably make most sense if we were to do so

(
     "blah, blah, {command}"
).format(
    command="`[p]set api twitch client_id {} client_secret {}`".format(
        _("<your_client_id_here>"), _("<your_client_secret_here>")
    )
)
> Would you put that as a seperate string then? Otherwise the start message will be pretty fucked up in crowdin Something like this would probably make most sense if we were to do so ```py ( "blah, blah, {command}" ).format( command="`[p]set api twitch client_id {} client_secret {}`".format( _("<your_client_id_here>"), _("<your_client_secret_here>") ) )
Dav-Git commented 2020-06-18 15:04:05 +02:00 (Migrated from github.com)

Yeah, so as I suggested. Not sure what you mean kowlin

Yeah, so as I suggested. Not sure what you mean kowlin
Jackenmen commented 2020-06-18 15:04:54 +02:00 (Migrated from github.com)

No, keep it all as one string as that would make more sense, Crowdin marks stuff in { } and alikes to not be translated by the translators. And will alert them of such.

That's not quite what I meant @Kowlin - I mean that <your_client_id_here> part of the shown example would make some sense to actually be translated, see the example above.

> No, keep it all as one string as that would make more sense, Crowdin marks stuff in `{ }` and alikes to not be translated by the translators. And will alert them of such. That's not quite what I meant @Kowlin - I mean that `<your_client_id_here>` part of the shown example **would make some sense** to actually be translated, see the example above.
Jackenmen (Migrated from github.com) reviewed 2020-06-18 15:58:14 +02:00
Jackenmen (Migrated from github.com) commented 2020-06-18 15:53:57 +02:00

Could you join these strings? Black doesn't do it automagically right now.

                    "The Twitch token is either invalid or has not been set. See {command}."
Could you join these strings? Black doesn't do it automagically right now. ```suggestion "The Twitch token is either invalid or has not been set. See {command}." ```
Jackenmen (Migrated from github.com) commented 2020-06-18 15:54:04 +02:00

Could you join these strings? Black doesn't do it automagically right now.

                    "The YouTube API key is either invalid or has not been set. See {command}."
Could you join these strings? Black doesn't do it automagically right now. ```suggestion "The YouTube API key is either invalid or has not been set. See {command}." ```
@ -461,1 +460,3 @@
).format(prefix=ctx.clean_prefix)
).format(
command="`{}set api twitch client_id {} client_secret {}`".format(
ctx.clean_prefix, _("<your_client_id_here>"), _("<your_client_secret_here>")
Jackenmen (Migrated from github.com) commented 2020-06-18 15:57:26 +02:00

You missed this one

        ).format(
            command="`{}set api youtube api_key {}`".format(
                ctx.clean_prefix, _("<your_api_key_here>")
            )
        )
You missed this one ```suggestion ).format( command="`{}set api youtube api_key {}`".format( ctx.clean_prefix, _("<your_api_key_here>") ) ) ```
Jackenmen commented 2020-06-19 01:03:59 +02:00 (Migrated from github.com)

Also needs conflict resolution

Also needs conflict resolution
Dav-Git commented 2020-06-19 10:49:41 +02:00 (Migrated from github.com)

Sorry, I only just saw this. Will take care of it tomorrow or on Sunday.

Sorry, I only just saw this. Will take care of it tomorrow or on Sunday.
Dav-Git commented 2020-06-19 21:32:01 +02:00 (Migrated from github.com)

I think I solved this correctly (TM)

I think I solved this correctly (TM)
Jackenmen (Migrated from github.com) reviewed 2020-06-19 23:09:29 +02:00
Jackenmen (Migrated from github.com) left a comment
No description provided.
Looks good to me 👍
Jackenmen commented 2020-06-19 23:09:55 +02:00 (Migrated from github.com)

@Dav-Git Well, excluding the style check that is 😛

@Dav-Git Well, excluding the style check that is 😛
Dav-Git commented 2020-06-19 23:18:13 +02:00 (Migrated from github.com)

... whenever I next get to a PC...
Aaaaaaaaaaaaaaaaaaaaaaaaaaaa

... whenever I next get to a PC... Aaaaaaaaaaaaaaaaaaaaaaaaaaaa
Dav-Git commented 2020-06-19 23:25:39 +02:00 (Migrated from github.com)

Blaaaaaaaaaaaaack fixed?

Blaaaaaaaaaaaaack fixed?
Jackenmen (Migrated from github.com) approved these changes 2020-06-19 23:26:22 +02:00
Jackenmen (Migrated from github.com) left a comment

Yup 👍

Yup 👍
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!3938
No description provided.