So I took the Forums advice and made a separate RESX file for each ASPX page in my web app. Personally, I wanted to put all of my language strings into a single global RESX file, but instead I did it the 'right' way and made a separate one for each ASPX.
So now Ive got about 100 different RESX files with 5 to 15 short strings of text each. Many of them are repeats. The question is, how can I export these 100 RESX files into one single spreadsheet that I can send off for translation to other languages? Whats
the normal way to do that? I dont want to send the translating company 100 little files, I'd rather send just one big one. And I'd like to omit duplicate text strings (for example, "Cancel" appears in at least 50 of the RESX files - I dont want to pay for
that word to be translated 50 times).
You can read all of your *.resx files, with the ResourceManager and ResourceSet classes.Something like this..
System.Resources.ResourceManager resMgr =
new System.Resources.ResourceManager(baseName, System.Reflection.Assembly.GetExecutingAssembly());
System.Resources.ResourceSet resSet = resMgr.GetResourceSet(System.Threading.Thread.CurrentThread.CurrentCulture, true, true);
System.Collections.IDictionaryEnumerator idicEnum = resSet.GetEnumerator();
while (idicEnum.MoveNext())
{
// You can now write Key and Value to an Excel file
// idicEnum.Key
// idicEnum.Value
}
Well, I wasnt really looking to code anything. I was looking for Visual Studio to do something useful like export all the strings to a single spreadsheet or something similar.
Your code didnt work for me. What is baseName supposed to be? It seems like its looking for something called baseName.resources, but my resource files are named things like "SearchPage.aspx.resx".
Also, even if I did get your code to work, how would I go about re-inserting all the translated strings back into their individual resource files?
Ok. There is a software called "Sisulizer". I used it some years ago. It does the localization too and let you export your resources in excel format also.
I know I'm late to be replying to this, but have a look at this
resx localization tool. I'm the author of this product but I'm not just plugging my own software (shamelessly). This app (Visual Studio add-in) will genuinely do everything you asked for - extract all ".resx" strings, load them into a single file, and you
can then send it to a translator. They can then translate the file using my free application (Visual Studio not required) or you can do it yourself using its "Translate from the web" feature. The same add-in then imports the strings back into your solution.
Lots of essential features and safeguards built in and very easy to use. See my site for details.
Larry
25+ years on Microsoft platforms (most in C/C++)
We translate a lot .resx files with TM-database software.
It native support the these files, Translation memory and google translate.
TM-database is free and available at
http://yehongmei.narod.ru/
mccote
Member
8 Points
23 Posts
Translating RESX files
Jun 15, 2010 04:26 PM|LINK
So I took the Forums advice and made a separate RESX file for each ASPX page in my web app. Personally, I wanted to put all of my language strings into a single global RESX file, but instead I did it the 'right' way and made a separate one for each ASPX. So now Ive got about 100 different RESX files with 5 to 15 short strings of text each. Many of them are repeats. The question is, how can I export these 100 RESX files into one single spreadsheet that I can send off for translation to other languages? Whats the normal way to do that? I dont want to send the translating company 100 little files, I'd rather send just one big one. And I'd like to omit duplicate text strings (for example, "Cancel" appears in at least 50 of the RESX files - I dont want to pay for that word to be translated 50 times).
Thanks
hassanmehmoo...
Star
8970 Points
1590 Posts
Re: Translating RESX files
Jun 16, 2010 07:58 AM|LINK
Well . You are looking to code this thing? Hmm
You can read all of your *.resx files, with the ResourceManager and ResourceSet classes.Something like this..
System.Resources.ResourceManager resMgr = new System.Resources.ResourceManager(baseName, System.Reflection.Assembly.GetExecutingAssembly()); System.Resources.ResourceSet resSet = resMgr.GetResourceSet(System.Threading.Thread.CurrentThread.CurrentCulture, true, true); System.Collections.IDictionaryEnumerator idicEnum = resSet.GetEnumerator(); while (idicEnum.MoveNext()) { // You can now write Key and Value to an Excel file // idicEnum.Key // idicEnum.Value }--
Hope it helps..
Mark as Answer, if it answers you..
--
mccote
Member
8 Points
23 Posts
Re: Translating RESX files
Jun 16, 2010 06:18 PM|LINK
Well, I wasnt really looking to code anything. I was looking for Visual Studio to do something useful like export all the strings to a single spreadsheet or something similar.
Your code didnt work for me. What is baseName supposed to be? It seems like its looking for something called baseName.resources, but my resource files are named things like "SearchPage.aspx.resx".
Also, even if I did get your code to work, how would I go about re-inserting all the translated strings back into their individual resource files?
hassanmehmoo...
Star
8970 Points
1590 Posts
Re: Translating RESX files
Jun 17, 2010 05:17 AM|LINK
Ok. There is a software called "Sisulizer". I used it some years ago. It does the localization too and let you export your resources in excel format also.
Check it out: http://www.sisulizer.com/
Mark as Answer, if it answers you..
--
lsmith999999
Member
26 Points
19 Posts
Re: Translating RESX files
Aug 14, 2010 02:08 AM|LINK
I know I'm late to be replying to this, but have a look at this resx localization tool. I'm the author of this product but I'm not just plugging my own software (shamelessly). This app (Visual Studio add-in) will genuinely do everything you asked for - extract all ".resx" strings, load them into a single file, and you can then send it to a translator. They can then translate the file using my free application (Visual Studio not required) or you can do it yourself using its "Translate from the web" feature. The same add-in then imports the strings back into your solution. Lots of essential features and safeguards built in and very easy to use. See my site for details.
25+ years on Microsoft platforms (most in C/C++)
salaoshi
Member
4 Points
2 Posts
Re: Translating RESX files
Jun 30, 2011 07:49 PM|LINK
We translate a lot .resx files with TM-database software.
It native support the these files, Translation memory and google translate.
TM-database is free and available at http://yehongmei.narod.ru/