Results 1 to 4 of 4

Thread: How to make an "open" localizable application ?

  1. #1
    Origami is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Jan 2011
    Posts
    8
    Reputation
    0

    Question How to make an "open" localizable application ?

    Hello,

    I'm currently designing an application that must be localizable. I looked over the Net and on this forum, and I know that I must use Resources files :
    • Default.resx
    • Default.fr-FR.resx
    • Default.en-US.resx
    • ...


    This works if I creates those files and generate the Code.

    But what I need is that a user, say from Italy, or Spain, can add his own Default.<his-language>.resx (or modify the Default.resx), and that the program must read the Resource file when opening the application.

    Unfortunately, when I generate the EXE (and add that the resx file is copied to the bin directory), if I modify a value in the resx file, this value is not displayed on the program (the previous value is displayed).

    So, is there a way to let the user modifies an resx file after the code has been compiled, and the program uses the value of the resx file ?

    Thanks a lot for your help.


    Note : One option for me is to create a TXT file and read the content of this file at the program startup, and put it in an Array. But I'd like to use the Resx files.

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,069
    Reputation
    2801
    So, is there a way to let the user modifies an resx file after the code has been compiled, and the program uses the value of the resx file ?
    To do that you have to replicate what VS does, which is convert the .resx to a .resources file and compile that to a satellite assembly using the .Net tool al.exe, then place the satellite dll in correct directory. Creating Satellite Assemblies
    Converting to .resources file may be done using .Net tool resgen.exe or writing some code using System.Resources namespace.

  3. #3
    Origami is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Jan 2011
    Posts
    8
    Reputation
    0
    Thanks for the reply. The problem is that from what I understand, this means that if someone from another country wants to translate the application in his language, he or I will have to recompile something, which I want to avoid.

    So, I think the easiest solution will be to use a simple text file that will be loaded in an Array at startup. Like this, it will be very easy for the users to translate the application themselves.

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,069
    Reputation
    2801
    It would also be easy for you to include a button in your to update translation for a given .resx file selected by user.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •