Page 8 of 14
Re: Windows Services & Other Stuff
Posted: Wed Jan 15, 2020 5:00 am
by JHPJHP
Hi Wolf,
You are most welcome.
-------------------------------------------
Updated:
- numerous improvements, bug fixes, and a few additions since my last post
NB*: See the first post for a complete list of examples.
Re: Windows Services & Other Stuff
Posted: Sun May 31, 2020 4:12 am
by JHPJHP
Updated:
- numerous updates and some bug fixes
Since the release of
PureBasic 5.72 LTS Beta 1 (thank you
Fred,
Freak &
Team) I proceeded to test every example, updating and patching as required.
NB*: Some examples may not work in older versions of PureBasic.
-----------------------------------------
Updated:
-
added \Other_Stuff\OtherStuff\CommandConsole\ReadOutput.pb
-
added \Other_Stuff\OtherStuff\GoogleTranslate.pb
-
added \Other_Stuff\OtherStuff\WindowsMagnificationAPI.pb
Read Output: Based on a question
posted by
tatanas.
Google Translate: Based on a question
posted by
ricardo.
Windows Magnification API: Based on a question
posted by
BarryG.
Re: Windows Services & Other Stuff
Posted: Mon Jun 01, 2020 8:08 pm
by ricardo
JHPJHP wrote:Updated:
- numerous updates and some bug fixes
Since the release of
PureBasic 5.72 LTS Beta 1 (thank you
Fred,
Freak &
Team) I proceeded to test every example, updating and patching as required.
NB*: Some examples may not work in older versions of PureBasic.
-----------------------------------------
Updated:
-
added \Other_Stuff\OtherStuff\CommandConsole\ReadOutput.pb
-
added \Other_Stuff\OtherStuff\GoogleTranslate.pb
-
added \Other_Stuff\OtherStuff\WindowsMagnificationAPI.pb
Read Output: Based on a question
posted by
tatanas.
Google Translate: Based on a question
posted by
ricardo.
Windows Magnification API: Based on a question
posted by
BarryG.
Dont find ther translate in the ohterstuff zip
You are the man!!
Re: Windows Services & Other Stuff
Posted: Tue Jun 02, 2020 4:51 pm
by ricardo
JHPJHP wrote:Updated:
- numerous updates and some bug fixes
Since the release of
PureBasic 5.72 LTS Beta 1 (thank you
Fred,
Freak &
Team) I proceeded to test every example, updating and patching as required.
NB*: Some examples may not work in older versions of PureBasic.
-----------------------------------------
Updated:
-
added \Other_Stuff\OtherStuff\CommandConsole\ReadOutput.pb
-
added \Other_Stuff\OtherStuff\GoogleTranslate.pb
-
added \Other_Stuff\OtherStuff\WindowsMagnificationAPI.pb
Read Output: Based on a question
posted by
tatanas.
Google Translate: Based on a question
posted by
ricardo.
Windows Magnification API: Based on a question
posted by
BarryG.
Great job man!!
I only find some little problems.
Because it does not reacts when browser finish downloading new page, someitmes if it takes some time to translate because a bigger text, it fails.
Also the regex gives some problems sometimes.
Thanks in advance, you are doing a great job. I will donate soon

Re: Windows Services & Other Stuff
Posted: Wed Jun 03, 2020 5:23 pm
by JHPJHP
Hi ricardo,
ricardo wrote:I only find some little problems.
Because it does not reacts when browser finish downloading new page, someitmes if it takes some time to translate because a bigger text, it fails.
Also the regex gives some problems sometimes.
The Problems you reported should now be fixed.
-
SetLanguageURL: Used to set the Start Language and Translate Language.
-
SetTranslateText: Used to set the text to be translated.
Depending on the size of the text to be translated, you may need to increase the
#MAX_TIMEOUT constant located at the top of the example.
NB*: Example has been moved to \Other_Stuff\OtherStuff\GoogleTranslate\GoogleTranslate.pb
----------------------------------------
Updated Google Translate:
-
added ListenToText Procedure
- modified SetTranslateText Procedure
ListenToText Procedure
The default action is to play the translated text.
Set StartLanguage option #True to play the original text.
SetTranslateText Procedure
Added CopyToClipboard option (default: #False).
Re: Windows Services & Other Stuff
Posted: Thu Jun 04, 2020 2:29 am
by ricardo
I find another problem.
Imagine that i want to load one file and translate it... and then translate to another language NOT the text from ther file, but the translation i just do, something like:
Code: Select all
SetTranslateURL(Dispatch, "auto", "de")
Text$ = SetTranslateText(Dispatch, Text$)
SetTranslateURL(Dispatch, "auto", "fr")
Text$ = SetTranslateText(Dispatch, Text$)
But sometimes, from time to time, i get your random text as a result.
Code: Select all
RandomText.s = Chr(Random(90, 65))
Best Regards my friend, you are downing something great sharing all your knowledge and codes, THANKS!!
Re: Windows Services & Other Stuff
Posted: Thu Jun 04, 2020 2:39 am
by JHPJHP
Hi ricardo,
It looks like you're using an
older version of the example;
see my previous post.
Download the latest version and let me know if it solves the problem.
ricardo wrote:But sometimes, from time to time, i get your random text as a result.
I ran the following code 5 consecutive times without a problem.
Code: Select all
SetLanguageURL("auto", "fr")
Debug SetTranslateText("Disturbed: Down With the Sickness")
SetLanguageURL("auto", "de")
Debug SetTranslateText("Disturbed: Down With the Sickness")
SetLanguageURL("auto", "en")
Debug SetTranslateText("Disturbed: Down With the Sickness")
This may also have been a timeout issue; the code has been updated.
- you should notice a marked speed improvements
-------------------------------------
Updated Google Translate:
- added ClearTranslateText Procedure
- some minor improvements
Re: Windows Services & Other Stuff
Posted: Thu Jun 04, 2020 5:03 pm
by ricardo
JHPJHP wrote:Hi ricardo,
It looks like you're using an
older version of the example;
see my previous post.
Download the latest version and let me know if it solves the problem.
ricardo wrote:But sometimes, from time to time, i get your random text as a result.
I ran the following code 5 consecutive times without a problem.
Code: Select all
SetLanguageURL("auto", "fr")
Debug SetTranslateText("Disturbed: Down With the Sickness")
SetLanguageURL("auto", "de")
Debug SetTranslateText("Disturbed: Down With the Sickness")
SetLanguageURL("auto", "en")
Debug SetTranslateText("Disturbed: Down With the Sickness")
This may also have been a timeout issue; the code has been updated.
- you should notice a marked speed improvements
-------------------------------------
Updated:
- added ClearTranslateText Procedure
- some minor improvements
Hi,
I think its working, i mam testing it
What is the usage of ListenToText()?
Bet Regards
Re: Windows Services & Other Stuff
Posted: Thu Jun 04, 2020 5:48 pm
by JHPJHP
Hi ricardo,
ricardo wrote:What is the usage of ListenToText()?
Listen to text is optional, but may be useful to some users; for example, a person with vision impairment, learning a new language, general communication, etc.
------------------------------------------
Updated Google Translate:
- made various code improvements
- added a couple new commands
- squashed a few bugs
New Commands:
-
ExecuteCommand("listen-to-text", "translate-language")
-- start-language or translate-language
-
ExecuteCommand("clear-translate-text")
Re: Windows Services & Other Stuff
Posted: Sat Jun 06, 2020 2:07 am
by JHPJHP
Updated Google Translate:
-
added a DLL example
- couple code improvements
- squashed a bug
DLL Example: GoogleTranslate_DLL.pb
NB*: Google Translate examples have been moved to \Other_Stuff\GoogleTranslate\
--------------------------------
Updated:
- see this
post; based on a question by
coffee
Windows Services & Other Stuff
Posted: Mon Jun 08, 2020 11:38 pm
by JHPJHP
Updated Google Translate:
- improved the DLL example
- includes 32 bit and 64 bit versions
DLL Example
Included script from another example to determine the calling process.
- \Other_Stuff\ProcessStuff\CallingProcess\
Passing translate data using an array for faster bulk translations.
Re: Windows Services & Other Stuff
Posted: Sun Oct 18, 2020 7:05 pm
by JHPJHP
Updated:
- various updates and improvements over time
Depending on when the package was previously downloaded will determine the number of changes.
NOTES:
All downloads require an access key.
Access key is emailed after a one time $20 CAD donation.
Good for all current and future scripts, programs, and updates.
Re: Windows Services & Other Stuff
Posted: Sat Nov 07, 2020 5:27 pm
by JHPJHP
Updated Google Translate:
- improved both examples
- added TranslateURL option
- added additional error checking
Re: Windows Services & Other Stuff
Posted: Wed Nov 25, 2020 12:34 am
by JHPJHP
Updated Google Translate:
-
improved both examples
Main Improvements.
1. Convert HTML entity codes.
2. Expanded to 100,000 characters.
3. Auto-clear IE cache under certain error conditions.
NB*: The Google Translate examples are now more user-friendly.
Script Example:
Code: Select all
IncludeFile "includes\GoogleTranslate.pbi"
If InitGoogleTranslate()
If SetLanguageURL("auto", "fr", "https://translate.google.com")
Debug "---------------------"
Debug SetTranslateText("Disturbed: Down With The Sickness")
Debug "---------------------"
Debug SetTranslateText("testfiles\Disturbed.txt", 4500, #True)
EndIf
If SetLanguageURL("auto", "de", "https://translate.google.com")
Debug "---------------------"
Debug SetTranslateText("Grandmaster Flash & the Furious Five: The Message")
Debug "---------------------"
Debug SetTranslateText("testfiles\Grandmaster.txt", 4500, #True)
EndIf
QuitGoogleTranslate()
EndIf
DLL Example:
Code: Select all
IncludeFile "includes\GoogleTranslateDLL.pbi"
If InitGoogleTranslate()
Dim td.TRANSLATE_DATA(2)
td(0)\SourceLanguage = "auto"
td(0)\TargetLanguage = "fr"
td(0)\TranslateURL = "https://translate.google.com"
td(0)\TranslateText = "Disturbed: Down With The Sickness."
td(1)\SourceLanguage = "auto"
td(1)\TargetLanguage = "fr"
td(1)\TranslateURL = "https://translate.google.com"
td(1)\TranslateText = "testfiles\Disturbed.txt"
td(1)\TimeoutLength = 4500
td(1)\SaveToFile = #True
TranslationTotal = ArraySize(td())
*TextTranslation = GoogleTranslate(@td(), TranslationTotal)
If *TextTranslation
Dim TextTranslation.s(TranslationTotal)
CopyMemory(*TextTranslation, @TextTranslation(), SizeOf(*TextTranslation) * TranslationTotal)
For rtnCount = 0 To TranslationTotal - 1
Debug TextTranslation(rtnCount)
Debug "---------------------"
Next
EndIf
QuitGoogleTranslate()
EndIf
Re: Windows Services & Other Stuff
Posted: Tue Dec 08, 2020 11:34 pm
by ricardo
JHPJHP wrote:Updated Google Translate:
-
improved both examples
Main Improvements.
1. Convert HTML entity codes.
2. Expanded to 100,000 characters.
3. Auto-clear IE cache under certain error conditions.
NB*: The Google Translate examples are now more user-friendly.
Script Example:
Code: Select all
IncludeFile "includes\GoogleTranslate.pbi"
If InitGoogleTranslate()
If SetLanguageURL("auto", "fr", "https://translate.google.com")
Debug "---------------------"
Debug SetTranslateText("Disturbed: Down With The Sickness")
Debug "---------------------"
Debug SetTranslateText("testfiles\Disturbed.txt", 4500, #True)
EndIf
If SetLanguageURL("auto", "de", "https://translate.google.com")
Debug "---------------------"
Debug SetTranslateText("Grandmaster Flash & the Furious Five: The Message")
Debug "---------------------"
Debug SetTranslateText("testfiles\Grandmaster.txt", 4500, #True)
EndIf
QuitGoogleTranslate()
EndIf
DLL Example:
Code: Select all
IncludeFile "includes\GoogleTranslateDLL.pbi"
If InitGoogleTranslate()
Dim td.TRANSLATE_DATA(2)
td(0)\SourceLanguage = "auto"
td(0)\TargetLanguage = "fr"
td(0)\TranslateURL = "https://translate.google.com"
td(0)\TranslateText = "Disturbed: Down With The Sickness."
td(1)\SourceLanguage = "auto"
td(1)\TargetLanguage = "fr"
td(1)\TranslateURL = "https://translate.google.com"
td(1)\TranslateText = "testfiles\Disturbed.txt"
td(1)\TimeoutLength = 4500
td(1)\SaveToFile = #True
TranslationTotal = ArraySize(td())
*TextTranslation = GoogleTranslate(@td(), TranslationTotal)
If *TextTranslation
Dim TextTranslation.s(TranslationTotal)
CopyMemory(*TextTranslation, @TextTranslation(), SizeOf(*TextTranslation) * TranslationTotal)
For rtnCount = 0 To TranslationTotal - 1
Debug TextTranslation(rtnCount)
Debug "---------------------"
Next
EndIf
QuitGoogleTranslate()
EndIf
I donate.
I am getting en error running the example pb file telling me that there are a communication error.