关于 qe-localization-testing
用于检查多语言软件国际化与本地化的测试技能,面向开发和测试团队。它通过清单和示例覆盖翻译、地区格式、从右向左布局、Unicode 及文化适切性。
主要功能
- 01翻译覆盖率检查
- 02地区化日期和数字格式
- 03从右向左布局验证
- 04Unicode 字符支持检查
- 05文化适切性审查
适用场景
- 01为产品进入新市场做准备
- 02添加语言支持
- 03检查国际版本发布
- 04验证不同地区的界面更改
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill qe-localization-testing安装后在 Claude Code 中输入/qe-localization-testing确认已加载。
详细介绍
本地化与国际化测试
<default_to_action> 测试多语言/地区支持时:
- 验证翻译覆盖率(所有字符串均已翻译)
- 测试地区特定格式(日期、时间、货币、数字)
- 验证 RTL 布局(阿拉伯语、希伯来语)
- 检查字符编码(UTF-8、Unicode)
- 确认文化适宜性(图标、颜色、内容)
i18n 快速检查清单:
- 将所有面向用户的字符串外置
- 代码中没有硬编码文本
- 日期/时间/货币按地区格式显示
- RTL 语言的布局正确翻转
- Unicode 字符显示正常
关键成功因素:
- 不要硬编码字符串——将所有内容外置
- 与真实使用者测试,而不只是检查翻译文件
- RTL 需要镜像翻转 UI 布局 </default_to_action>
快速参考卡
适用场景
- 进入新市场
- 添加语言支持
- 国际版本发布前
- UI 变更后
i18n 与 l10n
| 术语 | 全称 | 重点 |
|---|---|---|
| i18n | 国际化 | 为本地化构建 |
| l10n | 本地化 | 针对特定地区进行适配 |
常见地区格式
| 类型 | 美国 (en-US) | 英国 (en-GB) | 日本 (ja-JP) |
|---|---|---|---|
| 日期 | 10/24/2025 | 24/10/2025 | 2025/10/24 |
| 货币 | $1,234.56 | £1,234.56 | ¥1,235 |
| 数字 | 1,234.56 | 1,234.56 | 1,234.56 |
翻译覆盖率测试
test('all strings are translated', () => {
const enKeys = Object.keys(translations.en);
const frKeys = Object.keys(translations.fr);
const esKeys = Object.keys(translations.es);
// All locales have same keys
expect(frKeys).toEqual(enKeys);
expect(esKeys).toEqual(enKeys);
});
test('no missing translation placeholders', async ({ page }) => {
await page.goto('/?lang=fr');
const text = await page.textContent('body');
// Should not see placeholder keys
expect(text).not.toContain('translation.missing');
expect(text).not.toMatch(/\{\{.*\}\}/); // {{key}} format
});
日期/时间/货币格式
test('date formats by locale', () => {
const date = new Date('2025-10-24');
expect(formatDate(date, 'en-US')).toBe('10/24/2025');
expect(formatDate(date, 'en-GB')).toBe('24/10/2025');
expect(formatDate(date, 'ja-JP')).toBe('2025/10/24');
});
test('currency formats by locale', () => {
const amount = 1234.56;
expect(formatCurrency(amount, 'en-US', 'USD')).toBe('$1,234.56');
expect(formatCurrency(amount, 'de-DE', 'EUR')).toBe('1.234,56 €');
expect(formatCurrency(amount, 'ja-JP', 'JPY')).toBe('¥1,235');
});
RTL(从右到左)测试
test('layout flips for RTL languages', async ({ page }) => {
await page.goto('/?lang=ar'); // Arabic
const dir = await page.locator('html').getAttribute('dir');
expect(dir).toBe('rtl');
// Navigation should be on right
const nav = await page.locator('nav');
const styles = await nav.evaluate(el =>
window.getComputedStyle(el)
);
expect(styles.direction).toBe('rtl');
});
test('icons/images appropriate for RTL', async ({ page }) => {
await page.goto('/?lang=he'); // Hebrew
// Back arrow should point right in RTL
const backIcon = await page.locator('.back-icon');
expect(await backIcon.getAttribute('class')).toContain('rtl-flipped');
});
Unicode 字符支持
test('supports unicode characters', async ({ page }) => {
// Japanese
await page.fill('#name', '山田太郎');
await page.click('#submit');
const saved = await db.users.findOne({ /* ... */ });
expect(saved.name).toBe('山田太郎');
// Arabic
await page.fill('#name', 'محمد');
// Emoji
await page.fill('#bio', '👋🌍');
expect(saved.bio).toBe('👋🌍');
});
Agent 驱动的本地化测试
// Comprehensive localization validation
await Task("Localization Testing", {
url: 'https://example.com',
locales: ['en-US', 'fr-FR', 'de-DE', 'ja-JP', 'ar-SA'],
checks: ['translations', 'formats', 'rtl', 'unicode'],
detectHardcodedStrings: true
}, "qe-test-generator");
// Returns:
// {
// locales: 5,
// missingTranslations: 3,
// formatIssues: 1,
// rtlIssues: 0,
// hardcodedStrings: ['button.submit', 'header.title']
// }
Agent 协作提示
记忆命名空间
aqe/localization-testing/
├── translations/* - Translation coverage
├── formats/* - Locale-specific formats
├── rtl-validation/* - RTL layout checks
└── unicode/* - Character encoding tests
Fleet 协作
const l10nFleet = await FleetManager.coordinate({
strategy: 'localization-testing',
agents: [
'qe-test-generator', // Generate l10n tests
'qe-test-executor', // Execute across locales
'qe-visual-tester' // RTL visual validation
],
topology: 'parallel'
});
相关技能
- accessibility-testing - 语言无障碍
- compatibility-testing - 跨平台 i18n
- visual-testing-advanced - RTL 视觉回归测试
请牢记
不要硬编码。将所有面向用户的字符串外置。 用户可见的每个字符串都必须来自翻译文件,而不是代码。
与母语使用者测试,而不只是检查翻译文件。 机器翻译和翻译文件可能存在语境问题,只有母语使用者才能发现。
使用 Agent: Agent 可验证翻译覆盖率、检测硬编码字符串、测试地区特定格式,并在所有受支持语言中自动验证 RTL 布局。
评论
支持 Markdown