Translation of HTML Field Content

Hello,

I am trying to implement translation of HTML fields. Contents are fixed and entered in the Options of the relevant field.

Content Type 1:

<div style="background-color: WhiteSmoke; width: 100%; border: 1px solid black; padding: 10px; margin: 10px;">
&#9679; Examination aspects stipulated in the Green Book: 
<br>&#10146; Para 1.1.6 Making the project results sustainable: 
<br>(a) Furnish specific information on issues relating to the manpower for running the on-going project, for maintenance of the created establishment/ infrastructure of the completed project and all necessary information for its institutionalization and sustainability
<br>(b) Plan for use of the equipment, furniture and vehicles procured under the project after project completion should be attached with the DPP
</div>

Content Type 2:

<table style="width: 100%; border: 1px solid black; padding: 10px;">
<tbody>
<tr>
<td id="transfer_revenue" style="padding: 10px;">
After completion, whether the project needs to be transferred to the revenue budget 
</td>
<td style="padding: 10px;">
</td>
<td style="padding: 10px;">
</td>
</tr>
<tr>
<td id="risk_analysis_mitigation" style="padding: 10px;">
Risk analysis and mitigation measures
</td>
<td id="sust_benefit" style="padding: 10px;">
Sustainability of the project benefit
</td>
<td style="padding: 10px;">
</td>
</tr>
<tr>
<td id="om_attach" style="padding: 10px;">
[Attachment] Operation and Maintenance Plan
</td>
<td style="padding: 10px;">
</td>
<td style="padding: 10px;">
</td>
</tr>
</tbody></table>

In English, there are working fine, but not getting translated, though I have entered required translation in the CSV file. I have also entered translation in the Translation table. But, not working. It may be noted, if there is no HTML, it works fine.

Expecting suggestions from the experts.

Regards
Mijan

@mijan1373 where exactly does this html exists ?

In the Options of DocType field. Below is the screenshot:

@mijan1373 I believe that this can be done using Jinja Api inside html.
Ex: <p>{{ _('Your String') }}</p>.

1 Like

I have managed to solve this. The solution I have followed is as follows:

1. bench get-untranslated bn untranslated.csv
2. created transalted.csv
3. bench  update-translations bn untranslated.csv transalted.csv
4. bench clear-cache
5. bench clear-website-cache
6. bench restart

NOTE: The HTML in the untranslated.csv was copied exactly in the translated.csv. Then only the text parts were translated, no change made in the HTML tags or syntax.