Zoom VideoSDK UI Toolkit
    Preparing search index...

    Interface I18nController

    Internationalization (i18n) interface

    Need to call joinSession before using this API

    UIToolkit.onSessionJoined(async () => {
    // Simple language change (must have pre-loaded resources)
    await UIToolkit.i18n.setLanguage("zh-CN");

    // Load language from URL
    await UIToolkit.i18n.setLanguage("zh-TW", "https://example.com/lang/zh-TW.json");

    // Add inline resources for custom language
    const enJson = UIToolkit.i18n.getInstance().getResourceBundle("en-US", "translation") || {};
    const jpJson = Object.assign({}, enJson, {
    "notification.enable_audio_button": "参加",
    "notification.enable_audio_content": "このセッションに参加しますか?",
    "notification.enable_audio_title": "参加音声",
    "settings.tab_audio": "音声",
    "settings.tab_background": "背景",
    "settings.tab_general": "一般",
    "settings.tab_help": "ヘルプ",
    "settings.tab_mask": "マスク",
    "settings.tab_playback": "再生",
    "settings.tab_raw_data": "生データ",
    "settings.tab_second_audio": "セカンド音声",
    "settings.tab_statistics": "統計",
    "settings.tab_troubleshoot": "トラブルシューティング",
    });
    await UIToolkit.i18n.setLanguage("ja-JP", jpJson);
    });

    // Listen for language changes and load resources dynamically
    UIToolkit.onLanguageChange((language) => {
    console.log("uikit.onLanguageChange", language);
    if (language === "ko-KR") {
    void UIToolkit.i18n.setLanguage("ko-KR", "https://example.com/lang/ko-KR.json");
    } else if (language === "vi-VN") {
    void UIToolkit.i18n.setLanguage("vi-VN", "https://example.com/lang/vi-VN.json");
    } else {
    console.log("language not found", language);
    }
    });
    interface I18nController {
        getInstance(): unknown;
        getLanguage(): string;
        getLanguageList(): string[];
        hasLanguageResources(language: string): boolean;
        setLanguage(
            language: string,
            resources?: string | Record<string, unknown>,
        ): Promise<void>;
        setLanguageList(languages: string[]): void;
    }
    Index

    Methods

    • Gets the i18next instance for advanced usage

      Returns unknown

      The i18next instance

      // Access i18next directly for advanced features
      const i18n = UIToolkit.i18n.getInstance();
      const translation = i18n.t("settings.language_title");
      const hasResources = i18n.hasResourceBundle("ja-JP", "translation");
      const enJson = i18n.getResourceBundle("en-US", "translation");
    • Gets the current UI language, default is en-US see all keys at https://source.zoom.us/uitoolkit/{VERSION}/en-US.json

      Returns string

      The current language code (e.g., "en-US")

      const currentLang = UIToolkit.i18n.getLanguage();
      console.log("Current language:", currentLang);
    • Gets the list of available languages set by setLanguageList

      Returns string[]

      Array of language codes, defaults support ["en-US", "zh-CN"]

      const languages = UIToolkit.i18n.getLanguageList();
      console.log("Available languages:", languages);
    • Checks if a language has loaded translation resources

      Parameters

      • language: string

        The language code to check

      Returns boolean

      true if resources exist, false otherwise

      if (UIToolkit.i18n.hasLanguageResources("ja-JP")) {
      await UIToolkit.i18n.setLanguage("ja-JP");
      } else {
      console.log("Japanese resources not loaded");
      }
    • Sets the UI language and optionally loads additional translation resources

      Parameters

      • language: string

        The language code (e.g., "en-US", "zh-CN")

      • Optionalresources: string | Record<string, unknown>

        Optional translation resources (object or URL to JSON file)

      Returns Promise<void>

      Promise that resolves when language is set and resources are loaded

    • Sets the list of available languages in the language selector

      Parameters

      • languages: string[]

        Array of language codes to show in the settings

      Returns void

      // Show multiple language options, if language not in the list, it will not be shown in the language selector
      UIToolkit.i18n.setLanguageList(["en-US", "zh-CN", "zh-TW", "ja-JP"]);

      // Restrict to specific languages
      UIToolkit.i18n.setLanguageList(["en-US", "zh-CN"]);