Page 1 of 1

Convert any comments in source code to another language

Posted: Thu Jun 21, 2012 2:40 pm
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

Re: Convert any comments in source code to another language

Posted: Thu Jun 21, 2012 4:46 pm
by IdeasVacuum
That is really sweet Zebuddi123, works extremely well. Mind you, Goggle is not very good at Chinese :mrgreen:

Re: Convert any comments in source code to another language

Posted: Thu Jun 21, 2012 5:05 pm
by Zebuddi123
Thanks glad its of use and the chinese 也不是我 your right just tried it :shock:

Zebuddi. :lol:

Re: Convert any comments in source code to another language

Posted: Fri Jun 22, 2012 1:43 pm
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?

Re: Convert any comments in source code to another language

Posted: Fri Jun 22, 2012 5:45 pm
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

Re: Convert any comments in source code to another language

Posted: Fri Jun 22, 2012 7:58 pm
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

Re: Convert any comments in source code to another language

Posted: Fri Jun 22, 2012 11:19 pm
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).

Re: Convert any comments in source code to another language

Posted: Sat Jun 23, 2012 8:37 am
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.

Re: Convert any comments in source code to another language

Posted: Mon Jul 02, 2012 1:14 am
by IdeasVacuum
... add for support .pbi | .txt | *.* file extensions ?

Re: Convert any comments in source code to another language

Posted: Mon Jul 02, 2012 9:26 am
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.

Re: Convert any comments in source code to another language

Posted: Thu Feb 18, 2016 1:04 pm
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.

Re: Convert any comments in source code to another language

Posted: Wed Jun 01, 2016 5:06 pm
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. :)