This is a helper for internationalization and localization in Pyramid <https://trypyramid.com/>
_
This package add 3 view to your pyramid based application:
in /translate
you see available domains and also you can create new domain.
in /translate/{domain}
you can edit pot file for selected domain.
in /translate/{domain}/{lang}
you can translate msgid to selected lang in selected domain. also you can update po file from pot file.
This package add Babel <http://babel.pocoo.org/en/latest/>
_ locale object to request.
This package use Pyramid_flash_message <https://pypi.python.org/pypi/pyramid-flash-message>
_ to handle flash messages.
you can also use auto collect msgids. for this set i18n_helper.collect_msgid = true
in your project config file.
by enabling auto collect. new msgids for any domain add to its own pot file. even if pot file for specific is not available it will create automatically
you can specify translation directory in config file via i18n_helper.locale_dir
.. code-block:: bash
pip install pyramid_i18n_helper
add then add this package to your application
.. code-block:: ini
pyramid.includes =
pyramid_layout
pyramid_jinja2
pyramid_i18n_helper
or
.. code-block:: python
config.include('pyramid_layout')
config.include('pyramid_jinja2')
config.include('pyramid_i18n_helper')
now user with i18n_helper
permission can access this pages.
You can use project issue page <https://github.com/sahama/pyramid_i18n_helper/issues/>
_ to submit your issue
pyramid_layout documentation page <http://docs.pylonsproject.org/projects/pyramid_layout/en/latest/layouts.html>
_ main_template is the template object that provides the main template (aka, o-wrap) for the view
.
if your application don't have main_layout some default main_template will be used but it is so simple and you may have problem.
at now templates will be load in block named content.i18n_helper.locale_dir
i18n_helper.collect_msgid
setting as true