用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/FelisDiligens/QuickConfiguration2 --skill translate命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | translate |
| description | Translate literal strings in the code base. Use when the user asks you to translate strings. |
| user-invocable | true |
| allowed-tools | ["read_file","grep","ask_user_question","search_replace","write_file"] |
The task is to translate literal strings in React components, such as:
<thead>
<tr>
<th className="expand">
Mod name and info
</th>
<th className="center">
Version
</th>
<th className="center">
Status
</th>
<th className="center">
Endorsed
</th>
<th className="center">
Actions
</th>
</tr>
</thead>
Move them into ./src/i18n/en.json:
{
"mods": {
"modOrderTab": {
"table": {
"header": {
"modName": "Mod name & info",
"version": "Version",
"status": "Status",
"endorsed": "Endorsed",
"actions": "Actions"
}
}
}
}
}
And replace the literal strings with calls to the t function:
<thead>
<tr>
<th className="expand">
{t("mods.modOrderTab.table.header.modName")}
</th>
<th className="center">
{t("mods.modOrderTab.table.header.version")}
</th>
<th className="center">
{t("mods.modOrderTab.table.header.status")}
</th>
<th className="center">
{t("mods.modOrderTab.table.header.endorsed")}
</th>
<th className="center">
{t("mods.modOrderTab.table.header.actions")}
</th>
</tr>
</thead>
If the literal string is within TypeScript code instead of a React component (JSX), such as:
const text = `Removing mod ${removedMods + 1} of ${totalMods}: ${modTitle}, file ${removedFiles + 1} of ${totalFiles}: ${fileName}`;
You can still translate it like so:
"removingModStatusText": "Removing mod {{removedMods}} of {{totalMods}}: {{modTitle}}, file {{removedFiles}} of {{totalFiles}}: {{fileName}}",
And replace the literal string with a call to the t function:
const text = t("mods.modOrderTab.progress.removingModStatusText", {
removedMods: removedMods + 1,
totalMods,
modTitle,
removedFiles: removedFiles + 1,
totalFiles,
fileName
});
Use
pnpm lint
to identify literal strings and TODO comments mentioning missing translations.
Once you're done with the English en.json translations, also add German translations to de.json.
i18next and react-i18next../src/i18n/*.json/pipboy) has it's own key: pipboy.*mods.* etc.).common.* and errors.* which may be used across views. They should be used sparingly. You may add to them for very common strings, such as OK, Yes, Not found, Loading..., etc.*.json files.<p>This tweak changes <code>fRotationSpeed</code> to <code>0.1</code>.</p> --> "This tweak changes the <code>{{iniKey}}</code> to <code>{{value}}</code>". You never know when paths (etc.) change and they should not be translated or else they may become stale.pnpm lint to find strings to translate, it'll show:
warning disallow literal string: orwarning Unexpected 'todo' comment: 'TODO: Translate'
TODO: Translate. They may just hint at a missing translation.t functiont function to get translated strings.
*.json files, you need to build a path to it, e.g.: t("tweaks.accessibility.screenNarrationVoiceType")."screenNarrationVoiceType": "Stimmtyp {{num}}",t function, use an object as a second parameter: t("tweaks.accessibility.screenNarrationVoiceType", { num: 2 })useTranslation hook to get an instance of t: const { t } = useTranslation();import { useTranslation } from "react-i18next";t by importing it: import { t } from "i18next";useTranslation hook over the global instance where possible.<Trans> componentIf tags such as <a href="">, <b>, <code>, etc. are used within the string, you may have to use the <Trans> component. For example:
<Trans
t={t}
i18nKey="errors.routeNotFound"
values={{ route: location.pathname }}
components={{ code: <code /> }}
/>
"routeNotFound": "Die Route <code>{{route}}</code> existiert nicht.",
components prop:<Trans
t={t}
i18nKey="errors.iniNotFound.text"
components={{ a: <Link to="/profiles" /> }}
/>
Always prefer the t function over the <Trans> component. Only use the <Trans> component if there are tags in the string.