There are several methods to make a Go web app "multilingual". I chose to store the translations in .po files. One language per file.
The Go html template looks like this:
<p>{{trans "Company"}}</p>
This means that the html template calls a func trans()
and translates "Company" into the set language.
The html template is translated by Go web server before the page is rendered without noticeable delay.
Top comments (0)