
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
html-google-translate
Advanced tools
Translate HTML with Google Translate and maintain the original structures of sentences and HTML.
Translate HTML with Google Translate and maintain the original structures of sentences and HTML.
const html = '<p><i>I</i> love <a href="#">you</a>!</p>'
const transHtml = await translate(html, {
from: 'en',
to: 'es',
})
// '<p><i>Me</i> encanta <a href="#">que</a> !</p>'
$ npm install html-google-translate
const transHtml = await translate(html, {
from: 'auto',
to: 'en',
tld: 'com',
proxy: {
host: '127.0.0.1',
port: 9000,
auth: {
username: 'username',
password: 'password',
},
},
xmlMode: false,
})
Type: string
The HTML to be translated.
Type: object
Type: string | 'auto'
The html language. Must be auto or one of the codes/names (not case sensitive) contained in languages.ts.
Type: string
The language in which the HTML should be translated. Must be one of the codes/names (case sensitive!) contained in languages.ts.
Type: string Default: 'com'
TLD for Google translate host to be used in API calls: https://translate.google.{tld}.
Type: AxiosProxyConfig | false Default: false
Proxy for request, AxiosProxyConfig.
Type: boolean | 'foreign' Default: false
Indicate whether to render the result in XML.
FAQs
Translate HTML with Google Translate and maintain the original structures of sentences and HTML.
We found that html-google-translate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.