This skill should be used when implementing internationalization (i18n), creating language files, using game.i18n.localize/format, adding template localization helpers, or following best practices for translatable strings.
Provides Foundry VTT localization guidance for creating language files, using game.i18n.localize/format, and adding template helpers. Triggers when implementing i18n or adding translatable strings to modules/systems.
/plugin marketplace add ImproperSubset/hh-agentics/plugin install fvtt-dev@hh-agenticsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Domain: Foundry VTT Module/System Development Status: Production-Ready Last Updated: 2026-01-05
Foundry VTT uses JSON language files for internationalization. All user-facing text should be localized to support translation.
{
"MYMODULE.Title": "My Module",
"MYMODULE.Settings.Enable": "Enable Feature",
"MYMODULE.Settings.EnableHint": "Turn this feature on or off",
"MYMODULE.Dialog.Confirm": "Are you sure?",
"MYMODULE.Button.Save": "Save",
"MYMODULE.Button.Cancel": "Cancel"
}
Use your package ID as prefix to avoid conflicts:
{
"MYSYSTEM.Actor.HP": "Hit Points",
"MYSYSTEM.Actor.AC": "Armor Class",
"MYSYSTEM.Item.Weight": "Weight"
}
{
"TYPES": {
"Actor": {
"character": "Character",
"npc": "Non-Player Character",
"vehicle": "Vehicle"
},
"Item": {
"weapon": "Weapon",
"armor": "Armor",
"spell": "Spell"
}
}
}
{
"id": "my-module",
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "es",
"name": "Español",
"path": "lang/es.json"
},
{
"lang": "fr",
"name": "Français",
"path": "lang/fr.json"
}
]
}
Use ISO 639-1 (2-letter) or ISO 639-2 (3-letter) codes:
en - Englishes - Spanishfr - Frenchde - Germanja - Japanesezh - ChineseSimple string lookup:
const title = game.i18n.localize("MYMODULE.Title");
// Returns: "My Module"
// Missing key returns the key itself
const missing = game.i18n.localize("MYMODULE.Missing");
// Returns: "MYMODULE.Missing"
String interpolation with variables:
{
"MYMODULE.Welcome": "Welcome, {name}!",
"MYMODULE.ItemCount": "You have {count} items",
"MYMODULE.Comparison": "{item1} vs {item2}"
}
game.i18n.format("MYMODULE.Welcome", { name: "Alice" });
// Returns: "Welcome, Alice!"
game.i18n.format("MYMODULE.ItemCount", { count: 5 });
// Returns: "You have 5 items"
game.i18n.format("MYMODULE.Comparison", {
item1: "Sword",
item2: "Axe"
});
// Returns: "Sword vs Axe"
Check if translation exists:
// Check with English fallback
if (game.i18n.has("MYMODULE.Feature")) {
// Key exists (in current language OR English)
}
// Check without fallback
if (game.i18n.has("MYMODULE.Feature", false)) {
// Key exists in current language only
}
Format lists according to locale:
const formatter = game.i18n.getListFormatter({
style: "long", // "long", "short", "narrow"
type: "conjunction" // "conjunction", "disjunction"
});
formatter.format(["apples", "oranges", "bananas"]);
// English: "apples, oranges, and bananas"
// Spanish: "manzanas, naranjas y plátanos"
<h1>{{localize "MYMODULE.Title"}}</h1>
<button>{{localize "MYMODULE.Button.Save"}}</button>
<!-- In attributes, use single quotes -->
<input placeholder="{{localize 'MYMODULE.Placeholder'}}">
<a title="{{localize 'MYMODULE.Tooltip'}}">Hover me</a>
{{localize "MYMODULE.Welcome" name=user.name}}
{{localize "MYMODULE.ItemCount" count=items.length}}
{{localize (concat "MYMODULE.Status." statusKey)}}
Foundry has no built-in pluralization. Handle manually:
{
"MYMODULE.Item.One": "1 item",
"MYMODULE.Item.Many": "{count} items"
}
function localizeCount(count) {
const key = count === 1
? "MYMODULE.Item.One"
: "MYMODULE.Item.Many";
return game.i18n.format(key, { count });
}
// For complex languages, use multiple keys
const key = count === 0 ? "Zero"
: count === 1 ? "One"
: count < 5 ? "Few"
: "Many";
return game.i18n.format(`MYMODULE.Items.${key}`, { count });
{
// Good - specific and hierarchical
"MYSYS.CharacterSheet.Abilities.Strength": "Strength",
"MYSYS.CharacterSheet.Abilities.Dexterity": "Dexterity",
"MYSYS.Dialog.ConfirmDelete.Title": "Confirm Deletion",
"MYSYS.Dialog.ConfirmDelete.Message": "Delete {name}?",
// Bad - vague and conflict-prone
"MYSYS.Label": "Label",
"MYSYS.Title": "Title",
"MYSYS.Button": "Button"
}
{
// Good - translator can reorder
"MYMODULE.Message": "The {adjective} {noun} is here",
// Bad - forces English word order
"MYMODULE.Prefix": "The",
"MYMODULE.Suffix": "is here"
}
{
// Good - separate by context
"MYSYS.Button.Save.Settings": "Save Settings",
"MYSYS.Ability.Save.Fortitude": "Fortitude Save",
// Bad - ambiguous
"MYSYS.Save": "Save"
}
Do localize:
Don't localize:
game.settings.register("my-module", "enableFeature", {
name: game.i18n.localize("MYMODULE.Settings.Enable"),
hint: game.i18n.localize("MYMODULE.Settings.EnableHint"),
scope: "world",
type: Boolean,
default: true
});
new Dialog({
title: game.i18n.localize("MYMODULE.Dialog.Title"),
content: game.i18n.format("MYMODULE.Dialog.Content", {
name: item.name
}),
buttons: {
confirm: {
label: game.i18n.localize("MYMODULE.Button.Confirm"),
callback: () => { /* ... */ }
},
cancel: {
label: game.i18n.localize("MYMODULE.Button.Cancel")
}
}
}).render(true);
ui.notifications.info(
game.i18n.format("MYMODULE.Notification.Created", {
type: item.type,
name: item.name
})
);
// WRONG - breaks translation
const msg = game.i18n.localize("MYMOD.The") + " " +
name + " " +
game.i18n.localize("MYMOD.IsReady");
// CORRECT - use format with placeholders
const msg = game.i18n.format("MYMOD.ItemReady", { name });
// WRONG
ui.notifications.info("Character saved!");
// CORRECT
ui.notifications.info(game.i18n.localize("MYMOD.CharacterSaved"));
// Be defensive with dynamic keys
const key = `MYMOD.Status.${status}`;
const label = game.i18n.has(key)
? game.i18n.localize(key)
: status; // Fallback to raw value
<!-- WRONG - breaks attribute -->
<input title="{{localize "MYMOD.Tip"}}">
<!-- CORRECT - use single quotes inside -->
<input title="{{localize 'MYMOD.Tip'}}">
// Don't forget to register in manifest!
{
"languages": [
{ "lang": "en", "name": "English", "path": "lang/en.json" }
]
}
my-module/
├── module.json
├── lang/
│ ├── en.json # Required - fallback language
│ ├── es.json
│ ├── fr.json
│ └── de.json
├── templates/
│ └── sheet.hbs
└── scripts/
└── main.js
lang/en.json with all stringslocalize() for simple stringsformat() for strings with variablesLast Updated: 2026-01-05 Status: Production-Ready Maintainer: ImproperSubset
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.