AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Go I18n

skill-castle-x-skills-x-go-i18n · by castle-x

Use when defining or updating Go CLI i18n rules in this repo, especially around locale files, env-based language selection, and key naming.

No reviews yet
0 installs
5 views
0.0% view→install

Install

$ agentstack add skill-castle-x-skills-x-go-i18n

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-castle-x-skills-x-go-i18n)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Go I18n? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Go CLI i18n

Overview

This skill documents the Go CLI i18n rules used in this repo, including language detection, locale files, and key naming conventions.

When to Use

  • You add or edit any user-facing CLI string in cmd/skills-x
  • You need to add a new skill description for list output
  • You are troubleshooting mixed language output or missing translations

Architecture Snapshot

  • i18n runtime: cmd/skills-x/i18n/i18n.go
  • Locale files: cmd/skills-x/i18n/locales/zh.yaml, cmd/skills-x/i18n/locales/en.yaml
  • Embed: //go:embed locales/*.yaml (locales are embedded at build time)

Language Selection

Priority order in detectLanguage():

  1. SKILLS_LANG
  2. LANG
  3. LC_ALL
  4. Default: zh

Normalization uses prefix matching:

  • zh, zh_CN, zh_TWzh
  • en, en_USen
  • Unsupported → zh

Using i18n in Go

Initialize once (early in main):

import "github.com/castle-x/skills-x/cmd/skills-x/i18n"

i18n.MustInit()

Translate strings:

title := i18n.T("list_header")
msg := i18n.Tf("init_success", skillName)

Missing keys return the key itself (useful for spotting gaps).

Key Naming Conventions

Use lowercase + underscores with category prefixes:

  • app_ app metadata
  • cmd_ command descriptions/flags
  • list_ list output
  • init_ init output
  • err_ error messages
  • cat_ category names
  • skill_ skill descriptions
  • meta_ meta warnings

Rule: Never mix Chinese and English in the same string. Use two locale keys instead.

Adding New Strings

  1. Add the same key to both locale files:
  • cmd/skills-x/i18n/locales/zh.yaml
  • cmd/skills-x/i18n/locales/en.yaml
  1. Use i18n.T / i18n.Tf in Go code.
  2. Rebuild (make build) to embed the updated YAML.
  3. Test:
  • SKILLS_LANG=zh ./bin/skills-x list
  • SKILLS_LANG=en ./bin/skills-x list

New Skill Description

Add a skill_ key to both locale files. The list view reads descriptions from i18n, not from the skill file.

Example

# locales/en.yaml
init_success: "Installed: %s"

# locales/zh.yaml
init_success: "安装成功: %s"
fmt.Println(i18n.Tf("init_success", skillName))

Quick Reference

| Item | Value | |------|-------| | Locale files | cmd/skills-x/i18n/locales/{zh,en}.yaml | | Init | i18n.MustInit() | | Translate | i18n.T, i18n.Tf | | Language priority | SKILLS_LANG > LANG > LC_ALL > zh |

Common Mistakes

  • Only adding a key in one locale file
  • Hardcoding mixed-language strings
  • Forgetting to rebuild after YAML changes
  • Formatting with fmt.Sprintf before calling i18n.Tf

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.