It is currently Fri Dec 13, 2019 8:23 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: CLC Multifile Converter
PostPosted: Tue Feb 26, 2013 2:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
Hi to all

Here is CLC Multifile Converter, with which you can translate a purebasic project in one language to another ie russian to english to french or german etc (strings & comments)

All files (.pb .pbi) are loaded sequentially & parsed for the comments and string (in quotes) to be converted, the app has its own web gadget, set to google translate webpage.

Webgadget is disabled until a source is provided and the destination ( clicking source button opens requester for the source project and then automatically opens path requester for destination (your choice, create a new folder in the existing source project folder or where ever you want to) all parsed and processed file are created and saved in the destination folder with identical filename`s.

Operation.

1. once source & destination, the webgadget becomes enabled
2. in webgadget right mouse click and paste, google translate translates :lol: "please make sure that you have the correct language (source & target) at this point. you can quickly view the translation giving you an idea if thing are translated ok)
3. scroll to bottom of translation gadget (click the highlight box or manually select all translated text) right mouse button click copy ( a message requester with pop up showing the first few lines if correct click yes ) and the file will be translated and saved to destination directory.

4. the next file will automatically be loaded parsed and then via status bar (flashing) indicate ready for the next paste and copy sequence ie( 1 to 3) untill all files translated.

should you or another program take ownership of the clipboard ie (Prt Sc SysRq) capture screen button. leave the clc requester in a static state, paste into MS Paint the captured screen image etc , when done click CLC requester`s "No button" to continue, click copy in the translated part of the webgadget and continue as before.

bugs improvements requests idea etc welcome

Zebuddi. :D

md5 fada4479f38b06842ded62ad5eb31711

http://goo.gl/jhDBE

Image

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Wed Feb 27, 2013 8:17 am 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 22, 2004 4:12 pm
Posts: 2448
Location: Norway
Nice idea! :D
I haven't tested it myself yet, but I think I see a bug in the picture you posted (the constants).

_________________
I like logic, hence I dislike humans but love computers.


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Thu Feb 28, 2013 7:17 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
That would be a problem if it altered constants but hopefully it wont unless in " #Oh_No " :lol:

Michel51 is porting CLC to Mac (and i believe linux) for those on these OS`s who maybe interested :shock: :lol:


Would be nice if we had some responses from anyone who has used it to find out if it worked for them, there is some great code out there in other unreadable languages (for me anyway) like pbtorrent thats why i created clc


Zebuddi. :D

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Mon Mar 04, 2013 12:34 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Apr 06, 2008 12:54 pm
Posts: 379
Location: Brisbane, Qld, Australia
Zebuddi123 wrote:
Would be nice if we had some responses from anyone who has used it to find out if it worked for them...

I'm interested in the idea of using Google Translate like this, but CLC doesn't look like it will suit my requirements. I've implemented multi-language support using code based on freak's An easy to use solution for multilanguage programs, so I have a separate language .pbi file for each supported language. These files contain data statements containing 'names' and 'strings', eg

Code:
  Data.s "_GROUP_", "DriveType"
  Data.s "Unknown", "The drive type cannot be determined"
  Data.s "Invalid", "The root path is invalid; for example, there is no volume mounted at the specified path"
  Data.s "Removable", "The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader"
  Data.s "Fixed", "The drive has fixed media; for example, a hard disk drive or flash drive"
  Data.s "Remote", "The drive is a remote (network) drive"
  Data.s "CD-ROM", "The drive is a CD-ROM drive"
  Data.s "RAM", "The drive is a RAM disk"
; etc

Only the 'strings' must be translated. So although the concept of CLC is good, I would need a version that handles data statements in this way.

_________________
Mike
www.showcuesystems.com


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Mon Mar 04, 2013 11:30 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 21, 2005 10:21 pm
Posts: 290
Location: Germany
ozzie wrote:
Zebuddi123 wrote:
Would be nice if we had some responses from anyone who has used it to find out if it worked for them...

I'm interested in the idea of using Google Translate like this, but CLC doesn't look like it will suit my requirements. I've implemented multi-language support using code based on freak's An easy to use solution for multilanguage programs, so I have a separate language .pbi file for each supported language. These files contain data statements containing 'names' and 'strings', eg

Code:
  Data.s "_GROUP_", "DriveType"
  Data.s "Unknown", "The drive type cannot be determined"
  Data.s "Invalid", "The root path is invalid; for example, there is no volume mounted at the specified path"
  Data.s "Removable", "The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader"
  Data.s "Fixed", "The drive has fixed media; for example, a hard disk drive or flash drive"
  Data.s "Remote", "The drive is a remote (network) drive"
  Data.s "CD-ROM", "The drive is a CD-ROM drive"
  Data.s "RAM", "The drive is a RAM disk"
; etc


Only the 'strings' must be translated. So although the concept of CLC is good, I would need a version that handles data statements in this way.

Hi ozzie,
This is not possible, actually.
The application translates all string, that are separated by the character ' " ' :!:
If it is possible to separate the 'name' with another character, it would work.
But I think the "data" statement can be used only with doublequotes.

How the application should know which string should be translated and which not if the separators all are the same ?
It's very difficult.

_________________
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Thu Aug 22, 2013 10:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Feb 03, 2011 7:44 pm
Posts: 195
When ever I open this it just closes?
Win 7 Ultimate x86


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Fri Aug 23, 2013 7:06 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
Hi Nubcake, sorry didnt see your post.

Yes something change a while back around pb 5.11 release. this worked fine prior. now compiling the source code, when google translate page loads in the webgadget it instantly requests installation of flashplayer, should should i decline it closes the program done even in debug mode :shock: had a couple of plays with the source code (thought maybe i had a virus) put it through procmon to analyise the program exectution and the calls seem to be to ligit adobe/google sites. Cant analyse the page when loaded in the webgadget as administrator requester stop me viewing web page source then closes it to fast.

I`ll have another try soon and make sure its 5.20 compat.

Zebuddi.

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Sun Aug 25, 2013 3:44 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
CLC now abandoned --- Google it seems has implemented something to disallow how CLC works with google translate web page. Have tried to Implement with Bing translate but also having issues :cry: :(


Zebuddi.

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Mon Mar 10, 2014 3:59 pm 
Offline
New User
New User

Joined: Tue Nov 27, 2007 12:19 am
Posts: 6
Location: Scotland
Hey Zebuddi,

Thats a pity you have decided to abandon this useful program, as it seems like a very useful tool.

Maybe you could release your source code so I could have a go at trying this sort of thing for myself.

cheers

Dazboa


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Fri Mar 14, 2014 9:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
Hi Dazboa Here is a new version x32 & x64
Image
1. On program start filerequester is opened select a pb/pbi file
2. Browser will open at google translate the processed pb source code file will already be on the clipboard
3. paste into google translate select a language to translate
4. after translation highlight translated section and copy. the program monitors the clipboard for change the 1st line of the pasted data contains CLCDATA4102 this is to identify the correct data set and
is remove from the listicon view. so the program will only continue when the correct data set id is on the clipboard.
6. the main gui opens up as above image
7. double LMB click comments or quoted string in the listviews to bring up the editor
Image
8. edit chosen comment or quoted strings. on closing the edit window changed data is saved
9. select all required translations via checkboxes
10. press sent to IDE button and the ide will open with translated code

Program will remain open and can be re edited and sent to ide as many times a required.
source in IDE is opened as a temp file so must be save to permanent file.
all data in quotes "bla bla" etc are collected provided that they run in the range a-z A-Z 0-9 with in the quotes, all comments are parsed.
problems can arise from ie openfilerequester() where *.pb|*.pbi becomes . * pb | . * PBi after translation, so is best to scan through all quoted strings
to reduce potential problems.
Its not perfect but it a lot quicker than manual work lol

Zebuddi. :)

Windows x86 x64
MD5 2e75f1ea9f78998d44896fccfe9516c7
https://dl.dropboxusercontent.com/u/71891332/clc_translate.zip

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: CLC Multifile Converter
PostPosted: Sat Mar 15, 2014 2:47 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 753
Location: Nottinghamshire UK
Update This version as an IDE tool. "%FILE" as argument. Also fixed googles path ajustment in translation.

Windows x86 x64
MD5 a04bd00b7d14242d005483d761d8e7f5
https://dl.dropboxusercontent.com/u/71891332/clctrans_idetool.7z

Zebuddi. :)

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye