one aspect I can see which will improve, you can use go:embed for your public static assets/templates with embed.FS so that your final binary can be standalone with locale/ files
you also won’t need a mutex if you are only reading from the map only, I wouldn’t do in-memory unsafe map and read/write in http handlers because it would grow eventually, probably what you need is something like a thread-safe LRU(least recently used cache if you continue(you will need eviction at some point of the map or the cache) with this library and approach GitHub - hashicorp/golang-lru: Golang LRU cache)
The init{} function creates a map variable in the memory amongst other things. So I do not really know how to replace this. I was confused about which solution to use from the beginning. There are several ways to go. golang/x seemed to be harder and go-i18n uses .toml which looks close to .po, but as the .po can be compiled into .mo files it may be faster? What are the benefits of go-i18n compared to leonelquinteros/gotext?
I will probably use the go:embed for the locale translation folder. But for the html stuff I am still hesitant. Mostly because it can contain tons of files in the future and the ability to minor edits of errors on-the-fly on the server will no longer be possible.
Do you say that locking/unlocking is not needed using maps?
So var translations map[string]*gotext.Po is an in-memory unsafe map?