Skip to content

seppegadeyne/google-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

google-translate

export async function translate(text, language, key) {
    const url = `https://translation.googleapis.com/language/translate/v2?key=${key}`;
    const response = await fetch(url, {
        method: 'POST',
        headers : {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            target: language,
            format: "text",
            q: text
        }),
    });
    return await response.json();
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors