How can I extract localized string resources for translation? - asp.net

I have several Visual Studio 2008 projects (ASP.NET 3.5) with many local resource files for localization of strings found in specific ASP.NET pages. Some of them are grouped in folders, some are named based on the page they are localizing, etc.
For example, App_LocalResources folder has a list of .resx files matching ASPX pages, UserControls/App_LocalResources matching ASCX user controls, etc.
Now I need to translate the application to another language and I would like to send all those keys for translation to someone who doesn't have access to the Visual Studio projects.
I could always write a small console app which would recursively find all .resx files and combine them to one big custom XML file which I could then send for translation. Upon receiving the translated XML file, the console app would recreate all small .resx files.
This all isn't a problem, but there must be a better way. What would you suggest, how should I do it?

I'm currently adding .NET support to appTranslator to .NET. The tool helps you easily manage translations of your resources by letting translators work on a single localization project file and creating the satellite DLLs right-away from the translations. I'll let you know when it's ready.

Passolo will automatically extract the default resource strings from exe's and dll's to a "bundle" that you can pass to a translation firm.
We are doing this at my work and it seems to work quite well.
You can exclude/hide strings to translate, add comments for each string and have multiple languages in the same project/bundle.
=======================
This Visual Studio Add in helps extract individual strings to resource files (.resx)
http://resourcerefactoring.codeplex.com/
Resource Refactoring Tool provides developers an easy way to extract hard coded strings from the code to resource files.
Its says its only been developed for VS 2005/2008 but it will be updated for vs 2010 soon.

Write a shell script for extracting all files into an excel. After extracting into excel any can easily manipulate it easily or write a tool for converting resource files to excel.
For Reference:http://www.codeproject.com/Articles/20920/NET-Resource-File-to-Excel-File-Converter

Related

Allowing translation later on ASP.NET

I have an application that has two localization options at the moment through .resx files. I would like to allow other users to translate the website into their own languages as they desire.
1) Is there a way to do so?
2) Or do they have to create a .resx file through some kind of a .resx creator and send it to me so than I can add it to my project?
As asp.net compiles on the fly your web site, you can attach new resx later.
I like Resex as resx file editor because it allows to categorize the resources and help to find not translated strings.

Can I specify which cultures to use when generating local resource files?

I am working on a website that is English by default and optionally in Spanish. I am generating local resource files for each page with language appropriate content for various items.
So far to create my pair of resource files (default and Spanish) for each page, visual studio 2010 generates the first file like default.aspx.resx. I create the Spanish version manually by copying the default file and renaming to default.aspx.es.resx.
Is there a way to have visual studio generate both files for me? I can generate the default file, add controls to the page, and generate again and visual studio is smart to not blow away any work I've done in that file. I would like to be able to also update the Spanish resource file automatically.
There is no tool in Visual Studio (at least I haven't found one when researching the same request), and we dropped the idea of writing smart macros for that purpose that parse resx files and modify other based on changes.
There is, however, a decent free tool that supports creating and aligning resources: Zeta Resource Editor.
You can add files and entries on click, and editing resources is much nicer than in Visual Studio, in addition to quite a few other useful features.

Where should I place resources.resx in a ASP.NET web application?

I'm a newbie with ASP.NET web applications. When I create an ASP.NET web app project, there's a file called resources.resx in the folder My Project. Working in my computer I can access this file and its content without any problem. But when I deploy the application I can't access this file. I've tried copying the file seperately, and the folder (My Project) seperately, with the file in it, but no luck. Is there a way to achieve this?
PS: I've read something about implicit localization and explicit localization but I'd like to know if it can be done this way.
It's embedded into your DLL when you build (compile). So you can't change it when it's deployed.
If you want to see it in your DLL, you'll have to use a tool like Reflector, dotPeek, etc.
You can read more on resources here, starting from the 'Compiling Resources into Assemblies' title (as you know how to use them by now).
Well my suggestion is to use global and local resources.
In production you'll have resx file stored in:
App_GlobalResources: available in all application
App_LocalResources: one for each folder you want resources.
They are XML files visibile and editable.
I use it to allow me to modify string localization resources without recompiling and deploying.
And you can also give a web interface to the end user to allow him to self translate and localize strings at runtime.

Is there a convenient way in VS.NET 2010 to copy new resource file entries from default resx files to specific language resx files?

I can't imagine this hasn't been asked before somewhere because the demand seems obvious: when localizing an ASP.NET website in Visual Studio 2010, I use Resharper to move strings to resx-files in App_LocalResources, copy the default language resx file, rename it to a specific language file, and enter the translations.
However, whenever there are additions to the default language file (because the aspx file changes), I need to copy them manually to the resx file of the specific language.
I guess there is an easy way to do this, a tool, an add-on. Is there?
I've never found anything that was great and did everything i wanted, however I've used this in the past and was ok.
ZetaResourceEditor
Ive also used a web based editor, we had a need for the translators to access the resource files. I think one of my programmers had to fix a couple of bugs with it but might be a good start.
LavaBlast

Is there an example of a custom ResourceProvider for storing RESX files in an external assembly?

We have so, so many RESX files in our ASP.NET 3.5 web application (for localisation purposes) and it's making code changes very slow; every time it runs for the first time all the symbols are built for the re-compiled RESX files.
Ideally I'd like to store these files in an external assembly and create a ResourceProvider that acts as a bridge.
That way the RESX files won't be affected by each subsequent compilation of the web app.
I also don't want to reinvent the wheel; someone must have done this before - but I can't find anything on it!
Actually it looks like reading through this article is going to be a good bet:
http://msdn.microsoft.com/en-us/library/aa905797.aspx
But I'll still hold out in case someone has an example!!

Resources