我们正在更新 Data API,以便与 YouTube 统计 Shorts 短视频观看次数的方式保持一致。
了解详情
I18nLanguages
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
i18nLanguage
资源用于标识 YouTube 网站支持的应用语言。应用语言也称为界面语言。对于 YouTube 网站,系统会根据 Google 账号设置、浏览器语言或 IP 位置自动选择应用语言。用户还可以从 YouTube 网站页脚手动选择所需的界面语言。
每个 i18nLanguage
资源都标识了语言代码和名称。在调用 videoCategories.list
和 guideCategories.list
等 API 方法时,语言代码可用作 hl
参数的值。
方法
对于 i18nLanguages
资源,该 API 支持以下方法:
- list
- 返回 YouTube 网站支持的应用语言列表。
立即试用。
资源表示法
以下 JSON 结构显示了 i18nLanguages
资源的格式:
{
"kind": "youtube#i18nLanguage",
"etag": etag,
"id": string,
"snippet": {
"hl": string,
"name": string
}
}
属性
下表定义了此资源中显示的属性:
属性 |
kind |
string
标识 API 资源的类型。该值将为 youtube#i18nLanguage 。 |
etag |
etag
此资源的 Etag。 |
id |
string
YouTube 用来唯一标识国际化语言的 ID。 |
snippet |
object
snippet 对象包含有关 i18n 语言的基本详细信息,例如语言代码和名称。 |
snippet.hl |
string
用于唯一标识语言的 BCP-47 代码。 |
snippet.name |
string
以 i18nLanguage.list 方法的 hl 参数指定的语言编写的语言名称。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eThe i18nLanguage resource identifies a language supported by the YouTube website, which can be automatically set based on Google Account settings, browser language, or IP location, or manually selected by the user.\u003c/p\u003e\n"],["\u003cp\u003eEach i18nLanguage resource includes a language code and a name, with the language code being usable as the value for the \u003ccode\u003ehl\u003c/code\u003e parameter in API calls like \u003ccode\u003evideoCategories.list\u003c/code\u003e and \u003ccode\u003eguideCategories.list\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe i18nLanguages resource can be retrieved using the \u003ccode\u003ei18nLanguages.list\u003c/code\u003e method, which provides a list of supported application languages.\u003c/p\u003e\n"],["\u003cp\u003eThe resource is represented in JSON format, containing properties such as \u003ccode\u003ekind\u003c/code\u003e (identifying the resource type), \u003ccode\u003eetag\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, and a \u003ccode\u003esnippet\u003c/code\u003e object with details like the \u003ccode\u003ehl\u003c/code\u003e code and the language \u003ccode\u003ename\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `i18nLanguage` resource details supported application languages for YouTube, also known as UI languages. Each resource includes a language code (`hl`) and a name. The language can be automatically selected based on Google Account settings, browser language, or IP location, or manually chosen. The language code can be used in API methods. The `i18nLanguages.list` method returns a list of these languages, defined by their ID, and snippet data, which includes the `hl` code and name.\n"],null,["# I18nLanguages\n\nAn **i18nLanguage** resource identifies an application language that the YouTube website supports. The application language can also be referred to as a UI language. For the YouTube website, an application language could be automatically selected based on Google Account settings, browser language, or IP location. A user could also manually select the desired UI language from the YouTube site footer. \n\nEach `i18nLanguage` resource identifies a language code and a name. The language code can be used as the value of the `hl` parameter when calling API methods like `videoCategories.list` and `guideCategories.list`.\n\nMethods\n-------\n\nThe API supports the following methods for `i18nLanguages` resources:\n\n[list](/youtube/v3/docs/i18nLanguages/list)\n: Returns a list of application languages that the YouTube website supports.\n [Try it now](/youtube/v3/docs/i18nLanguages/list#usage).\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `i18nLanguages` resource: \n\n```text\n{\n \"kind\": \"youtube#i18nLanguage\",\n \"etag\": etag,\n \"id\": string,\n \"snippet\": {\n \"hl\": string,\n \"name\": string\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#i18nLanguage`. |\n| `etag` | `etag` The Etag of this resource. |\n| `id` | `string` The ID that YouTube uses to uniquely identify the i18n language. |\n| `snippet` | `object` The `snippet` object contains basic details about the i18n language, such as its language code and name. |\n| snippet.`hl` | `string` A BCP-47 code that uniquely identifies a language. |\n| snippet.`name` | `string` The name of the language as it is written in the language specified using the `i18nLanguage.list` method's [hl](/youtube/v3/docs/i18nLanguages/list#hl) parameter. |"]]