Can I translate specific fields in a text document?

I will do bulk text translation on Google. I noticed that Google is not translating words and sentences that are compound but separated by underscores. Phrases and words that I do not want to be translated in my document […] are in these brackets. With Notepad ++, I want to add bulk underscores “_” to the beginning, end and spaces of the sentence between these brackets. How can I do that?

To summarize […] I want to add bulk underscores, including spaces, at the beginning and end of words and sentences in these parentheses.

Sample;
Text to be translated: [Help me?]
With Notepad ++, I want to: [_Help_me? _]

If it can’t be done in Notepad ++, please indicate if I can do this with other software.

1 Like

Yes. Following this regular expression, you need to do a 3 step search-and-replace.

  1. Using the replace dialog, enter this string as the “search for”: \s+(?=[^[\]]*\]). Make sure the “regular expression” radio button is selected. The replace string is an underscore.
  2. Do an ordinary search-and-replace for “[”, replacing with “[_”
  3. Do an ordinary search-and-replace for “]”, replacing with “_]”

Step 1 replaces all spaces between brackets with underscore. I tested with Notepad++ and it worked.

1 Like

Thanks it worked. So how can I undo the edit later? [_ correcting these is okay, but how do I remove the hyphen between sentences? There are other sentences in the document that contain _ underscores. They should not change.

1 Like