Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader("c:\Users\user\Downloads\Game.Dev.Tycoon.v1.6.15\Game.Dev.Tycoon.v1.6.15\compressed\codeNw_orig.js")
- Dim fileReader As String
- Dim out As String = ""
- Dim tmp_out As String = ""
- Dim orig As String = ""
- Dim original As String
- Dim preklad As String
- Dim counter As Integer
- Dim orig_counter As Integer
- Dim readercs As StreamReader = My.Computer.FileSystem.OpenTextFileReader("c:\Users\user\Downloads\Game.Dev.Tycoon.v1.6.15\Game.Dev.Tycoon.v1.6.15\compressed\preklad_cs.txt")
- Dim idx(5) As Integer
- Do
- fileReader = reader.ReadLine
- tmp_out = ""
- If fileReader Is Nothing = False Then
- REM Console.WriteLine("Line:" & fileReader)
- If fileReader.Contains(""".localize") Then
- Dim result As String() = fileReader.Split(New String() {".localize"}, StringSplitOptions.None)
- REM Console.WriteLine(result.Length)
- counter = 0
- For Each s As String In result
- REM Console.WriteLine("Split:" & s)
- counter = counter + 1
- For i = 0 To s.Length - 1
- If s(i) = Chr(34) Then
- idx(1) = idx(0)
- idx(0) = i
- End If
- Next
- If s.EndsWith(Chr(34)) And counter <> result.Length Then
- REM Console.WriteLine("Nasel:" & s)
- REM Console.WriteLine("Orig:" & s.Substring(idx(1) + 1, idx(0) - idx(1) - 1))
- original = s.Substring(idx(1) + 1, idx(0) - idx(1) - 1)
- preklad = readercs.ReadLine
- s = s.Replace(original, preklad)
- Console.WriteLine("Orig:" & original & " Preklad:" & preklad)
- s = s & ".localize"
- End If
- tmp_out = tmp_out & s
- orig_counter = orig_counter + 1
- REM Console.WriteLine("TMP:" & tmp_out)
- Next
- Else
- tmp_out = fileReader
- End If
- REM Console.WriteLine("Line:" & tmp_out)
- out = out & tmp_out & vbNewLine
- End If
- Loop Until fileReader Is Nothing
- reader.Close()
- My.Computer.FileSystem.WriteAllText("c:\Users\user\Downloads\Game.Dev.Tycoon.v1.6.15\Game.Dev.Tycoon.v1.6.15\compressed\codeNw.js", out, False)
- Console.WriteLine("hotovo")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement