Documentation
¶
Overview ¶
Package locale provides cross-platform language detection and translation.
Detection priority:
- CCL_LANG environment variable
- ~/.ccl/config.yaml lang field
- OS-level language setting (via environment on Unix, Win32 API on Windows)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaudeCodeLanguageName ¶ added in v1.5.7
ClaudeCodeLanguageName maps a ccl locale to the natural-language name that Claude Code's `language` setting expects (e.g. "中文" for zh-CN). This lives in locale — the package that owns language display names — because internal/ packages outside locale must not hold Chinese string literals.
func Current ¶
func Current() string
Current returns the current full locale code (e.g. "zh-CN", "en-US").
func IsChinese ¶
func IsChinese() bool
IsChinese returns true when the current language is a Chinese variant.
func SetLanguage ¶
SetLanguage overrides the language at runtime and returns the canonical form.
Types ¶
type LanguageManager ¶
type LanguageManager struct {
// contains filtered or unexported fields
}
LanguageManager manages the current language and provides translations.