Quotation Docs

Translate your Request For Quote – Quotation extension

Request For Quote – Quotation plugin for Woocommerce is multilingual ready. It contains the correct files to translate it using poedit.

There are two different places where WordPress can have your plugin translations:

  • The WordPress language directory:
    /wp-content/languages/plugins/
  • The plugin language directory:
    /woocommerce-quotation/languages/

Note that the default WordPress languages directory is “wp-content/languages/” but it can be overridden in wp-config.php by defining WP_LANG_DIR yourself.

I would like to point out that Quotation plugin loads custom user language files from WP_LANG_DIR before load the language files that ship with the plugin. When multiple mo-files are loaded for the same domain, the first found translation will be used. This way the language files provided by the plugin will serve as a fallback for strings not translated by the user.

Custom translations would only need to be dropped in the subdirectory by the name of your plugin, in the WordPress languages directory wp-content/languages/plugins/. No need for the user to attach to any hooks in the code, and no problems during a plugin update.

To keep your custom translations and not overwrite them on each Quotation plugin update you must save your translation files in the WordPress language directory under plugins directory.

The WordPress standard directory structure will look like this.
wp-content
– languages
– – plugins
– – – woocommerce-quotation-de_DE.po
– – – woocommerce-quotation-de_DE.mo
– – themes
– – – theme-name-de_DE.po
– – – theme-name-de_DE.mo

Portable Object Template (POT)

The master plugin translation file is a .POT file. Basically, the .POT file is a list of all the text lines used in the plugin files in English language. This contains all the text available for translation.

You can use it as a starting point to create new translations. WordPress doesn’t use it.

Portable Object (PO) and Machine Object (MO)

The .PO file includes the original texts and the translations in two columns. It´s a translation that someone else started (the author, a professional translator, a WordPress plugin user, etc), and maybe completed. WordPress doesn’t use it.

The .MO file includes the exact same contents as PO file. The two files differ in their format. While a PO file is easy for humans to read, MO files are compiled and are easy for computers to read. WordPress gets translations from .MO files.

The .MO file is automatically created by Poedit whenever you save a PO file. All you can do with these files is to upload or re-upload them whenever you create or update a .PO file.

How to translate Woocommerce Quotation plugin using Poedit

Poedit is a software (available for Windows, Mac and Linux) which you can use to translate the theme or plugin. It’s available for free on poedit.net. Free version comes with a builtin translation memory that remembers your past translations and uses them to make suggestions for similar texts.

Download Poedit

Here are the steps:

1. Open Poedit and select File > New Catalog from POT / PO file

2. Select the .PO file from woocommerce-quotation plugin. You can find the files in the wp-content/plugins/woocommerce-quotation/language/ folder).

3. A box will pop up asking for language of the translation.

4. Hit OK.

5. Save your file in your computer.
Spanish (Spain): woocommerce-quotation-es_ES.po

6. Now you can start translating your Quotation plugin. The space at the top will display all the text ready to translate, and any completed translations will display to the right. The boxes underneath show the source text, your translation and any notes for translators. Translating is really easy – just select a word or phrase, enter your translation and click “Validate”.

IMPORTANT:

  • You have to respect all special characters from the original text when translating.
  • It´s not necessary translate all text strings. Perhaps you don´t want to spend your time translating text strings of the admin theme.

7. When you’ve finished, save your files in your wp language directory, so you don´t overwrite the translation files on each plugin update.
Eg:

  • wp-content/languages/plugins/woocommerce-quotation-de_DE.po
  • wp-content/languages/plugins/woocommerce-quotation-de_DE.mo