How to translate strings in javascript file odoo 17

CelineGeorge1 560 views 15 slides Aug 16, 2024
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

In this slide we’ll discuss on how to translate strings in javascripts file in odoo 17. This helps in offering the user interface in multi languages which is essential for improving user experience.


Slide Content

How to translate strings in javascript file odoo 17 Enterprise

Introduction Enterpr ise In this sl ide we’ll discuss on how to translate strings in javascripts file in odoo 17. This helps in offering the user interface in multi languages which is essential for improving user experience.

Enterprise From settings, enable the language which we required for translation.

Enterprise After activating the language, go to settings->Translations and click on export translation to export the translation file.

Enterprise Choose the language for translation and the file format required. In the Apps to Export, we can choose the modules or apps which we require translation for the js files. Then we can click on Export button for exporting the file.

Enterprise After completing the export we can download the translation file.

Enterprise In our custom module, create a translation directory and add the downloaded file to this directory.

Enterprise The translations for the strings added inside _t(“ ”)can be included in the translation file.

Enterprise This is the translation file which we downloaded.

Enterprise In the msgstr we can add the translations for the corresponding msgid. Using this block we can add string and its translation in js file.

Enterprise After adding translations for the strings, change the language from english by clicking on My Profile.

Enterprise Choose the language and save the changes.

Enterprise After upgrading the module, open the session in POS and we can see the button name is translated. The translations that we added in the po file will appear here.

Enterprise In the custom popup, all the strings are now translated.

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com