# Language data in the Web UI

The language page uses `locale.LocaleEntry` and `locale.RegionEntry` directly.
`LoadLocales` in [locale.go](locale.go) returns a copy of the cached embedded
entries; display helpers in that file format regional and native names and
select flag images. Template common-language checks call
`locale.IsCommonLanguage` directly.

The shared selection implementation is [pkg/locale/selection.go](../locale/selection.go).
It provides `SearchLanguages`, `GetMajorLanguages`, and `GetMajorRegionalVariants`.
The TUI uses those functions and its region-list adapter. The Web page uses
[the languages controller](../../internal/webassets/static/languages.js) for
interactive filtering, selection, and ordering.

The unused `web.LanguageOption` compatibility API and duplicate query wrappers
were removed during the September 8 remediation. New code should use the shared
locale types and active page/controller paths. Existing coverage lives in
[Web locale tests](locale_test.go), [shared selection tests](../locale/selection_test.go),
[TUI preference tests](../tui/language_preferences_test.go), and the frontend
language tests under `internal/webassets`.
