Results 1 to 21 of 21

Thread: Multilanguage support for application using XML

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633

    Multilanguage support for application using XML

    Here's a demo project that stores captions and text in XML files. One file per language. The XML format of each file is identical.
    When you switch language in your app a new file is loaded and the captions of buttons and the text of other controls can easily be changed.

    Regards,

    Woof
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    Hi Woka. I am digging this idea to implement language. I can imagine that you could store msgbox text and maybe write a program to parse your .frm file to gather the control names, caption/text values etc. and automate at least the English XML (or whatever language you're writing in!)

    I just wanted to tell you something and I hope that replying to your post is appropriate. I have never been in the code bank before.

    In frmMain.SelectCurrentLanguage, there is a typo where you set the combo box language. It says

    If cboLanguage.ItemData(lngIndex) = lngDefault Then
    cboLanguage.ListIndex = lngDefault
    Exit For
    End If
    But you probably meant:

    If cboLanguage.ItemData(lngIndex) = lngDefault Then
    cboLanguage.ListIndex = lngIndex
    Exit For
    End If
    end war
    stop greed

  3. #3

  4. #4

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633
    U can store text for msgbox's, labels, filenames and other random text.
    Yea, it should be too hard to automate it. Just a small function ijn a module that looks at controls on a form. Not rocket science.

    I have just had a thought. This could be used as an ini file, could do with a write command...Hmmmm.

    Woof

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Multilanguage support for application using XML

    I got an error... "ActiveX control couldn't create..." that kinda thing... Number 91 I think... Don't have VB installed at the moment so I don't remember what it was exactly? Any idea? The reference was OK


    Has someone helped you? Then you can Rate their helpful post.

  6. #6

  7. #7
    New Member
    Join Date
    Jan 2005
    Posts
    6

    Re: Multilanguage support for application using XML


  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Multilanguage support for application using XML

    Quote Originally Posted by Wokawidget
    You got MS XML installed?

    Woka
    I guess? The reference is OK, it doesn't say missing or anything like that. In the autocomplete list in the code, in the declaration :

    VB Code:
    1. Private mobjDOM As DOMDocument40

    I see DOMDocument40... Is there something else that I should download or need?


    Has someone helped you? Then you can Rate their helpful post.

  9. #9

  10. #10
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Multilanguage support for application using XML

    Version 5 is referenced...


    Has someone helped you? Then you can Rate their helpful post.

  11. #11

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633

    Re: Multilanguage support for application using XML

    Errrr...v5???

    Are you sure?
    I thought the latest was v4, didn't even know about v5.
    Can't find anything on google

    Here's a screenshot of my references.

    Wka
    Attached Images Attached Images  

  12. #12
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Multilanguage support for application using XML

    I'm way ahead of my times
    Attached Images Attached Images  


    Has someone helped you? Then you can Rate their helpful post.

  13. #13
    Banned
    Join Date
    Jul 2007
    Posts
    400

    Re: Multilanguage support for application using XML

    It's a really shame because vb6 only support ANSI. Are there any 3rd party control that it will support unicode??






    Thanks,
    Mark

  14. #14

  15. #15
    New Member
    Join Date
    Oct 2009
    Posts
    2

    Re: Multilanguage support for application using XML

    Hi all, im new here I'm VB6 user and I'm trying to build multilanguage app using Woka's demo but i have an issue with Cyrillic characters - instead of "вщь" i can see only "???". Other languages like polish (with ł,ą,ę etc ) or english works fine. Thanks for replays.
    Last edited by grzechog; Oct 27th, 2009 at 04:29 AM.

  16. #16
    New Member
    Join Date
    Jun 2009
    Posts
    1

    Re: Multilanguage support for application using XML

    @ grzechog , yes you can use cyrillic just save the *.xml file in Utf-8 encoding (for this i used Notepad++).
    @ Wokawidget, thanks for the code.

  17. #17

  18. #18
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    520

    Re: Multilanguage support for application using XML

    Hello
    yes this is very old, but I'm very interested in multilanguage support.
    I'm here to ask if anyone has implemented this (using XML-like technique)
    I've looked at ways that use the resource file but it seems to me that this method is better.

    I also took a quick look at the Tanner method which seems the best although quite complicated.
    First it scans the project by looking for strings and create the master.xml file
    https://github.com/tannerhelland/Pho...ML%20generator
    Then, from what I understand, in the main project, every time a string must be displayed, function g_Language.TranslateMessage is called, so that the string is translated using the XML file of the selected language.

    Apart from this, I'm very interested in every kind of solution.
    Do you have any ideas?
    Do you have already implemented multilanguage application?

    I would be very grateful if you can post some examples

  19. #19
    Addicted Member
    Join Date
    Jun 2016
    Location
    Espaρa
    Posts
    163

    Re: Multilanguage support for application using XML

    Hello.
    I think of another way instead of xml files because I do not json.
    dilettante has a very simple class module to navigate the contents of the json.
    http://www.vbforums.com/showthread.p...rser-Generator

    a greeting
    sorry for my language

  20. #20
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,655

    Re: Multilanguage support for application using XML

    Hello,
    here the re is thread where we are discussing this same issue.

  21. #21
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    520

    Re: Multilanguage support for application using XML

    Quote Originally Posted by Eduardo- View Post
    Hello,
    here the re is thread where we are discussing this same issue.
    thank you
    yes, I'm reading it, interesting solutions, pity no tools / code still present

Posting Permissions

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



Click Here to Expand Forum to Full Width