콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
15477 화면

I have define translation terms and its loaded properly in qweb template. I checked from setting->report->qweb views and translation but when I print report it's not print translation values .

<template id="report_test_translation">
<t t-call="report.html_container">
<t t-call="my_module.report_my_test_report" t-lang="it_IT"/>
</t>

</template> 

 
아바타
취소
베스트 답변
Simply do this for everything you want to translate, for every language, and then update your module.

Hi Ajeet,

So if I understand correctly you want to make translations and change the report language as which language is set?
Every default report has two QWeb views. One with the actual report (named report_xxxx_document) and one record with the translation logic (report_xxxx)
In this second record, the report_xxx is where the languages will be fetched:

<?xml version="1.0"?>
   <t t-name="account.report_invoice">
       <t t-call="report.html_container">
          <t t-foreach="doc_ids" t-as="doc_id">
          <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"/> </t>         </t>
</t>

As you can see this second record checks the language from the user with partner_id.lang and then loads the correct translation.
So, how do you get the correct languages?
You'll need to create a new folder named i18n and place a .po file in this for every language you want to translate.
The file should have the ISO language codes. For example for the Dutch language this would be nl.po.
In this file you should add the modulename, location of the value you want to translate, the source and the translation. For example:


#. module: sale
#: view:sale.order.line:sale.view_order_line_tree
msgid "Qty"
msgstr "Hvhd"


Note: You can see examples in any module under the folder i18n. You have to do the same for your module but with other values and module names.

Best of luck

아바타
취소
작성자

@Manish.. Thanks for your reply. I see sample in odoo 10 like below-

<template id="report_saleorder">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="doc">

<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>

</t>

</t>

</template>

I already define .po file and it's load translation in qweb view. I check from report menu. But when I print report its not reflecting report in tranlated term

관련 게시물 답글 화면 활동
4
11월 20
6885
3
8월 19
9405
1
1월 24
5283
4
7월 24
7151