Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

What is best practice when translateting a new website module?

By
Anders Wallenquist
on 10/21/14, 4:49 AM 771 views

I have built a new module using a class of the type http.Controller

 

class website_order(http.Controller):

    @http.route(['/order/list',], type='http', auth="public", website=True)
    def order_list(self, **post):
        cr, uid, context, pool = request.cr, request.uid, request.context, request.registry

        res_user = request.registry.get('sale.order').browse(cr,uid,uid)

        values = {
            'order_menu': 'active',
            'res_user': res_user,
            'sale_orders': request.registry.get('sale.order').browse(cr,uid,request.registry.get('sale.order').search(cr,uid,[('company_id','=',res_user.company_id.id)])),
        }
        return request.website.render("smart_order.list", values)

I have created a i18n-catalogue, a pot and po-file for my translation. The labels and texts that I want to translate are exported to the pot-file and my translation in the po-file are in the database as it supposed to be.

My user have the language int the request.context, but request.website.render does not perform any translation for me. What am I missing?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/21/14, 4:49 AM
Seen: 771 times
Last updated: 3/16/15, 8:10 AM