Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Use gettext tools to ease translations


The PO file format is part of the gettext internationalization and localization system commonly used in Unix-like systems. This system includes tools to ease the translation work.

This recipe demonstrates how to use these tools to help translate our addon modules. We want to use it on a custom module, so my_module created in Chapter 3, Creating Odoo Modules is a good candidate. But feel free to replace it with some other custom module you have at hand, replacing the recipe's my_module references as appropriate.

How to do it...

To manage the translation from the command line, assuming that your Odoo installation is at ~/odoo-work/odoo, follow these steps:

  1. Create a compendium of translation terms for the target language, for example, Spanish. If we name our compendium file odoo_es.po we should write the following code:

    $ cd ~/odoo-work/odoo  # Use the path to your Odoo installation
    $ find ./ -name es_ES.po | xargs msgcat --use-first | msgattrib \--translated...