help for quotes please
-
Hello, I’m making a mod where I translate a game into French and I need to replace words in quotes with words translated into French, example
Hyping "Hyping" Fulfillingcontract "Fulfilling contract" Time-limit "Time-limit" Requiredquality "Required quality" Upfront "Upfront" Whendone "When done" Penalty "Penalty" Costperbug "Cost per bug" Bugpenalty "Bug penalty" Latepenalty "Late penalty" Qualitypenalty "Quality penalty" Cancelpenalty "Cancel penalty" Netprofit "Net profit" Delivered "Delivered" Maxbandwidth "Max bandwidth" Lookagain "Look again" LookAgainPrompt "Are you sure you want to look again? It will cost {0}"to
Hyping "Popularité" Fulfillingcontract "Contrat rempli" Time-limit "Limite de temps" Requiredquality "Qualité requise" Upfront "Avance" Whendone "A la livraison" Penalty "Penalté" Costperbug "Coût par bug" Bugpenalty "Pénalité des bugs" Latepenalty "Pénalité de retard" Qualitypenalty "Pénalité de Qualité" Cancelpenalty "Pénalité d'annulation" Netprofit "Profit net" Delivered "Livré" Maxbandwidth "Bande passante Max" Lookagain "Actualiser" LookAgainPrompt "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"I just wish I could take the words in quotes and be able to paste them in once translated
-
@Bastien-Allouard
like just take"Popularité" "Contrat rempli" "Limite de temps" "Qualité requise" "Avance" "A la livraison" "Penalté" "Coût par bug" "Pénalité des bugs" "Pénalité de retard" "Pénalité de Qualité" "Pénalité d'annulation" "Profit net" "Livré" "Bande passante Max" "Actualiser" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"and paste in a once after the english’s words like
Hyping Fulfillingcontract Time-limit Requiredquality Upfront Whendone Penalty Costperbug Bugpenalty Latepenalty Qualitypenalty Cancelpenalty Netprofit Delivered Maxbandwidth Lookagain LookAgainPromptto give
Hyping "Popularité" Fulfillingcontract "Contrat rempli" Time-limit "Limite de temps" Requiredquality "Qualité requise" Upfront "Avance" Whendone "A la livraison" Penalty "Penalté" Costperbug "Coût par bug" Bugpenalty "Pénalité des bugs" Latepenalty "Pénalité de retard" Qualitypenalty "Pénalité de Qualité" Cancelpenalty "Pénalité d'annulation" Netprofit "Profit net" Delivered "Livré" Maxbandwidth "Bande passante Max" Lookagain "Actualiser" LookAgainPrompt "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}" -
Natively in Notepad++? The only way is manual search/replace for each term (or craft a regex that essentially does the same).
If you are willing to use the PythonScript plugin, then this post has an example of a script that will translate from English to another language; just put your English terms/phrases on the left side of the translation table, and the French equivalents on the right side.
-
Hello, @bastien-allouard, @peterjones and All,
I’ve got a solution which needs the installation of the excellent
BetterMultiSelectionplugin, from @dail ! So :-
Open the menu option
Plugins > Plugins Admin... -
Select the
BetterMultiSelectionplugin -
Click on the
Installbutton -
Click on the
Closebutton -
For security, close and restart Notepad++
Now, assuming that you have this INPUT text :
Hyping "Hyping" Fulfillingcontract "Fulfilling contract" Time-limit "Time-limit" Requiredquality "Required quality" Upfront "Upfront" Whendone "When done" Penalty "Penalty" Costperbug "Cost per bug" Bugpenalty "Bug penalty" Latepenalty "Late penalty" Qualitypenalty "Quality penalty" Cancelpenalty "Cancel penalty" Netprofit "Net profit" Delivered "Delivered" Maxbandwidth "Max bandwidth" Lookagain "Look again" LookAgainPrompt "Are you sure you want to look again? It will cost {0}" Hyping "Popularité" Fulfillingcontract "Contrat rempli" Time-limit "Limite de temps" Requiredquality "Qualité requise" Upfront "Avance" Whendone "A la livraison" Penalty "Penalté" Costperbug "Coût par bug" Bugpenalty "Pénalité des bugs" Latepenalty "Pénalité de retard" Qualitypenalty "Pénalité de Qualité" Cancelpenalty "Pénalité d'annulation" Netprofit "Profit net" Delivered "Livré" Maxbandwidth "Bande passante Max" Lookagain "Actualiser" LookAgainPrompt "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"-
First, let’s change any tab char by the corresponding space chars with the menu option
Edit > Blank Operations > TAB to Space -
Select all the lines, English and French
-
Open the Replace dialog (
Ctrl + H)-
SEARCH
(?-s)^(\h*).+?" -
REPLACE
\1" -
Tick the
Wrap aroundandIn selectionoptions -
Select the
Regular expressionsearch mode -
Click on the
Replace Allbutton
-
You should obtain the OUTPUT text below :
"Hyping" "Fulfilling contract" "Time-limit" "Required quality" "Upfront" "When done" "Penalty" "Cost per bug" "Bug penalty" "Late penalty" "Quality penalty" "Cancel penalty" "Net profit" "Delivered" "Max bandwidth" "Look again" "Are you sure you want to look again? It will cost {0}" "Popularité" "Contrat rempli" "Limite de temps" "Qualité requise" "Avance" "A la livraison" "Penalté" "Coût par bug" "Pénalité des bugs" "Pénalité de retard" "Pénalité de Qualité" "Pénalité d'annulation" "Profit net" "Livré" "Bande passante Max" "Actualiser" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"-
Enable, if necessary, the
BetterMultiSelectionplugin -
Do a zero-length
rectangularselection of all the lines ( Hit, simultaneously theAltandShiftkeys and press theDownkey, several times ) -
Release all the keys, then hit the End ( or Fin ) key
=> All the cursors should be at the end of lines
-
Hit the
Enterkey to insert blank lines, in between -
Hit the
Backspacekey to delete the tabulations ( IMPORTANT ) -
Hit the
Esckey to disable your rectangular selection
You’ll get this OUTPUT :
"Hyping" "Fulfilling contract" "Time-limit" "Required quality" "Upfront" "When done" "Penalty" "Cost per bug" "Bug penalty" "Late penalty" "Quality penalty" "Cancel penalty" "Net profit" "Delivered" "Max bandwidth" "Look again" "Are you sure you want to look again? It will cost {0}" "Popularité" "Contrat rempli" "Limite de temps" "Qualité requise" "Avance" "A la livraison" "Penalté" "Coût par bug" "Pénalité des bugs" "Pénalité de retard" "Pénalité de Qualité" "Pénalité d'annulation" "Profit net" "Livré" "Bande passante Max" "Actualiser" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"-
Now, redo a zero lengh
rectangularselection of the french lines only, including the blank ones -
While keeping pressed the
AltandShiftkeys, hit the End ( or Fin ) key to include all text -
Press the
Ctrl + Xshortcut, to move that text in the clipboard -
Hit the
Esckey to disable the rectangular selection -
Now, move the caret at the very beginning of the first blank line, under the line
"Hyping" -
Hit the
Ctrl + Vshortcut
=> Wow ! you should get this OUTPUT text, below :
"Hyping" "Popularité" "Fulfilling contract" "Contrat rempli" "Time-limit" "Limite de temps" "Required quality" "Qualité requise" "Upfront" "Avance" "When done" "A la livraison" "Penalty" "Penalté" "Cost per bug" "Coût par bug" "Bug penalty" "Pénalité des bugs" "Late penalty" "Pénalité de retard" "Quality penalty" "Pénalité de Qualité" "Cancel penalty" "Pénalité d'annulation" "Net profit" "Profit net" "Delivered" "Livré" "Max bandwidth" "Bande passante Max" "Look again" "Actualiser" "Are you sure you want to look again? It will cost {0}" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"Finally, do the last regex S/R, below :
-
SEARCH
(?-s)^(\h*)"(.+)"\R\h*(.+) -
REPLACE
\1\2\x20\3
This regex selects two lines and rewrites all chars of the first line, but the double quote chars. Then, changes the
EOL, between the two lines, with aspacechar and, finally, rewrites the contents of the second lineSo, you should get your expected OUTPUT text :
Hyping "Popularité" Fulfilling contract "Contrat rempli" Time-limit "Limite de temps" Required quality "Qualité requise" Upfront "Avance" When done "A la livraison" Penalty "Penalté" Cost per bug "Coût par bug" Bug penalty "Pénalité des bugs" Late penalty "Pénalité de retard" Quality penalty "Pénalité de Qualité" Cancel penalty "Pénalité d'annulation" Net profit "Profit net" Delivered "Livré" Max bandwidth "Bande passante Max" Look again "Actualiser" Are you sure you want to look again? It will cost {0} "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"Best Regards,
guy038
-