Some translations errors in vbs2js script

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

crap_inhuman
Posts: 933
Joined: Sat Jan 26, 2013 6:00 am
Location: Friedberg / Hessen / Germany
Contact:

Some translations errors in vbs2js script

Post by crap_inhuman »

Hi,

i tested the VBS2JS script and found some translation errors.
I hope these examples can help to improve the converter script.

REM will not be converted to //

bad JS-line:
Label.style.position='absolute'; Label.style.left=(5; Label.style.top= 5; Label.style.width= 60; Label.style.height= 20);
should be:
Label.style.position='absolute'; Label.style.left=5; Label.style.top= 5; Label.style.width= 60; Label.style.height= 20;

VB-line:
html = html & "<div id=""" & .ID & """ class=""track"">"
bad JS-line:
html = html + "<div id=\"" + tracks.iD + \"" class=\"track\">"
should be:
html = html + "<div id=\"" + tracks.iD + "\" class=\"track\">"

VB-lines:
With tracks.item(TrackID.Item(TrackCount))
Artist = .ArtistName
Title = .Title
Album = .AlbumName
End With
bad JS-lines:
Artist = tracks[TrackID.getValue(TrackCount]).artist
Title = tracks[TrackID.getValue(TrackCount]).title
Album = tracks[TrackID.getValue(TrackCount]).album
should be:
Artist = tracks[TrackID.getValue(TrackCount).artist]
Title = tracks[TrackID.getValue(TrackCount).title]
Album = tracks[TrackID.getValue(TrackCount).album]

VB-line:
If Artist = "" or Album = "" Then
bad JS-line:
if(Artist == "" || Album == \"){
should be:
if(Artist == "" || Album == ""){

VB-line:
Artist1 = cleanArtistBefore(LCase(Replace(Artist, " ", "")))
bad JS-line:
Artist1 = cleanArtistBefore(((Artist).replace( " ", \")).toLowerCase())
should be:
Artist1 = cleanArtistBefore(((Artist).replace( " ", "")).toLowerCase())

VB-line:
Do while 1 = 1
bad JS-line:
while(1 = 1) {
should be:
while(1 == 1) {

VB-line:
Set t = doc.getElementById(tracks.item(TrackID.Item(TrackCount)).ID)
bad JS-line:
t = doc.getElementById(tracks[TrackID.getValue(TrackCount]).iD)
should be:
t = doc.getElementById(tracks[TrackID.getValue(TrackCount)].iD) ???

VB-line:
TXTBegin = InStr(ResponseHTML, "\" & Chr(34) & ">")
bad JS-line:
TXTBegin = (ResponseHTML).indexOf( "\" + String.fromCharCode(34) + ">")
should be:
TXTBegin = (ResponseHTML).indexOf( "\"" + String.fromCharCode(34) + ">")

VB-line:
ResponseHTML = Mid(ResponseHTML, InStr(ResponseHTML, ",")+1)
bad JS-line:
ResponseHTML = (ResponseHTML).substr( ( ").indexOf(", ResponseHTML)+1)
should be:
ResponseHTML = (ResponseHTML).substr( (ResponseHTML).indexOf(",")+1)

VB-line:
lyrics = Replace(lyrics, "</div>", "")
bad JS-line:
lyrics = (lyrics).replace( "</div>", \")
should be:
lyrics = (lyrics).replace( "</div>", "")

VB-line:
tmp = Split(ResponseHTML, ",", 3)
bad JS-line:
tmp = (ResponseHTML).( ").split(", 3)
should be:
tmp = (ResponseHTML).split(",", 3)


VB-line:
If bdebug And lyricFound = False Then
bad JS-line:
if(bdebug && lyricFound == = false){
should be:
if(bdebug && lyricFound == false){

VB-line:
Set LyricsForm = SDB.UI.NewForm
LyricsForm.Common.SetRect 100, 100, 800, 500
LyricsForm.FormPosition = mmFormScreenCenter
LyricsForm.StayOnTop = True
LyricsForm.Common.Visible = True
LyricsForm.Caption = "Lyrics"
Set SDB.Objects("LyricsForm") = LyricsForm
bad JS-line:
LyricsForm = app.dialogs.openDialog('empty', {show: true})
function () { { LyricsForm.getValue('closeWindow')(); }; LyricsForm.onloaded=function(){
LyricsForm.bounds.setBounds((100, 100, 800, 500));
//LyricsForm.formPosition = mmFormScreenCenter
LyricsForm.atTop = true
LyricsForm.show()
LyricsForm.title = "Lyrics"
thisWindow.setValue("LyricsForm", LyricsForm);
should be:
???
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.

Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
PetrCBR
Posts: 1763
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech
Contact:

Re: Some translations errors in vbs2js script

Post by PetrCBR »

Thanks. Will check them out.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
Post Reply