Add i18n framework with English and Chinese support
Introduce an embedded-locale i18n package exposing a T() template function. UI strings across all templates and catalog category/item names are now translatable via locale JSON files, selectable through the new server.language config option. Falls back to English when a locale is missing or fails to load. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
5e82e32491
commit
ff1d1fc490
16 files changed
+1161
-318
No files matched your search
@@ -21,6 +21,7 @@ type ServerConfig struct {
|
||||
BaseURL string `toml:"base_url"`
|
||||
ReadTimeout string `toml:"read_timeout"`
|
||||
WriteTimeout string `toml:"write_timeout"`
|
||||
Language string `toml:"language"`
|
||||
}
|
||||
|
||||
type AdminConfig struct {
|
||||
@@ -65,6 +66,7 @@ func Load(path string) (*Config, error) {
|
||||
BaseURL: "http://localhost:8889",
|
||||
ReadTimeout: "5s",
|
||||
WriteTimeout: "10s",
|
||||
Language: "en",
|
||||
},
|
||||
Admin: AdminConfig{
|
||||
Username: "admin",
|
||||
|
||||
Reference in new issue
Block a user