Customize text and language settings

更新时间:
复制 MD 格式

Captcha supports 17 built-in languages. You can customize the UI text and language of the client-side component.

Supported languages

Note

Use the language parameter to set the language.

  • cn: Simplified Chinese

  • tw: Traditional Chinese

  • en: English

  • ar: Arabic

  • de: German

  • es: Spanish

  • fr: French

  • in: Indonesian

  • it: Italian

  • ja: Japanese

  • ko: Korean

  • pt: Portuguese

  • ru: Russian

  • ms: Malay

  • th: Thai

  • tr: Turkish

  • vi: Vietnamese

Important

The spatial reasoning question bank matches the selected language for Simplified Chinese (cn), Traditional Chinese (tw), English (en), Japanese (ja), and Korean (ko). Other languages default to the Simplified Chinese (cn) question bank.

The spatial reasoning CAPTCHA is no longer available. [Notice] Deprecation of the Spatial Reasoning CAPTCHA Type.

Code example

This example customizes CAPTCHA prompt text for different languages.

Note

Customize 13 text prompts by passing the upLang: myLang parameter and defining the myLang object.

/**
 * The language name. Options include cn, tw, and en. You can also add custom languages.
 * Specify language details in a key-value format.
 */
var myLang = {
  cn: {
    // Text for the trigger button in the embedded v3 UI.
    START_VERIFY: "Click to start verification",
    // The title text for the Captcha prompt. Applies to all CAPTCHA types.
    POPUP_TITLE: "Complete security verification",
    // The interaction prompt text for different CAPTCHA types.
    SLIDE_TIP: "Drag the slider all the way to the right.",
    CHECK_BOX_TIP: "Confirm you are not a robot",
    PUZZLE_TIP: "Drag the slider to complete the puzzle.",
    INPAINTING_TIP: "Drag the slider to restore the image.",
    // The prompt text during the verification process. Applies to slider CAPTCHA and one-click verification.
    VERIFYING: "Verifying...",
    // The prompt text for successful verification. Applies to all CAPTCHA types.
    SUCCESS: "Verified.",
    // The prompt text for a failed verification. Applies to slider CAPTCHA and one-click verification.
    SLIDE_FAIL: "Verification failed. Refresh and try again.",
    // The prompt text for a failed verification. Applies to puzzle CAPTCHA and image restoration CAPTCHA.
    CAPTCHA_FAIL: "Verification failed. Try again.",
    // The prompt text for network exceptions.
    CONGESTION: "Network error. Please refresh and try again.",
    // The prompt text displayed after interaction but before submission. Specific to the embedded v2 UI, where submission is triggered by a business button.
    CAPTCHA_COMPLETED: "Complete.",
    // Prompt text for submission attempts without interaction. Specific to the embedded v2 UI, where submission is triggered by a business button.
    FINISH_CAPTCHA: "Please complete the security verification first.",
    // The prompt text for verification timeout. The embedded UI does not have a close button.
    OVERTIME_TIP: "Verification timed out. Please close the Captcha and try again.",
    OVERTIME_TIP_BOX: "Verification timed out. Please click the Captcha box to try again.",
  },
  en: {
    // The keys are the same as above.
    POPUP_TITLE: "Please complete captcha",
    // ...
  },
};

initAliyunCaptcha({
  ...
  upLang: "myLang",
  language: "cn", // The Captcha language, for example, "cn".
  ...
});
Important
  1. To add a custom language, set the language parameter in initAliyunCaptcha to your custom language code and provide translations for the 13 text keys in the myLang object. For example: language: 'xx', "xx": { "POPUP_TITLE": "Your custom text here"}.

  2. Unsupported language codes fall back to Chinese text. Supported languages without custom text fall back to the default text for that language.

  3. The following system text cannot be customized: "You have stayed on the page for too long. Please refresh and try again."

Text display locations

The myLang object stores all Captcha display text, including verification prompts, loading status, and failure messages.

Key

Default

Slider CAPTCHA

One-click verification

Puzzle CAPTCHA

Image restoration CAPTCHA

Description

START_VERIFY

"Click to start verification"

/

/

image

image

Trigger button text in the embedded v3 UI.

POPUP_TITLE

"Complete security verification"

image

image

image

image

Title text for the Captcha prompt. Applies to all CAPTCHA types.

  • SLIDE_TIP

  • CHECK_BOX_TIP

  • PUZZLE_TIP

  • INPAINTING_TIP

  • "Drag the slider all the way to the right."

  • "Confirm you are not a robot"

  • "Drag the slider to replace the puzzle piece."

  • "Drag the slider to restore the complete image"

image

image

image

image

Interaction prompt for each CAPTCHA type.

VERIFYING

"Verifying..."

image

image

/

/

Shown during verification. Applies to slider CAPTCHA and one-click verification.

SUCCESS

"Verified."

image

image

image

image

Shown on successful verification. Applies to all CAPTCHA types.

SLIDE_FAIL

"Verification failed. Refresh and try again."

image

image

/

/

Shown on failed verification. Applies to slider CAPTCHA and one-click verification.

CAPTCHA_FAIL

"Verification failed. Try again."

/

/

image

image

Shown on failed verification. Applies to puzzle CAPTCHA and image restoration CAPTCHA.

CONGESTION

"Network error. Please refresh and try again."

image

image

image

image

Shown on network errors.

CAPTCHA_COMPLETED

"Complete."

image

/

image

image

Shown after interaction but before submission. Specific to the embedded v2 UI, where a business button triggers submission.

Note
  • For a better experience, use the embedded v3 UI.

  • To submit verification immediately after slider interaction, set immediate to true in v2.

FINISH_CAPTCHA

"Complete security verification."

image

image

image

image

Shown when submission is attempted without interaction. Specific to the embedded v2 UI, where a business button triggers submission.

Note

The position of this prompt is fixed. For a better experience, use the embedded v3 UI.

OVERTIME_TIP

OVERTIME_TIP_BOX

  • "Verification timed out. Please close the Captcha and try again."

  • "Verification timed out. Please click the Captcha box to try again."

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Shown on verification timeout. The embedded UI has no close button.