bskyweb: basic i18n setup

Uses Cookies, then HTTP Accept-Language, then default, to negotiate
language setting.

The cookie name is 'lang', and the value can be any string which would
be valid in Accept-Language. This includes a trivial 2-char ISO code.

Language setting is returned as 2-char ISO code (though could be
more flexible in the future if needed).

HTML language is configured (attr), and a secondary per-language
scripts.html file is included.

As a hack Makefile generates the scripts_*.html files; typescript build
system will need to populate those appropriately as part of 'make
build-web' to finish integration.
This commit is contained in:
bryan newbold
2023-11-22 14:33:25 -08:00
parent 08333002cc
commit 034e6bdf66
5 changed files with 53 additions and 3 deletions
+1 -1
View File
@@ -42,4 +42,4 @@ check: ## Compile everything, checking syntax (does not output binaries)
.PHONY: run-dev-bskyweb
run-dev-bskyweb: .env ## Runs 'bskyweb' for local dev
GOLOG_LOG_LEVEL=info go run ./cmd/bskyweb serve --debug
GOLOG_LOG_LEVEL=info go run ./cmd/bskyweb serve