CLC Multifile Converter

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

CLC Multifile Converter

Post by Zebuddi123 »

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
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: CLC Multifile Converter

Post by Joakim Christiansen »

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.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: CLC Multifile Converter

Post by Zebuddi123 »

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
ozzie
Enthusiast
Enthusiast
Posts: 429
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: CLC Multifile Converter

Post by ozzie »

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: Select all

  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.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: CLC Multifile Converter

Post by michel51 »

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: Select all

  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
Nubcake
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Feb 03, 2011 7:44 pm

Re: CLC Multifile Converter

Post by Nubcake »

When ever I open this it just closes?
Win 7 Ultimate x86
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: CLC Multifile Converter

Post by Zebuddi123 »

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
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: CLC Multifile Converter

Post by Zebuddi123 »

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
tryforsure
New User
New User
Posts: 6
Joined: Tue Nov 27, 2007 12:19 am
Location: Scotland

Re: CLC Multifile Converter

Post by tryforsure »

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
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: CLC Multifile Converter

Post by Zebuddi123 »

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/718 ... nslate.zip
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: CLC Multifile Converter

Post by Zebuddi123 »

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/718 ... idetool.7z

Zebuddi. :)
malleo, caput, bang. Ego, comprehendunt in tempore
Post Reply