1
votes

We have a website project that is being localized to 30+ languages.

The project is split into PLL, BLL & DAL.

We have over a hundred .resx files located in various different folders in the base language (English).

We use a separate system for localization which spits out all the language files in the correct format/directory automatically.

Once finished there will be thousands of files to import into the visual studio project!

This will become a nightmare to manage :(

Is there any way to compile the localized files separately into Satellite Assemblies and then copy them into the project later?

I just want to work with the English files only in the main VS project and not see all the localized files.

1
Can't you edit the *.csproj file automatically after creating these resources? Csproj is an xml, your automata can edit it easily. - Wiktor Zychla
I agree with @WiktorZychla, csproj files are rather easy to edit programmatically. In the long run it will often pay to keep your translations in the projects that use them. Translations should be bespoke as possible for the application that uses them. The UI is often seen as a branding artifact and a guy-in-a-tie will change it on a whim if s/he wants, toppling your tidy but delicate translation hierarchy. - Gusdor
You're missing the point of the question. I want to keep the localized files outside the project. This is best practice when localizing - you should only ever work with the neutral base language in our project. - George Filippakos

1 Answers

1
votes

You can create another project that houses only the localized resource files - build these into Satellite Assemblies and then copy them into your main project.

For example:

Create a new project in your existing solution eg: myApp.Localized

Then change the assembly name to match the name of the main application (myApp) and change the default namespace (C#) or the root namespace (Visual Basic) to match the default or root namespace of the main application (myApp).

Now when you build the myApp.Localized project it will create the satellite assemblies for each language-culture in the bin folder.

A Satellite Assembly for each language will be located in a subfolder within the bin.

Copy each language folder into your main application bin when you are ready to deploy the project. (the assemblies must reside inside the named language folders)

Repeat the above for each project (DAL, BLL, PLL)

This allows you to work with the Neutral language in your main project and keep all other languages in a separate project. Thus reducing complexity, build time and clutter in the project!

You can find more information at:

http://visualstudiomagazine.com/articles/2005/01/01/make-the-best-of-net-resource-files.aspx