[Q] Resource files ...

Discussion in 'ASP .Net' started by Peter Lykkegaard, Jul 19, 2008.

  1. 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
     
    Peter Lykkegaard, Jul 19, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dirc Khan-Evans
    Replies:
    1
    Views:
    914
    Karl Seguin
    Oct 17, 2005
  2. avishosh
    Replies:
    2
    Views:
    10,625
    avishosh
    Aug 8, 2004
  3. Jackie
    Replies:
    3
    Views:
    521
    rossum
    Jan 28, 2006
  4. Heinrich Moser
    Replies:
    1
    Views:
    467
    Heinrich Moser
    Mar 27, 2008
  5. Ole Hanson

    <scr> tag and image files embedded in resource files? (how)?

    Ole Hanson, Jan 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    186
    Steve C. Orr [MVP, MCSD]
    Jan 10, 2005
Loading...

Share This Page