为界面添加伪本地化测试
生成仅供开发测试使用的伪语言环境,检查文本溢出、编码、占位符和布局问题,并记录发现结果。
完整提示词
<context>
Pseudo-localisation finds localisation bugs before any translator is paid. Each catalog string is transformed so it stays readable to the team but looks foreign: accented characters (`Ŝàvé`) reveal encoding and font problems, padding reveals truncation and layouts that cannot grow, and brackets around every string (`[Ŝàvé ~~~]`) reveal text that was concatenated from pieces or never extracted at all, because anything on screen without brackets did not come from the catalog. It must never leak into a real locale or production build, and it must keep placeholders, plural syntax and markup intact or it creates bugs of its own.
</context>
<task>
Add pseudo-localisation to this project and report what it reveals.
i18n setup: {{i18n_setup}}
Expansion: {{expansion_percent}} percent.
1. Read the i18n setup: catalog format and location, how the current locale is chosen, the interpolation, plural and rich-text syntax, and how the app is built and run. If the setup described above does not match the repository, or there is no catalog at all, stop and report that, since there is nothing to pseudo-localise.
2. Choose the lightest integration that fits: a generated pseudo locale (for example `en-XA`, or the platform's built-in pseudolocales on Android) produced from the source catalog by a script or the i18n library's post-processor, selectable through the normal locale switch in development and test builds only. Prefer a built-in or already installed tool over writing a new transformer.
3. The transformation must:
- Replace letters with accented look-alikes and pad each string by about {{expansion_percent}} percent (more for very short strings), then wrap it in visible brackets.
- Leave untouched every placeholder and variable, ICU or platform plural and select syntax, HTML or markup tags, escape sequences and format specifiers. Verify this by parsing the generated catalog with the same library the app uses.
- Optionally support a right-to-left variant if the product ships to RTL locales, marked as optional.
4. Exclude the pseudo locale from production builds and from the list of languages shown to users. Never modify the real source or translated catalogs.
5. Run the app (or its UI tests, screenshot tests or storybook) in the pseudo locale and walk the main screens. Record: text without brackets (hard-coded or concatenated), clipped or overlapping text, layouts that break with longer strings, characters that render as boxes, placeholders that appear raw, and strings split into fragments. If you cannot run the UI yourself, provide the run command and a checklist instead, and say so.
6. Add a short note to the developer docs on how to switch to the pseudo locale.
</task>
<constraints>
- Do not change real translations, source strings or keys, and do not fix the issues you find in this task; list them.
- Keep the pseudo locale out of production builds; show how you verified that.
{{> guardrails/scope-discipline}}
{{> guardrails/verify-before-done}}
</constraints>
<output_format>
## Approach
The tool or script chosen, the pseudo locale code, and how it is generated.
## Changes
A unified diff.
## How to run
Commands to generate the catalog and start the app or tests in the pseudo locale.
## Issues found
| Screen or component | Issue type | Evidence (string, key or file:line) | Suggested fix |
## Not checked
Screens or flows you could not reach.
## Verification
Commands run, proof that placeholders and plural syntax survived, and proof that the pseudo locale is excluded from production builds.
</output_format>可替换内容
- {{i18n_setup}}
- {{expansion_percent}}
- {{> guardrails/scope-discipline}}
- {{> guardrails/verify-before-done}}
- [Ŝàvé ~~~]
分类与标签
编程开发、国际化测试、界面测试、伪本地化