E
E
Excellet2022-01-14 01:46:56
Visual Studio Code
Excellet, 2022-01-14 01:46:56

Is there a plugin or hotkey to separately select all text in quotes?

Hello everyone. I don't understand programming from the word at all. And I need help with this. There is code in VS Code with a lot of quoted text. So, how to select all this text? The matter is that it is necessary for me for translation. I found a plugin for translation and conversion, sort of. It remains to understand how to select text and not touch the code itself.

i "\"Are you hiding something from me?\""
                g @ 2_reg "\"Depends.\""
                i "\"Something dangerous at least?\""
                g "\"I don't believe I am hiding such things from you.\""
                i "\"...\""
                g 2_reg "\"You heard some rumor about me, didn't you?\""

Here is a sample code, and I need to use a hotkey to select all words inside quotes (at best, avoid \ ).
The file is written mainly in Python, but that's not essential I think.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim, 2022-01-14
@Excellet

So what I would like to suggest.
Let's say there is a file with the specified text.
After analyzing the text, we see a pattern that all the text to be translated starts with "\"and ends with \"".
accordingly, we need to select all such pieces in the text.
To do this, the standard features of the editor and regular expressions will help us, and only 5 seconds of time, after you get used to it:
1. Press CTRL+F- search by text.
2. Switch the search to regular expression mode by clicking ALT+R(or on the third icon, which is with an asterisk, after the input field)
3. Enter the appropriate regular expression: \\"(.*)\\"
4. Click ALT+Enterto select all found areas in multi-selection mode.
61e12a815af35718352436.png
5. Press the hot key of the google translate plugin for translation ALT+SHIFT+T
6. Since in some places an extra space could be added at the beginning between: \"-> \ ", then we just need to fix it.
7. Press CTRL+H
8. Turn off the regular expression search mode (see point 2)
9. In the first field, enter the current state of what we want to replace - \ "
10. In the bottom - what we want to replace - \"
11. Click CTRL+ALT+Enter(or the lower right icon - replace all).
61e12a883d58e027572293.png
12. Done. The text has been translated, the extra space has been corrected. No plugins - 5 seconds of time.

E
Excellet, 2022-01-14
@Excellet

Thank you very much for your help. True, it remains to understand why the translation plugin gives such an error, but this is a question for another topic)
61e1328769751799028565.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question