Language Packs with Visual Basic 2010?

Status
Not open for further replies.

sk3llgamerZDay

Level 2
Thread author
Verified
Jan 15, 2014
94
Anybody know how I would make a multilanguage software by using language packs and a listbox to change the language? Sorta like what CCleaner(legit) did and Security Shield (rouge) did. (Yes I know they're 2 different things) How do I use language packs with my project using a listbox or whatever to select a language..? If anybody knows, please leave a comment. Thanks - Flames
 
Last edited by a moderator:
  • Like
Reactions: Malware1

SifhX

Level 4
Verified
Jan 26, 2014
188
You can use a XML file

your Xml file should be something like this :

Code:
<main>
<lang>
<lg1>Something</lg1>
<lg2>Something else</lg2>
..
..
..
</lang>
</main>

then write a code like that to load your xml file

Code:
Dim sFileLang As String = Application.StartupPath.ToString & "yourlangfile.xml"
Dim Doc As New XmlDocument
Doc.Load(sFileLang)
For Each lang As Xml.XmlNode In Doc("main")
Dim main As New Dictionary(Of String, String)
For I As Integer = 1 To 2 'here the number of text line you need
lg(I) = lang("lg" & I).InnerText
Next

Finally you can replace text in your sheet as you wish

Code:
me.mycontrol.text = lg(1)
me.myothercontrol.text  = lg(2)


use a combobox for selecting the xml file
use something like that to scan your directory containing the lang file and check if the lang file is the correct one

Code:
Dim Files As New List(Of String)

        For Each F As String In IO.Directory.GetFiles(Application.StartupPath & "\lang\", "*.xml")
            Try
                Dim XML As New XmlDocument
                XML.Load(F)

                If XML("main")("lang")("lg1").InnerXml = "main" Then
                    Files.Add(IO.Path.GetFileNameWithoutExtension(F))
                End If
            Catch ex As Exception
            End Try
        Next

I hope it will help
 
Last edited:
  • Like
Reactions: Malware1

sk3llgamerZDay

Level 2
Thread author
Verified
Jan 15, 2014
94
Thanks! :p I'm too lazy to install Tiranium D: Maybe I should wait till 'em bugs get solved :p
 
Status
Not open for further replies.

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top