Reputation: 3506
Good morning,
I am interested in developing an application which supports external GUI translation files to be added as desired by the users. I thought about using the localization methods built into .NET, but I think this way I cannot distribute isolated files with translations (can I?) after the application is built.
What is the better way to achieve localization using external files in C#?
Thank you very much.
Upvotes: 1
Views: 1125
Reputation: 3532
If you don't want to recompile the files later you can use something like the folowing.
Example xml:
<doc>
<loc name="English">
<form name = "main">
<okButton>OK</okButton>
....
</form>
<form name = "about">
<lblAuthorName>Author's name: </lblAuthorName>
....
</form>
</loc>
<loc name="Ukrainian">
<form name = "main">
<okButton>Добре</okButton>
....
</form>
</loc>
</doc>
Upvotes: 1
Reputation: 12713
I've seen a lot of people implementing their own localization system for .net, but personally, I would stay with the built in structure.
Now, you can just add additional .resx files and recompile the app afterwards. But I guess this is not what you want?
Or you can implement your own Resource Provider and for example get all localization strings from a DB.
Example:
http://msdn.microsoft.com/en-us/library/aa905797.aspx#exaspnet20rpm_topic4
Upvotes: 6
Reputation: 2566
You can use .NET localizations without any issues.
After you sucessfully localized yopur appliation files, in your application folder will contain subfolders for you localized versions of assembly resources. So after adding new language into localizations, you can distrubute these new DLLs to your castomers from folder for your newly added localizations.
Cheers ;)
Upvotes: 3