feat(09-03): localize form schemas and resolve dropdown options
- Cached schemas stay source-key IR and each response carries its own meta.locale - YAML option maps keep declaration order and scalar type; method options call DropdownOptions and fail boot without a provider
This commit is contained in:
@@ -116,6 +116,14 @@ func Activate[P interface{ ID() string }](app *backpack.App, plugins []P) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// Locale returns the configured app locale. Request locales stay on the context.
|
||||
func (t *Translator) Locale() string {
|
||||
if t == nil || strings.TrimSpace(t.locale) == "" {
|
||||
return defaultLocale
|
||||
}
|
||||
return t.locale
|
||||
}
|
||||
|
||||
// Get returns the translation for key using the request locale when present,
|
||||
// otherwise the configured app locale.
|
||||
func (t *Translator) Get(ctx context.Context, key string, params map[string]string) string {
|
||||
|
||||
Reference in New Issue
Block a user