From 0d568c58f526645583b02a89824cacfaa57c9271 Mon Sep 17 00:00:00 2001 From: José Carlos Nieto Date: Tue, 19 Feb 2013 15:16:09 -0500 Subject: Updating code (fixing leaks) and docs. --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 97b3581..e6f52ba 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ ## gosexy/gettext -``gosexy/gettext`` is a wrapper of [GNU gettext][1], an internationalization and localization library for writing multilingual systems. +Go bindings for [GNU gettext][1], an internationalization and localization +library for writing multilingual systems. ## Requeriments -The GNU C library. If you're using GNU/Linux, FreeBSD or OSX you should already have it. +The GNU C library. If you're using GNU/Linux, FreeBSD or OSX you should already +have it. ## Installation -Just pull from the repository: +Use `go get` to download and install the binding: ```sh % go get github.com/gosexy/gettext @@ -37,30 +39,33 @@ func main() { } ``` -You can use ``os.Setenv`` to set the ``LANGUAGE`` environment variable or set it from a terminal: +You can use `os.Setenv` to set the `LANGUAGE` environment variable or set it +on a terminal: ```sh % export LANGUAGE="es_MX.utf8" % ./gettext-program ``` -Note that ``xgettext`` does not officially support Go syntax yet, however, you can generate a valid ``.pot`` file by forcing -``xgettest`` to use the C++ syntax: +Note that `xgettext` does not officially support Go syntax yet, however, you +can generate a valid `.pot` file by forcing `xgettest` to use the C++ +syntax: ```sh % xgettext -d example -s gettext_test.go -o example.pot -L c++ -i --keyword=NGettext:1,2 --keyword=Gettext ``` -This will generate a ``example.pot`` file. +This will generate a `example.pot` file. -After translating the .pot file, you must generate .po and .mo files and remember to set the UTF-8 charset. +After translating the `.pot` file, you must generate `.po` and `.mo` files and +remember to set the UTF-8 charset. ```sh % msginit -l es_MX -o example.po -i example.pot % msgfmt -c -v -o example.mo example.po ``` -Finally, move the .mo file to an appropriate location. +Finally, move the `.mo` file to an appropriate location. ```sh % mv example.mo examples/es_MX.utf8/LC_MESSAGES/example.mo @@ -68,13 +73,13 @@ Finally, move the .mo file to an appropriate location. ## Documentation -You can read ``gosexy/gettext`` documentation from a terminal +You can read `gosexy/gettext` documentation from a terminal ```go % go doc github.com/gosexy/gettext ``` -Or you can [browse it](http://go.pkgdoc.org/github.com/gosexy/gettext) online. +Or you can [browse it](http://godoc.org/github.com/gosexy/gettext) online. The original gettext documentation could be very useful as well: -- cgit v1.2.3