This is a helper for internationalization and localization in Pyramid
This package add 3 view to your pyramid based application:
- i18n_helper.domain view in route /translate
- i18n_helper.pot view in route /translate/{domain}
- i18n_helper.po view in route /translate/{domain}/{lang}
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 locale object to request. This package use 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
pip install pyramid_i18n_helper
add then add this package to your application
pyramid.includes =
pyramid_layout
pyramid_jinja2
pyramid_i18n_helper
or
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 to submit your issue
- After translating a msgid you have to restart your application
- At now this package use pyramid_layout default layout. form pyramid_layout documentation page 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.
- main_layout template have to designed via jinja2.
- excuse me for my bad english knowledge.
- get locale_dir from config file via i18n_helper.locale_dir
- remove dependency to master_layout. master_layout is optional.
- encoding bug fix.
- bug fix.
- documentation.
- remove unnecessary dependency.
- many change. so new version released.
- documentation
- complete domain view
- handle duplication error
- create new domain if not exist
- compatible with pyramid_flash_message 0.2
- add flash message.
- set permission to 'i18n_helper'. so user want to access pages have to have this permission.
- modify create lang and select lang
- error in creating new lang if lang not valid in babel
- add ability to collect msgids in pot file via i18n_helper.collect_msgid setting as true
- some debug
- add babel locale object to request
- some bug fix
- some bug fix
- add (newlang / go to lang) field
- some bug fix
- some modification
- apply suggestion from #1. thank @mmerickel
- init project and create skeleton of it