Auto translating website using Google Translate
By : moire
Date : March 29 2020, 07:55 AM
hope this fix your issue I know that when I visit a site in another language using Google Chrome, it says "This site appears to be in [Drop Down With Languages]. Do you want Google to translate it?" They might have an api that can do that per page. However, if your site is at all professional, you should get someone to actually translate your site for you, as occasionally Google translate fails in embarrassing ways.
|
Would Google Translate do a good job for translating my software?
By : whuber
Date : March 29 2020, 07:55 AM
will help you No; I wouldn't recommend it. Machine translators will not handle short domain-specific strings very well.
|
Stopping google translate from translating datepicker
By : DEv Sharma
Date : March 29 2020, 07:55 AM
around this issue Your first line is adding the notranslate class to the input element that you're triggering the datepicker from. The datepicker UI elements are different from the input field, and get created automatically at the end of the document. You can find them with the jqueryui class ui-datepicker (which you're already doing). However, they get created as soon as you configure the datepicker on your input field, so you can immediately follow your first line with a line that finds the automatically-created ui elements and adds the notranslate class to them (instead of putting it on a button click) code :
$(function() {
$(".datepicker").datepicker();
$('.ui-datepicker').addClass('notranslate');
});
|
Google translate not translating in IE when website opened from vba
By : user2155530
Date : March 29 2020, 07:55 AM
like below fixes the issue Alter your URL slightly and let the browser handle the encoding of the URL. Here I am reading your text from a cell. When the site does a translation it generates a new URL which has a query string parameter of text= ; so add the text= onto your start URL and concatenate in your phrase for translation. Remember you need to close your IE instance at some point. I am not a fan of passing IE as an object in this manner and would probably look to having it held in a class which generates the IE object in class Class_Initialize(). You then instantiate that class with a variable in the sub. code :
Option Explicit
Public Sub test()
Dim ie As InternetExplorer, trans_text As String
Const URL As String = "https://translate.google.com/#view=home&op=translate&sl=ja&tl=en&text="
Set ie = New InternetExplorer
trans_text = [A1].Value
Debug.Print OutlookGetTransItem(ie, URL, trans_text)
ie.Quit
End Sub
Public Function OutlookGetTransItem(ByVal ie As Object, ByVal URL As String, ByVal trans_text As String) As String
Dim t As Date
If trans_text = vbNullString Then OutlookGetTransItem = trans_text: Exit Function
Const MAX_WAIT_SEC As Long = 5
With ie
.Visible = True
.navigate2 URL & trans_text
While .Busy Or .readyState < 4: DoEvents: Wend
Dim translation As Object, translationText As String
t = Timer
Do
On Error Resume Next
Set translation = .document.querySelector(".tlid-translation.translation")
translationText = translation.innerText
On Error GoTo 0
If Timer - t > MAX_WAIT_SEC Then Exit Do
Loop While translationText = vbNullString
OutlookGetTransItem = translationText
End With
End Function
|
Google translate API not translating some words within HTML tag
By : user3303843
Date : March 29 2020, 07:55 AM
it helps some times I'm working with google translate API, and I've noticed that when im translating HTML it's sometimes missing the word inside the tags, and returns the original word in English, for example: , EDIT: the problem was with the Type, what I need is 'text/html' code :
const request = {
parent: translationClient.locationPath(projectId, location),
contents: [textToTranslate],
mimeType: "text/html", // mime types: text/plain, text/html
sourceLanguageCode: "en-US",
targetLanguageCode: "he"
};
|