1e41f4b71Sopenharmony_ci# Pseudo-Localization Testing for Translation 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Use Cases 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciPseudo-localization testing is used to identify problems that may cause abnormal UI, layout, or text display during translation. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci**Text truncation or abnormal UI layout**: For software components such as menus, text areas, keys, and check boxes, the text length is usually adjusted to adapt to the source language (usually English) during UI design, and then the text alignment, position, and line spacing are adjusted on this basis. However, the text length often increases after translation, leading to abnormal UI layout or text truncation in an inappropriate position. For example, Russian or Norwegian words are usually longer than English words. If the reserved space on the UI is small, the text that exceeds the scope is truncated, and consequently the translated text cannot be displayed completely. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**Abnormal text or symbol display**: This is usually due to a lack of fonts or typesetting capabilities of the system, which arises from the misunderstanding that users would not enter special characters or characters in a specific language during software usage. For example, if a user enters Uyghur text on a Chinese UI, the text may not be properly displayed. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Test Process 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci1. Switch to the target locale for pseudo-localization testing, for example, **en-XA**. 16e41f4b71Sopenharmony_ci You can switch the locale through the code (system permission required): 17e41f4b71Sopenharmony_ci ```ts 18e41f4b71Sopenharmony_ci import I18n from '@ohos.i18n' 19e41f4b71Sopenharmony_ci I18n.System.setSystemLanguage('en-XA') 20e41f4b71Sopenharmony_ci ``` 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci2. Traverse the applications to be tested. 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci## **Test Item** 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci1. Check the UI for text truncation or distortion, or abnormal layout. Text truncation can be observed by checking whether the text ends with **]** (a right square bracket). If the text does not end with **]**, it is not completely displayed. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci2. Check for hard coding problems. Hard coding of UI text can be observed by checking whether the text is processed in pseudo-translation format. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci3. Check for string concatenation. String concatenation can be observed by checking whether strings in the pseudo-translation format appear in the same control in a consecutive manner, for example, **[string 1][string 2]**. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci4. Check whether the multilingual text is displayed properly. If the text is not properly displayed, for example, squares or blanks are present or the text is incomplete or partially truncated, the display is abnormal. 36