Zinx
Zinx

Reputation: 2349

Multilingual windows application using C#.NET

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 :)

Upvotes: 2

Views: 2106

Answers (6)

Anders Rune Jensen
Anders Rune Jensen

Reputation: 3806

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.

Upvotes: 1

PVitt
PVitt

Reputation: 11770

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.

Upvotes: 1

Stefan Steinegger
Stefan Steinegger

Reputation: 64648

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.

Upvotes: 1

PoppaVein
PoppaVein

Reputation: 659

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.

Upvotes: 1

Charlie Salts
Charlie Salts

Reputation: 13508

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.

Upvotes: 1

epotter
epotter

Reputation: 7799

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.

Upvotes: 1

Related Questions