yoruba-localization-testing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYoruba Localization Testing
Yoruba 本地化测试
Use this skill when implementing or reviewing Yoruba–English interfaces. It targets correctness of Yoruba typography, message handling, and user experience, rather than providing automatically approved translations. It complements (message parity) and (assistive technology support).
i18n-syncaccessibility在实现或审查 Yoruba–English 界面时使用此 skill。其目标是确保 Yoruba 排版、消息处理和用户体验的正确性,而不是提供自动批准的译文。它与 (消息一致性)和 (辅助技术支持)互补。
i18n-syncaccessibilityWhen to Activate
何时启用
- Building web or mobile interfaces with or
yolocale options.en - Fixing misplaced, removed, or corrupted Yoruba diacritics in text, input, search, storage, or exports.
- Reviewing English fallbacks, language selection, localization regression tests, and screen-reader language metadata.
- Evaluating an AI-generated Yoruba translation before it is released to users.
- 构建提供 或
yolocale 选项的 Web 或移动界面。en - 修复文本、输入、搜索、存储或导出中位置错误、丢失或损坏的 Yoruba 变音符号。
- 审查英语回退、语言选择、本地化回归测试以及屏幕阅读器语言元数据。
- 在向用户发布前评估 AI 生成的 Yoruba 译文。
Core Concepts
核心概念
- Yoruba includes distinct letters ,
ẹ,ọand tone-marked vowels such asṣ,á,à, andẹ́. Tone and underdot differences can change meaning.ọ̀ - Store and transmit text in UTF-8. Normalize to NFC for canonical comparisons or consistent storage, but do not strip tones or underdots from the visible text.
- Prefer BCP 47 language tags and
yo. Set the screen-reader language for Yoruba text (for example,enon web content), and verify the assistive technology's actual language support.lang="yo" - Do not replace human review with machine translation. Require fluent Yoruba review for meaning, naturalness, tone, terminology, and dialect-sensitive content.
- A missing translation may fall back visibly to English. Never silently fabricate strings for legal, medical, safety, or financial content.
- Placeholders and message keys are code contracts: do not translate identifiers or remove interpolation fields.
- Yoruba 包含独特的字母 、
ẹ、ọ,以及带声调符号的元音,如ṣ、á、à和ẹ́。声调和下加点(underdot)的差异可能改变含义。ọ̀ - 使用 UTF-8 存储和传输文本。规范化至 NFC,以便进行规范比较或保持一致的存储,但不要从可见文本中移除声调或下加点。
- 优先使用 BCP 47 语言标签 和
yo。为 Yoruba 文本设置屏幕阅读器语言(例如,在 Web 内容中使用en),并验证辅助技术实际的语言支持情况。lang="yo" - 不要用机器翻译取代人工审查。对于含义、自然度、语气、术语和方言敏感内容,必须由流利的 Yoruba 使用者进行审查。
- 缺失的翻译可以明确显示为英语回退。对于法律、医疗、安全或金融内容,绝不要静默杜撰字符串。
- 占位符和消息键属于代码契约:不要翻译标识符,也不要移除插值字段。
Implementation Workflow
实现工作流
- Audit visible interface strings and extract them to stable locale keys.
- Define and
endictionaries with explicit missing-key fallback; document which translation keys require review.yo - Preserve Unicode composition, punctuation, placeholders, screen-reader language tags, and user-entered spelling.
- Validate locale switching without losing entered form values or navigation position.
- Test canonical Unicode equivalence, distinct tone-marked letters, JSON/API/database round trips, and missing translations.
- Check actual fonts, mobile layouts, keyboard support, and screen readers; seek fluent Yoruba approval before declaring localization complete.
- 审查可见的界面字符串,并将其提取为稳定的 locale 键。
- 定义 和
en字典,并明确设置缺失键的回退机制;记录哪些翻译键需要审查。yo - 保留 Unicode 组合形式、标点、占位符、屏幕阅读器语言标签以及用户输入的拼写。
- 验证切换 locale 时不会丢失已填写的表单值或导航位置。
- 测试 Unicode 规范等价性、不同的带声调字母、JSON/API/数据库往返处理以及缺失翻译。
- 检查实际字体、移动端布局、键盘支持和屏幕阅读器;在宣布本地化完成之前,寻求流利的 Yoruba 使用者确认。
Code Examples
代码示例
See for a runnable, dependency-free implementation. Example strings are illustrative, not a substitute for native-speaker review.
examples/localization.mjsjavascript
import { translate, sameNormalizedText } from './examples/localization.mjs';
translate('yo', 'welcome'); // 'Ẹ káàbọ̀'
translate('yo', 'logout'); // 'Log out' (English fallback)
sameNormalizedText('ẹ́', 'ẹ\u0301'); // true: canonically equivalent
sameNormalizedText('ẹ', 'e'); // false: different Yoruba lettersA web component can use to identify the language without altering the source text. Use your platform's equivalent language metadata on mobile.
<span lang="yo">Ẹ káàbọ̀</span>有关可运行且无依赖项的实现,请参阅 。示例字符串仅用于说明,不能替代母语使用者的审查。
examples/localization.mjsjavascript
import { translate, sameNormalizedText } from './examples/localization.mjs';
translate('yo', 'welcome'); // 'Ẹ káàbọ̀'
translate('yo', 'logout'); // 'Log out' (English fallback)
sameNormalizedText('ẹ́', 'ẹ\u0301'); // true: canonically equivalent
sameNormalizedText('ẹ', 'e'); // false: different Yoruba lettersWeb 组件可以使用 标识语言,而不改变源文本。在移动端,应使用平台对应的语言元数据。
<span lang="yo">Ẹ káàbọ̀</span>Run Regression Tests
运行回归测试
From the ECC repository root:
sh
node skills/yoruba-localization-testing/examples/localization.test.mjsThe test file covers six independent cases: Yoruba text, English, fallback, Unicode normalization, distinguishing tone/underdot differences, and JSON round trips. It uses only Node built-ins (Node 18+).
在 ECC 仓库根目录中执行:
sh
node skills/yoruba-localization-testing/examples/localization.test.mjs测试文件涵盖六个独立用例:Yoruba 文本、英语、翻译回退、Unicode 规范化、区分声调与下加点差异,以及 JSON 往返处理。它仅使用 Node 内置模块(Node 18+)。
Anti-Patterns
反模式
- for display text: this destroys information.
text.normalize('NFD').replace(/\p{M}/gu, '') - Replacing with
ẹ,ewithọ, orowithṣ.s - Assuming Yoruba speakers want a Yoruba-only UI, or translating programming identifiers.
- Shipping auto-generated Yoruba wording without review by a competent speaker.
- Marking localization complete after tests pass without checking font glyphs and assistive technologies.
- 对显示文本使用 :这会破坏信息。
text.normalize('NFD').replace(/\p{M}/gu, '') - 将 替换为
ẹ、e替换为ọ,或将o替换为ṣ。s - 假设 Yoruba 使用者希望只使用 Yoruba 界面,或翻译编程标识符。
- 未经称职的母语使用者审查,就发布自动生成的 Yoruba 措辞。
- 测试通过后,在未检查字体字形和辅助技术的情况下便宣布本地化完成。
Best Practices
最佳实践
- Keep translation fixtures in UTF-8 source files under version control.
- Verify locale behavior in target browsers/runtimes rather than assuming every environment supports
Intlequally.yo - Make locale switching reversible, clearly labeled, and keyboard accessible.
- Provide a way to report problematic translations and record review status.
- Test mixed English/Yoruba sentences and longer content on real devices.
- 将翻译测试夹具保存在版本控制下的 UTF-8 源文件中。
- 在目标浏览器或运行时中验证 的 locale 行为,不要假设每个环境都同等支持
Intl。yo - 确保 locale 切换可逆、标签清晰,并可通过键盘操作。
- 提供报告问题译文的方式,并记录审查状态。
- 在真实设备上测试英语与 Yoruba 混合句子和较长内容。
Related Skills
相关 Skills
- — locale keys and translation parity.
i18n-sync - — screen readers and accessible interactions.
accessibility - — web UI patterns.
frontend-patterns - — regression-driven implementation.
tdd-workflow
- — locale 键和翻译一致性。
i18n-sync - — 屏幕阅读器和无障碍交互。
accessibility - — Web UI 模式。
frontend-patterns - — 回归测试驱动的实现。
tdd-workflow