Skip to main content

search-i18n-translations

Searches lang/en.json for existing i18n strings in opencollective-frontend. Use when implementing UIs, adding user-facing text, or when the user asks to find or reuse translations.

跳到安装

来源信息

仓库
opencollective/monorepo
最近来源活动
2026年3月18日 07:52
检测到的 SKILL.md 语言
英语
星标
3
分支
3

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
search-i18n-translations
description
Searches lang/en.json for existing i18n strings in opencollective-frontend. Use when implementing UIs, adding user-facing text, or when the user asks to find or reuse translations.
# Search i18n Translations ## When to Use - Before adding new translation keys—check if a suitable string already exists - When implementing UI components that need user-facing text - When asked to find translations for a given phrase or concept ## Command From the workspace root, search `opencollective-frontend/lang/en.json` directly with grep: ```bash grep -i "search string" opencollective-frontend/lang/en.json ``` ## Match Modes ### Partial match (default) Case-insensitive search in both translation IDs and messages. Use when exploring or when you have a word or phrase: ```bash grep -i "payout method" opencollective-frontend/lang/en.json ``` ### Exact match Use when you have the **exact** translation ID or the **exact** message text. **Exact ID** (key in the JSON): ```bash grep '"Ri4REE":' opencollective-frontend/lang/en.json ``` **Exact message** (full value only—use `-F` to avoid regex, escape quotes if needed): ```bash grep -F '": "Select a payout method"' opencollective-frontend/lang/en.json ``` For exact message, the pattern is `": "your exact message"` so the match is on the full value, not a substring. ## Usage in Components When a suitable translation exists, use it with `FormattedMessage`: ```tsx <FormattedMessage defaultMessage="Select a payout method" id="Ri4REE" /> ``` Alternatively, when a string is needed as the output, use `intl.formatMessage`: ```tsx const itemLabel = intl.formatMessage({ id: "Ri4REE", defaultMessage: "Select a payout method", }); ``` Prefer reusing existing translations over adding new keys to keep the translation set maintainable.
在 GitHub 查看