This component is used to display images in different languages based on the logic that images in the script change accordingly when the system language of a mobile phone changes. You can also add strings to .xml language files as variables, so that when the system language of a mobile phone changes, the variables change accordingly. If you have bound the variables to images, the images also change with the system language. 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 |
|---|---|---|---|
srcExp | String | Yes | Image source expression, which uses string variables. When the system language changes, the strings change accordingly to update the images. For example, if srcExp is set to "t1+@lang", when the system language is Chinese, t1_ch.png is displayed; when the system language is English, t1_en.png is 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 images displayed when the system language is English.
<strings> <string name="unlock_prompt" value="Slide to unlock" /> <string name="batterylow_text" value="Please connect charger"/> <string name="Charging_text" value="Charging"/> <string name="BatteryFull_text" value="Charge complete"/> <string name="w1" value="Sunday"/> <string name="w2" value="Monday"/> <string name="w3" value="Tuesday"/> <string name="w4" value="Wednesday"/> <string name="w5" value="Thursday"/> <string name="w6" value="Friday"/> <string name="w7" value="Saturday"/> <string name="lang" value="_en.png"/> </strings>
Example 2: Use the @lang variable in the script to display the image that matches the system language. When the language is simplified Chinese, image t1_ch.png is displayed; when the language is English, image t1_en.png is displayed.
<Image align="center" y="#screen_height-2160+1776.5" x="177.5" alignV="center" srcExp="t1+@lang"/>