Internationalization (i18n) Development Documentation
Overview
Internationalization (i18n) refers to a series of design and implementation work in software development to enable applications to support users in multiple languages and regions. The Informat AI Low-Code Platform provides powerful internationalization support, allowing developers to easily add multi-language support to their applications.
Main Features
- Language Pack Management: Supports management of language packs for multiple languages.
- Dynamic Language Switching: Supports dynamic switching of user interface languages.
- Text Translation: Supports translation and management of all text in applications.
Adding Language Packs
First, you need to add the required language packs in the Informat AI Low-Code Platform. Each language pack contains all translation texts for that language.
Steps
- Enter the application designer of the Informat AI Low-Code Platform.
- Navigate to "Global Settings" -> "Internationalization" -> "Language List".
- Click "Add" and select the language you need to add.
- Switch to the "Translation" tab and set the translation texts.
Using Internationalization Text in Applications
In each module and page of the application, use internationalization text identifiers instead of specific text content. The Informat AI Low-Code Platform will automatically replace them with the corresponding translation text based on the currently selected language.
Example:
${T.t('welcome_message')}In the example above, welcome_message is the internationalization text identifier, and the platform will automatically replace it with the corresponding text in the current language.
Dynamic Language Switching
The Informat AI Low-Code Platform allows users to dynamically switch languages at runtime. Use the following client-side script to implement language switching.
informat.system.setLocale("zh_CN");
//The system currently supports two locales: zh_CN for Chinese and en_US for English
