Here you will find a number of helpful examples of how you can use spreak.
Follow these setup to run the helloworld
example:
- Get the code
$ git clone https://github.com/vorlif/spreak
- Run the code
cd spreak/examples/helloworld
go run main.go
Unless otherwise required for the demonstration, all .pot
files and the associated translations are
stored in the folder locale
.
-
- Simple example to demonstrate how spreak can be used
- xspreak command
xspreak -e -D helloworld/ -p locale/ -d helloworld
-
- Advanced example to demonstrate how spreak can be used with xspreak
- xspreak command
xspreak -e -D dayinfo/ -p locale/ -d dayinfo
-
httptempl: Example of how to use spreak with a web server and
http/templates
-
jhttptempl: Example of how to use spreak with a web server, json and
http/templates
-
embed: Example how spreak can be used with the embed api
-
errors: Example how errors can be translated with spreak and xspreak
-
loaders: Example how to load PO files from other sources
-
resolver: Example how to resolve the path to a file with translations.
-
printer: Example how to use your own printer
-
decoder: Example of implementation of a decoder and a catalog for importing JSON files for translation.