[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],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)"]]