Language

IAPMiniProgram SDK can dynamically adjust the language display based on the user's language preference to support different languages and cultures. This language adaptation applies to all SDK-provided pages, which include:

  • Pages within the more menu, such as Settings and About
  • JSAPI-triggered pages, such as the alert box from my.alert
  • Other common pages, such as the splash screen and error pages

This topic mainly introduces the supported languages and the underlying language display logic of the SDK.

Note: Mini programs can also dynamically adjust their language display by calling the my.getSystemInfo JSAPI to obtain the user's language preference via the language response parameter. For more information, refer to my.getSystemInfo.

Supported languages

The following table lists the languages supported by the SDK and other key information:

Supported language

LanguageTag

Layout direction

Required SDK version

English (default)

en

LTR (left-to-right)

All versions

Arabic

ar

RTL (right-to-left)

v2.50.0 or later

Spanish

es

LTR (left-to-right)

v2.50.2 or later

If you require additional language capability for the SDK, contact our technical support at overseas_support@service.alibaba.com.

User experience

The following images show a demo menu panel in English and Arabic:

English

Arabic

image

image

Language display logic

The SDK calls the iOS native Locale.preferredLanguages.first API to obtain the primary language preference on the user's device and then adjusts the language display accordingly. The API call can have the following two outcomes:

  • If the per-app language settings are available, the API obtains the language from these settings. For more information about this feature, refer to the iOS documentation on How to support per-app language settings in your app.
  • In other cases, the API obtains the language from the system settings. This includes the following scenarios:
    • The super app does not implement multilingual capabilities.
    • The super app implements multilingual capabilities through system settings.
    • The super app implements multilingual capabilities only through in-app language settings.

Refer to the following table for the path and the interface of the system settings and the per-app settings respectively:

System settings

Per-app settings

Path

Settings > General > Language & Region

Settings > Your app > Language

Interface

image

image

The SDK automatically adjusts its display language to match the obtained language preference. However, if the preferred language is not supported by the SDK, the display language is English by default.