summaryrefslogtreecommitdiff
path: root/docs/narr/i18n.rst
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2016-04-12 14:12:13 -0700
committerSteve Piercy <web@stevepiercy.com>2016-04-12 14:12:13 -0700
commitc843d60e56d1747dc04e022ea4b16dd53b78221c (patch)
treea43a715010abc0acd4c0ab500cdd167b0527af5c /docs/narr/i18n.rst
parent0e5ced54f494f0e004b7a5925f25198bd9bddd85 (diff)
downloadpyramid-c843d60e56d1747dc04e022ea4b16dd53b78221c.tar.gz
pyramid-c843d60e56d1747dc04e022ea4b16dd53b78221c.tar.bz2
pyramid-c843d60e56d1747dc04e022ea4b16dd53b78221c.zip
- zap easy_install straggler
Diffstat (limited to 'docs/narr/i18n.rst')
-rw-r--r--docs/narr/i18n.rst33
1 files changed, 17 insertions, 16 deletions
diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst
index 93e355ffe..a3f730f0c 100644
--- a/docs/narr/i18n.rst
+++ b/docs/narr/i18n.rst
@@ -265,18 +265,18 @@ available you can install it through the packaging system from your OS; the
package name is almost always ``gettext``. For example on a Debian or Ubuntu
system run this command:
-.. code-block:: text
+.. code-block:: bash
$ sudo apt-get install gettext
Installing Lingua is done with the Python packaging tools. If the
:term:`virtual environment` into which you've installed your :app:`Pyramid`
-application lives in ``/my/venv``, you can install Lingua like so:
+application lives at the environment variable ``$VENV``, you can install Lingua
+like so:
-.. code-block:: text
+.. code-block:: bash
- $ cd /my/venv
- $ $VENV/bin/easy_install lingua
+ $ $VENV/bin/pip install lingua
Installation on Windows
+++++++++++++++++++++++
@@ -289,11 +289,12 @@ compile it yourself. Make sure the installation path is added to your
Installing Lingua is done with the Python packaging tools. If the
:term:`virtual environment` into which you've installed your :app:`Pyramid`
-application lives in ``C:\my\venv``, you can install Lingua like so:
+application lives at the environment variable ``%VENV%``, you can install
+Lingua like so:
-.. code-block:: text
+.. code-block:: ps1con
- C> %VENV%\Scripts\easy_install lingua
+ C> %VENV%\Scripts\pip install lingua
.. index::
@@ -308,9 +309,9 @@ Once Lingua is installed, you may extract a message catalog template from the
code and :term:`Chameleon` templates which reside in your :app:`Pyramid`
application. You run a ``pot-create`` command to extract the messages:
-.. code-block:: text
+.. code-block:: bash
- $ cd /place/where/myapplication/setup.py/lives
+ $ cd /file/path/to/myapplication_setup.py
$ mkdir -p myapplication/locale
$ $VENV/bin/pot-create -o myapplication/locale/myapplication.pot src
@@ -331,9 +332,9 @@ represents translations of a particular set of messages to a particular locale.
Initialize a ``.po`` file for a specific locale from a pre-generated ``.pot``
template by using the ``msginit`` command from Gettext:
-.. code-block:: text
+.. code-block:: bash
- $ cd /place/where/myapplication/setup.py/lives
+ $ cd /file/path/to/myapplication_setup.py
$ cd myapplication/locale
$ mkdir -p es/LC_MESSAGES
$ msginit -l es -o es/LC_MESSAGES/myapplication.po
@@ -362,9 +363,9 @@ translated or re-translated.
First, regenerate the ``.pot`` file as per :ref:`extracting_messages`. Then use
the ``msgmerge`` command from Gettext.
-.. code-block:: text
+.. code-block:: bash
- $ cd /place/where/myapplication/setup.py/lives
+ $ cd /file/path/to/myapplication_setup.py
$ cd myapplication/locale
$ msgmerge --update es/LC_MESSAGES/myapplication.po myapplication.pot
@@ -380,9 +381,9 @@ Finally, to prepare an application for performing actual runtime translations,
compile ``.po`` files to ``.mo`` files using the ``msgfmt`` command from
Gettext:
-.. code-block:: text
+.. code-block:: bash
- $ cd /place/where/myapplication/setup.py/lives
+ $ cd /file/path/to/myapplication_setup.py
$ msgfmt -o myapplication/locale/es/LC_MESSAGES/myapplication.mo \
myapplication/locale/es/LC_MESSAGES/myapplication.po