Mercurial > babel > mirror
diff doc/catalogs.txt @ 40:0739bc8e7210 trunk
Syntax highlighting for the docs.
author | cmlenz |
---|---|
date | Wed, 06 Jun 2007 11:02:48 +0000 |
parents | 20896f1e91c6 |
children | 22b90b3b161a |
line wrap: on
line diff
--- a/doc/catalogs.txt +++ b/doc/catalogs.txt @@ -15,11 +15,15 @@ The ``gettext`` translation system enables you to mark any strings used in your application as subject to localization, by wrapping them in functions such as ``gettext(str)`` and ``ngettext(singular, plural, num)``. For brevity, the -``gettext`` function is often aliased to ``_(str)``, so you can write:: +``gettext`` function is often aliased to ``_(str)``, so you can write: + +.. code-block:: python print _("Hello") -instead of just:: +instead of just: + +.. code-block:: python print "Hello" @@ -102,5 +106,7 @@ class adds a ``merge()`` method that takes another ``Translations`` instance, and merges its contents into the catalog:: +.. code-block:: python + translations = Translations.load('main') translations.merge(Translations.load('plugin1'))