---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/hi/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/ko/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/ru/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/tr/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/vi/sdk/unity/env-auth-lang.md
  - https://yandex.com/dev/games/doc/zh/sdk/unity/env-auth-lang.md
  - href: zh/sdk/unity/env-auth-lang.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/zh/llms.txt

# 环境变量、授权与本地化

<!-- source: zh/_includes/script-common.md -->
<!-- source: zh/_includes/script/index-js.md -->

<!-- endsource: zh/_includes/script/index-js.md -->

<!-- source: zh/_includes/script/requirements-js.md -->

<!-- endsource: zh/_includes/script/requirements-js.md -->

<!-- source: zh/_includes/script/image-modal-js.md -->

<!-- endsource: zh/_includes/script/image-modal-js.md -->
<!-- endsource: zh/_includes/script-common.md -->

#|
|| ![](../../_images/icons/video.svg) | 视频教程 3. 数据获取、授权与本地化

<div class="cut-button">

{% cut "观看视频" %}

视频为俄语版，您可以在YouTube开启自动字幕功能

{% list tabs %}

- 雅虎

  @[](https://runtime.strm.yandex.ru/player/video/vplviwz6uirn3yuha6kz?autoplay=0&mute=0)

- YouTube

  @[youtube](https://youtu.be/olyTBkJJAfY?si=0ja5BNd6PE805aOp)

{% endlist %}

{% endcut %}

</div>

||
|#

插件功能分为独立模块（点击查看对应文档）：
- [环境变量](https://max-games.ru/plugin-yg/doc/envir/?en){.external} —— 可获取SDK平台提供的用户设备数据，如系统语言、操作系统或浏览器类型
- [授权模块](https://max-games.ru/plugin-yg/doc/auth/?en){.external} —— 用于接入排行榜和支付功能。但游戏必须支持无授权运行（参见[条款1.2](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-2)）
  通过授权模块可获取用户数据（如昵称或头像），该模块也是Leaderboards和Payments等功能的必要前提
- [多语言支持](https://max-games.ru/plugin-yg/doc/lang/?en){.external}：
    - [游戏本地化管理](https://max-games.ru/plugin-yg/doc/lang/?en){.external}：当检测到平台语言时自动切换游戏语言

      {% note warning %}

      游戏必须至少支持在草稿阶段选择的语言之一（参见[条款1.2](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#2-10)）。建议添加俄语(ru)、英语(en)、土耳其语(tr)的[本地化](https://yandex.com/dev/games/doc/zh/concepts/languages-and-domains.md#languages)

      若游戏支持手动切换语言，请注意[条款6.9](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#6-9)的要求

      {% endnote %}

    - [自动翻译](https://max-games.ru/plugin-yg/doc/lang/?en#:~:text=for%20translating%20texts.-,Auto%20Translate%20Langs,-A%20complete%20solution){.external} —— 通过Google翻译实现

