Craig
Craig

Reputation: 1794

How to paste multiple strings into .net .resx files?

I have many .resx files used for translations in a large site. To get the translations done, I copy and paste the content of each resx file into a spreadsheet. The spreadsheet comes back from the translator with the new language appended as an extra column. I've tried copying the column from the spreadsheet and pasting into the value column in the resx file but it won't work. I'm now reduced to cutting and pasting thousands of individual phrases from the spreadsheet to the resx file. There must be a better way. Is there?

Upvotes: 6

Views: 4393

Answers (5)

aalesund
aalesund

Reputation: 323

The following link from Resx Resource Manager support site was very helpful with copying back into Resx RM from a spreadsheet:

https://github.com/dotnet/ResXResourceManager/blob/master/Documentation/Topics/Copy,-Paste,-Export-and-Import.md#cell-selection

Right-click on the grid select 'Cell selection' and then you can paste in the selected contents of an excel spreadsheet in one go.

Upvotes: 0

jbyrd
jbyrd

Reputation: 5615

There's a way!

You can't copy/paste a single column, but you CAN copy/paste all columns - basically it's all or nothing. Sooo...just get your spreadsheet to exactly how you want the resx file, then clear out all the contents of the resx file, and finally copy everything from the spreadsheet and paste the whole thing into the resx file. Boom!

Upvotes: 9

Nikolay
Nikolay

Reputation: 3828

Resx is just an XML so you can make simple script to generate it from speadsheet file (save as csv for easy processing).

Upvotes: 0

Daniel Rose
Daniel Rose

Reputation: 17658

Instead of using a spreadsheet, we use ResEx. This allows the translator to directly produce the .resx file.

Upvotes: 2

Clafou
Clafou

Reputation: 15410

You can find localization tools that handle .resx files. So instead of copy/pasting your content from .resx files, you just send them as they are to the translator and they'll send you back a translated .resx file in their language. Productivity aside, it's better to do it this way as your .resx files may contain useful information such as comments to help translators understand the context or to communicate them any known restrictions (such as maximum length) that apply to a given string.

Upvotes: 1

Related Questions