Multilanguage support for application using XML-VBForums
Results 1 to 17 of 17

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
    Other side of town 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
    Other side of town 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
    Other side of town 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

  12. #12
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Other side of town 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

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.