Convert any comments in source code to another language

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:

Convert any comments in source code to another language

Post by Zebuddi123 »

mac version sometime today!!! :D

Update 23/6/12
Linux 32bit added
MD5 f7990b162caa2cb02c2a585280cb0d18
http://goo.gl/2sBMI

Zebuddi. :shock:

X64 bit added
MD5 96ff71c1d9b9e8351cee31e39afdeabb
http://goo.gl/zsC8F


Hi to All.

I have written a tool to convert any comments in any language in the source files to another language via google translate.

Image
Image
Image

Operation

1. load a pb source file ( comments are automatically stripped form the file and copied to the clipboard
2. your browser is automatically opened at google translate page
3. click paste in the google translate page
4. process translation to the language of your choice
5. select highlight all the strings in the translation page and click copy
6. click the paste translated comments button in the app
7. original file is backed up and the new source file with the same name is created with the translated comments and opened in PB Ide
job done.

any comments requests etc welcome

adding more enhancements in next version

free to use

MD5 45b9265c32e19ec9ceb702ca16f09561

http://goo.gl/TdXA9

Zebuddi. :D
Last edited by Zebuddi123 on Sat Jun 23, 2012 3:21 am, edited 2 times in total.
malleo, caput, bang. Ego, comprehendunt in tempore
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Convert any comments in source code to another language

Post by IdeasVacuum »

That is really sweet Zebuddi123, works extremely well. Mind you, Goggle is not very good at Chinese :mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: Convert any comments in source code to another language

Post by Zebuddi123 »

Thanks glad its of use and the chinese 也不是我 your right just tried it :shock:

Zebuddi. :lol:
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Convert any comments in source code to another language

Post by michel51 »

Good job! Thanks for sharing.
I tested the app on Mac with an emulator (virtual Box + Windows XP) and it runs fine.
Is it possible to port this to Mac, so it's running native with OS X?
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: Convert any comments in source code to another language

Post by Zebuddi123 »

Yes Possibly i have mac and linux too just dont use them much :shock: i`ll hook the mac up later today tomoz and recompile for mac and linux and post them

Zebuddi :D
malleo, caput, bang. Ego, comprehendunt in tempore
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Convert any comments in source code to another language

Post by Zach »

Google can't be good at "Chinese" because "Chinese" is a label affixed to a bucket full of different languages spoken throughout China
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Convert any comments in source code to another language

Post by IdeasVacuum »

It's true that China is a land of many languages, but there are only two official languages, Mandarin (all of China) and Cantonese (Hong Kong and Guanxi region).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Convert any comments in source code to another language

Post by michel51 »

Zebuddi123 wrote:Yes Possibly i have mac and linux too just dont use them much :shock: i`ll hook the mac up later today tomoz and recompile for mac and linux and post them

Zebuddi :D
I'll wait.... :)
The app would be more perfectly, if it is able to translate the quoted strings too (see example)

Code: Select all

 Message$ + "Ligne: " + Str(XMLErrorLine(#XML)) + "   CaractÈre: " + Str(XMLErrorPosition(#XML))

MessageRequester("Information","Sauvegarde effectuÈe.")  
That is all strings in quotes, defined in vars or written in requester, are not converted yet.
Hope it's not a big problem.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Convert any comments in source code to another language

Post by IdeasVacuum »

... add for support .pbi | .txt | *.* file extensions ?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: Convert any comments in source code to another language

Post by Zebuddi123 »

Hi IdeasVacuum

Yes I`am doing, just had a set back with some translations of the strings (Google translates a bugger for reordering some char`s about) going to remove some procedures (parts of) with strings from the translation

hope to make it modular with plugins for other languages C, C++ Java etc.

looking into possibly use translate api directly.

see where it develops from there.


Zebuddi. :)

Ps just finishing off my brothers "Laser Tattoo Removal --- Business software" then i will be concentrating on this full time as its only been done in bits and bobs so far.
malleo, caput, bang. Ego, comprehendunt in tempore
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Convert any comments in source code to another language

Post by Joris »

michel51 wrote:I tested the app on Mac with an emulator (virtual Box + Windows XP) and it runs fine.
I still work on XP (32 bit) on a PC and it doesn't run here.
Any chance you compile it for XP (or open the source) ?

Thanks.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: Convert any comments in source code to another language

Post by Zebuddi123 »

Hi Joris only just seen this post. If your still interested the code is at http://www.purebasic.fr/english/viewtop ... lc#p459540


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