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 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.
Click to show internal directories.
Click to hide internal directories.