Skip to Content
Menu
This question has been flagged
1 Reply
3280 Views

Hello all,

In the file /static/src/js/website.translator.js, we have the code :

if (!openerp.website.translatable) {

    // Temporary hack until the editor bar is moved to the web client

    alert('44444444');

    return;

}

For one of my website, openerp.website.translatable is FALSE. Where is taken this value? How to change it to TRUE?

Thanks


UPDATE #1

Ok, I now know that this value is taken here :

    <template id="website_lapagept.website_layout_pt" name="Main layout - PT">&lt;!DOCTYPE html&gt;

        <html t-att-lang="lang and lang.replace('_', '-')"

            t-att-data-website-id="website.id if editable and website else None"

            t-att-data-editable="'1' if editable else None"

            t-att-data-translatable="'1' if translatable else None"

            [....]


But now, where does this new « translatable » take his value????

Avatar
Discard
Author Best Answer

In the file : odoo-8.0-20150920/openerp/addons/website/models/ir_ui_view.py

This is where the real value of translatable is given.

@api.cr_uid_ids_context

def render(self, cr, uid, id_or_xml_id, values=None, engine='ir.qweb', context=None):

if request and getattr(request, 'website_enabled', False):

engine='website.qweb'

if isinstance(id_or_xml_id, list):

id_or_xml_id = id_or_xml_id[0]

if not context:

context = {}

company = self.pool['res.company'].browse(cr, SUPERUSER_ID, request.website.company_id.id, context=context)

qcontext = dict(

context.copy(),

website=request.website,

url_for=website.url_for,

slug=website.slug,

res_company=company,

user_id=self.pool.get("res.users").browse(cr, uid, uid),

translatable=context.get('lang') != request.website.default_lang_code,

editable=request.website.is_publisher(),

menu_data=self.pool['ir.ui.menu'].load_menus_root(cr, uid, context=context) if request.website.is_user() else None,

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 17
8857
2
Jun 17
20951
1
Dec 24
118
2
Nov 24
83
1
Oct 24
257