Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend C# file based resource manager

I want to store my resources in a different file format than NET's .resources (in particular, .po), so I wrote a custom resource set with a custom resource reader to retrieve them. I created a ResourceManager using the CreateFileBasedResourceManager static method which creates a new instance of the manager that retrieves resource sets from files in a specific dir, using the specified resource set (the custom one I wrote in my case), using Name.culture.resources filenames.

However, I would like to change the filename convention. I noticed there is an overridable GetResourceFileName method for precisely that purpose. But using reflector I noticed that the constructor used by CreateFileBasedResourceManager is private, and it is impossible to set the "use files instead of assemblies" flag otherwise.

Is there any way to go around this, without needing to reimplement the whole InternalGetResourceSet method?

Thanks a lot!

like image 297
Santiago Palladino Avatar asked Nov 04 '09 14:11

Santiago Palladino


People also ask

Can we extend C drive?

To expand system partition (C: driver) size Before expanding C drive size, need to confirm there is unallocated space next to C drive. Right click on C drive then select “Extend volume”, then follow the onscreen instruction to finish the process.

Why can't I extend my C?

If you can't extend volume, like cannot extend volume in C drive, don't worry. Open Windows Disk Management, check the state of your disk partition, and the listed reasons below. You'll find why is the Extend Volume option greyed out on your computer: There is no unallocated space on your hard drive.


1 Answers

Mono has good little utility that helps with this, its called Msgfmt, which can be used to create .resources files out of .po files directory.

Msgfmt.exe -iMessages.es.po -oMessages.es.resources

I came across an interesting article @ http://weblogs.manas.com.ar/spalladino/2009/10/01/using-gnu-gettext-for-i18n-in-c-and-asp-net/ which helped me and it might well help you too..

Its a different approach but it worked for me!

  • ref: http://www.mono-project.com/I18nGettext
  • ref: http://www.mono-project.com/I18N_with_Mono.Unix
like image 102
Stephen Gennard Avatar answered Oct 05 '22 18:10

Stephen Gennard