django-i18n-helper

A internationalization helper that highlights translated strings
Download

django-i18n-helper Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Santiago Gabriel Romero
  • Publisher web site:
  • https://github.com/machinalis/

django-i18n-helper Tags


django-i18n-helper Description

django-i18n-helper is a Django app that provides a simple way to visualize translated strings in Django templates by wrapping translated content with custom HTML and CSS. Therefore and most important, helps you to visualize untraslated strings too.This is particularly useful when internationalization is being added to a project.How does it worksDjango i18n helper is a common Django app that overriddes Django core functions on load to provide the desired behavior.The application will automatically detect when tests are being run and don't override any methods in such a case to preserve tests integrity.InstallationGet it pip install django-i18n-helperAfter, all you need to do is add "i18n_helper" to your installed apps and activate the internationalization debug. In your settings.py, make sure to have: INSTALLED_APPS = ( ..., 'i18n_helper' )and I18N_HELPER_DEBUG = Truedjango-i18n-helper provides a default behavior that consists in wrapping the translated content with an HTML div with the following properties: < div class='i18n-helper' style='display: inline; background-color: #FAF9A7;' >Translated text< /div >This provides a soft highlight for translated strings, but this behavior can be modified within settings.py.CustomizationSome configuration variables are provided on order to customize how you want the translated strings to be wrapped.I18N_HELPER_HTMLDefines a whole HTML block for wrapping the translations. This string will be formatted (http://docs.python.org/library/stdtypes.html#str.format) with the translated text. Thus every occurrence of "{0}" will be replaced with the translation. I18N_HELPER_HTML = "< span class='highlight' >{0}< /span >"If I18N_HELPER_HTMLis not set, the code used will be < div class='i18n-helper' style='display: inline; background-color: #FAF9A7;' >{0}< /div >I18N_HELPER_CLASSDefines the class to use for the HTML div if I18N_HELPER_HTML is not used. Defaults to "i18n-helper". I18N_HELPER_CLASS = "my-custom-class"I18N_HELPER_STYLEDefines the inline CSS for the HTML div if no I18N_HELPER_HTML or I18N_HELPER_CLASS have been set (case in which it's assumed that the styles for the class provides the needed css). Defaults to ""display: inline; background-color: #FAF9A7;". I18N_HELPER_CLASS = "font-weight: bold; background-color: yellow;"Product's homepage


django-i18n-helper Related Software