This example application demonstrates the approach to
localization web-based Go applications, with the following
properties:
Display language is determined from the browser
Display language can be overridden by a cooke and/or query parameter
Localization is stored in native Go files ([string] string maps)
and is compiled with the application
You can provide developer comments for each
translatable entity
Localization files are generated by
Serge; generated .po files
are used to provide translation (you can do a continuous
localization of your project)
Formatting (named placeholders, support for plurals/conditionals)
is provided by Plurr library
Support for inserting localized strings and string formatting in
html/template-based templates
Automatic generation of pseudotranslated resources for quick testing
See .serge subfolder for an additional README on the localization workflow.
Running
Use ./build.sh script to build the binary, then run ./server and go to http://localhost:8080/ to see the page in your preferred language.
To change the display language, use the links in the footer of the demo page.
When language is not set explicitly, it is detected from your browser settings.