How To Create Po File
POT Files
Odoo 12 have advanced translation tools. POT files are the template files for PO files. The full form of POT is Portable Object Template. They will have all the translation strings left empty. A POT file is essentially an empty PO file without the translations, with just the original strings. You should edit it with a PO editor such as POEdit, or your preferred text editor.
This is how a .pot file looks like :
Let us see how a .pot file is generated :
First you need is to activate developer mode ,
Go to
settings -> translation -> export translation
Here do not specify any language and set the file format to PO files and also select apps to export, then click the export button.
Then a POT file for the specified app will be generated.
If we did not specify any apps, then a pot file for all the base modules will be generated.
PO Files
PO files are the files which contain the actual translations. The full form of PO is Portable Object .Each language will have its own PO file, for example, for French there would be a fr.po file, for German there would be a de.po, for American English there might be en-US.po. You can even use po files to customize the displayed text without changing the code, by for example, creating an adapted file such as en-my_company.po.
The core of each PO file is very simple. It is form of simply pairs of the source text. That is, which is present in the code. And target text, the text which is to be in the translation. For example, in the French PO file you might have a translation of a string as follows:
msgid "Hello world"
msgstr "Bonjour le monde"
The msgid contains the text actually in the code. Whereas, the msgstr contains the text into which it is to be translate. If there is no translation given in the msgstr, then the default msgid string will be display.
Odoo 12 Translation
PO files are simply text files and can thus be edit by any text editor.
Go to
settings -> translation -> export translation
Then select the language for which you want to create PO file and select the file format as .PO, select the applications you want to translate then click the export button.
Then we will get a screen like this,
This page contains the link to download the generated PO file. Download the PO file. Copy the downloaded file and paste it inside the module in 'i18n' folder.
This is how a PO file looks like:
How To Create Po File
Source: https://www.technaureus.com/po-templates-in-odoo-12/
Posted by: hughesthind1949.blogspot.com
0 Response to "How To Create Po File"
Post a Comment