Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
A API Cloud Translation é disponibilizada para qualquer um que queira integrar o próprio site ou aplicativo a ela. O uso dessas APIs é regido pelos Termos de Serviço. Entre outras coisas,
esses Termos exigem que você siga algumas diretrizes sobre como o
texto resultante precisa ser exibido no seu site. A finalidade deste documento e dos Requisitos de atribuição é ajudar você a atender a essas exigências.
Em pequenos snippets ou seções dentro de um documento HTML
Delimite o texto traduzido em um <div lang="..."></div> (para blocos) ou <span lang="..."></span> (para fragmentos in-line) e defina o atributo lang="" como o código de idioma apropriado. Siga este formato:
Use o formato a seguir para definir lang="": <código do idioma de chegada>-x-mtfrom-<código do idioma de origem>.
Por exemplo, para um texto em francês que foi traduzido automaticamente do inglês, a tag HTML será: <span lang="fr-x-mtfrom-en">Bonjour</span> ou <div lang="fr-x-mtfrom-en"> Bonjour </div>.
Se o idioma de origem ou o de chegada for desconhecido, use a especificação de idioma "und" para indicar idioma indeterminado. Por exemplo, <span lang="und-x-mtfrom-und"> … </span> indica idiomas de origem ou de chegada indeterminados.
Se preferir, insira um atributo lang="" em qualquer elemento que já una o texto traduzido. Por exemplo, se os resultados inalterados da API Cloud Translation estiverem em um parágrafo <p>, coloque o lang="" em </p>, como em <p lang="ar-x-mtfrom-jp"> para texto traduzido do japonês para o árabe.
Em documentos inteiros ou páginas da Web
Para uma página inteira, quando o documento original não estiver disponível on-line ou o URL do documento original ainda for desconhecido, insira o atributo lang="" conforme descrito na seção anterior sobre o elemento <html>:
Em uma página inteira, quando o documento original estiver disponível on-line, insira um elemento <link> no <head> do documento HTML, com o atributo rel="" definido como "alternate machine-translated-from", hreflang="" configurado como o código de idioma original e href="" configurado para a página original. Por exemplo:
O código HTML acima especifica que esta página foi traduzida automaticamente do francês para o inglês, e que o documento original em francês está no local fictício http://fr.example.com/abeille.html.
Para mais informações, os códigos de idiomas são descritos abaixo:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-04-09 UTC."],[],[],null,["# Translation API Markup\n\nThe Cloud Translation API is available to anyone wishing to integrate with the\nCloud Translation API from their own site or application. Use of these APIs is\ngoverned by the [Terms of Service](/terms). Among other\nthings, these Terms require that you adhere to certain guidelines on how the\nresulting text must be displayed on your site. This document and\n[Attribution Requirements](/translate/attribution) are intended to\nhelp you meet these requirements.\n\nIf unaltered Cloud Translation API results are published and made searchable on the\nweb, you are required to designate the translated text as machine translated\ncontent. For example, Google has quality guidelines about [automatically\ngenerated\ncontent](https://developers.google.com/search/docs/advanced/guidelines/auto-gen-content)\nand guidance about how to [prevent it from showing up in search\nresults](https://developers.google.com/search/docs/advanced/crawling/control-what-you-share).\n\nFor short snippets or sections within a HTML document\n-----------------------------------------------------\n\nWrap the translated text in a `\u003cdiv lang=\"...\"\u003e\u003c/div\u003e`\n(for blocks) or `\u003cspan lang=\"...\"\u003e\u003c/span\u003e` (for inline\nfragments) and set the `lang=\"\"` attribute to the appropriate\nlanguage code formed as follows:\n\n- Use the following format to set `lang=\"\"`: \\\u003clanguage code of the language to which the text was translated\\\u003e-x-mtfrom-\\\u003clanguage code of original language\\\u003e\n- For example, for French text that was machine translated from the original English text, the HTML tag should be: `\u003cspan lang=\"fr-x-mtfrom-en\"\u003eBonjour\u003c/span\u003e` or `\u003cdiv lang=\"fr-x-mtfrom-en\"\u003e Bonjour \u003c/div\u003e`\n- If the source language or target language is unknown, use the \"und\" language\n specification to indicate undetermined language. For example,\n `\u003cspan lang=\"und-x-mtfrom-und\"\u003e ... \u003c/span\u003e` indicates\n undetermined source or target languages.\n\n- Alternatively, put a `lang=\"\"` attribute around whatever element\n already wraps the translated text. For example, if the unaltered\n Cloud Translation API results are in a `\u003cp\u003e` paragraph, then put\n the `lang=\"\"` on the `\u003c/p\u003e` as in\n `\u003cp lang=\"ar-x-mtfrom-jp\"\u003e` for text translated from\n Japanese to Arabic).\n\nFor entire documents or web page\n--------------------------------\n\nFor an entire page, when the original document is not available online or the\nURL of the original document is not yet known, put the lang=\"\" attribute as\ndescribed in the previous section on the \\\u003chtml\\\u003e element: \n\n \u003cDOCTYPE HTML\u003e\n \u003chtml lang=\"en-x-mtfrom-fr\"\u003e\n \u003chead\u003e\n \u003ctitle\u003eThe Bee\u003c/title\u003e\n ...\n\nFor the entire page, when the original document is available online, put a\n\\\u003clink\\\u003e element in the \\\u003chead\\\u003e of the HTML document, with the rel=\"\"\nattribute set to \"alternate machine-translated-from\", the hreflang=\"\" attribute\nset to the original language code, and href=\"\" is set to the original page, as\nin: \n\n \u003cDOCTYPE HTML\u003e\n \u003chtml lang=\"en-x-mtfrom-fr\"\u003e\n \u003chead\u003e\n \u003ctitle\u003eThe Bee\u003c/title\u003e\n \u003clink rel=\"alternate machine-translated-from\" hreflang=\"fr\"\n href=\"http://fr.example.com/abeille.html\"\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n ...\n\nThe HTML code above specifies that this page is machine translated from French\nto English and the original French document is located at the fictitious\n`http://fr.example.com/abeille.html`.\n\nFor more information, language codes are described below:\n\n- [IANA language subtag registry](http://www.iana.org/assignments/language-subtag-registry)\n- [IETF language tag](http://en.wikipedia.org/wiki/IETF_language_tag)"]]