Skip to content

Latest commit

 

History

History

advanced_translation

Advanced Translation

Production/Stable License: AGPL-3 CompassionCH/compassion-modules

Use this module to add application terms that can be translated in context for male / female and singular / plural.

Table of contents

Requires the Babel package to translate dates into different locales.

You can go in the Technical Settings/Translations/Advanced Translations

  • Enter all terms you want to use
  • Use method get of ir.advanced.translation in order to fetch translations
  • Make models inherit the class 'translatable.model' so that they can now use these methods:
    • translate(field_name): Will retrieve the translation of a char/selection field and replaces keywords by advanced translations. Keywords should be placed in brackets.
    • get_list: Return comma separated field values (see doc in translatable_model.py)
    • get_date(field_name, date_format='date_full'): Returns a date field directly formatted in the format wanted. date_format can be an advanced translation which will return the date format wanted (can change depending on the language), or it can directly be a date format used by Babel package : http://babel.pocoo.org/en/latest/dates.html

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

  • Compassion CH

This module is part of the CompassionCH/compassion-modules project on GitHub.

You are welcome to contribute.