views:

724

answers:

6

Hi All,

I am working on an application in C#, I want to make it multilingual. I have 2 options for that first, creating seperate resource file for all class files, second creating one common resource file for whole application.

I am not sure which option is best, so can somebody advise me regarding this?? If there is any other way of achieving multilingual functionality then also please let me know.

Cheers :)

+1  A: 

In my experience, it is easier to have all of your localized resources in one place. Often, an application will have strings that are used in several places. If you have all of your resources in one place, you will only have to translate the repeated string once.

epotter
+1  A: 

I prefer to use the built-in localization feature included in the IDE. It can be finicky but it gets the job done. It generates a separate DLL for each language.

In cases where I have non-UI strings, I have a single XML file containing all languages with language strings tied to unique identifiers.

Charlie Salts
+1  A: 

I've used "Multi-Language Add-In" from Softwarebuero Jollans (http://jollans.com/tiki/tiki-index.php). It's a commercial product that's quite well supported. You can export strings from your application in Visual Studio to an Excel spreadsheet to be translated, and then re-import the spreadsheet to your application. Languages will then be automatically compiled into embedded resources.

+1  A: 

I would create a single resource file in each assembly (where needed).

You can let VS create a class for the resource file, which allows compile-time-safely accessing the resources. (You get a property for each string.) I think you do this with the Build Action. The generated class is internal. So resources are accessed only within the assembly, which makes sense.

Stefan Steinegger
+1  A: 

Use one resource file and be sure you have all your forms and components marked as localizable. With this done you have the ability to use several third party tools to localize your application.

We use Visual Localize at work. Not that you just can export your text resourcess and reimport after translation, you can also resize or rearrange dialogs to fit the new text sizes. E.g. german is one and a half time longer than the same text in english.

PVitt
+1  A: 

We wrapped gettext and used that. The positives being that one can just add a new translation and everything works. One can change language on the fly. And that it easy for translators because one can just send them a simple text file that they can edit.

We didn't release or put it out into a project yet, but we might do that if people find it interesting.

Anders Rune Jensen