15 - Translations - WPC
15.1 - Frontend Translation
You can translate product fields, labels, drop-down items and fields.
To translate a language just create or edit a file (e.g: "en_US.php", "fr_FR.php", "it_IT.php") in: “/wp-content/uploads/woo-price-calculator/translations”
You'll find an existing example like below:
<?php return array( 'label1' => 'label1_EN', 'label2' => 'label2_EN', 'item1' => 'item1_EN', 'item2' => 'item2_EN', );
For example "en_US.php":
<?php return array( 'height' => 'Height', 'width' => 'Width', );
For example "it_IT.php":
<?php return array( 'height' => 'Altezza', 'width' => 'Larghezza', );
You can also translate text on the website front-end, for example the Edit Cart Button, the text regarding a Not set field, see the table below:
Translate Key | Default Value (en_US) | Description | Keywords |
---|---|---|---|
element.not_set | Not set | The text displayed when a field is empty in Cart, Checkout and Order Details | None |
wpc.cart.edit | Edit | Text of the edit button in the cart | None |
wpc.cart.price | Price | Price label displayed on the edit modal in the cart | None |
wpc.cart.cancel | Cancel | Label of the "Cancel" button on the edit modal in the cart | None |
wpc.cart.modal.title | Edit of %product_title% | Label displayed on top of the edit modal in the cart | %product_title% = The name of the product |
ecommerce.shop.choose_an_option | Choose an option | Shop button label used to redirect the user to the product page | None |
15.2 - Backend Translation
To translate the WPC backend you can copy the file located at “/wp-content/plugins/woo-price-calculator/admin/awspricecalculator/Language/en_US.php” and create a new language file in the same folder (ex: "fr_FR.php", "it_IT.php", "de_DE.php").
You need to open the PHP file and edit the labels. The backend file format is the same as the frontend file format.
Important Note: For the backend translations, if you upgrade your WPC version you will lose the edits so please make a backup copy or you can send us your translation file to "hello@altoswebsolutions.com" so we can add it for next updates.