[Q] Resource files ...

P

Peter Lykkegaard

Hi

I have been messing around with some plugins for the Screwturn Wiki engine
http://www.screwturn.eu/

Basically a plugin is one or more classes in an DLL which is loaded at
runtime
I'd like to be able to use my own resource files but at the same point allow
other users to add new translations without the need of recompiling
sattelite assemblies or embed the resource files in my DLL

Design considerations
1) I need to be able to load and use resource files for languages which
might not are supported OOB
2) No extra work should be done other than copy the invariant version and
add the language tag when a new language is added

I have found that ResXResourceSet to a degree can help me in my quest but I
was just wondering wether the path I've chosen can leed me to a dead end
with a chance of getting completly lost :)

When using ResXResourceSet I need to check for missing languages "manually"
(not implemented atm)

Atm I have this snippet of code (done in C#)
----------------------------------
Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
String resxFile = String.Empty;
String resxFileName = host.GetSettingValue(SettingName.PluginsDirectory);
resxFileName += assembly.GetName().Name + @".Properties.Messages.";
resxFile = resxFileName + host.GetSettingValue(SettingName.DefaultLanguage)
+ @".resx";
resource = new ResXResourceSet(resxFile);
----------------------------------

NB the function GetSettingValue and the enum SettingName is specific to the
wiki engine
You can replace with a fixed text for testing purposes if you like

Any ideas/considerations?
Thanks in advance

- Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top