This component is used to display text in different languages based on the logic that strings in the script change accordingly when the system language of a mobile phone changes. To use this component, you need to create a strings folder in the lock screen script directory and add language files, such as strings.xml (English), strings_zh_CN.xml (simplified Chinese), and strings_zh_TW.xml (traditional Chinese), to the folder.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
text | String | No | Text expression. When the system language changes, the text is adapted to the language. For example, if text is set to "@charging+#battery_level" and the system language is English, "charging99" may be displayed. You can only set either text or textExp. |
textExp | String | No | Text expression. When the system language changes, the text is adapted to the language. For example, if textExp is set to "@charging+#battery_level" and the system language is English, "charging99" may be displayed. |
Example 1: Add .xml files of supported languages to the strings folder and use variables in the manifest.xml script.
The strings.xml file defines the format of text displayed when the system language is English.
<strings> <string name="charging" value="Charging"/> </strings>
Example 2: Use the variable @charging in the script to display text indicating the charging status in the system language.
<Text x="#screen_width/2" y="(#screen_height)-60" alignV="bottom" color="#ffffff" align="center" size="42" alpha="180" textExp="@charging+#battery_level"/>