X-Payments:Translating the User Interface / Editing Text Labels
Text elements that appear in the X-Payments user interface are specified with the help of text labels. This enables you to easily customize the text of the X-Payments user interface, including both the X-Payments Admin back end and the front end where your customers enter their payment details.
You can take the following approaches when customizing the user interface text in X-Payments:
- Translate the entire user interface of X-Payments - or just the part visible to customers - into another language (or more than one languages);
- Override the text of individual labels.
In both cases, you need to prepare a custom text labels set in the form of a CSV file and save it as <xpayments>/lib/XPay/Templates/labels.csv (/XPay_templates/labels.csv for users of X-Payments Hosted plans).
A CSV file is a text file where each line represents a separate data record. Each data record consists of fields separated by a designated delimiter (a semicolon in our case).
Being a text file, a file in the CSV format can be created and edited with any decent text editor. Alternatively, you may be able to create the translation using your favorite spreadsheet software application, then convert it to UTF-8 encoded .csv.
Here's an example of a line for the labels.csv file:
Credit card type;CCT;ru
In this line from the example above:
- Credit card type is a text label in English;
- CCT is this text label in the required language;
- ru is a two-letter code of the required language.
If you have single quotes in your translation use "\" sign before a single quote sign. E.g. for French phrase "Trois derniers chiffres à l'endos de votre carte" correct line will be:
Last three numbers on the back side of your card;Trois derniers chiffres à l\'endos de votre carte;fr
Without the labels.csv file, all the text labels in X-Payments will be displayed in the default language, which is English. With the addition of a custom text labels set saved as <xpayments>/lib/XPay/Templates/labels.csv (/XPay_templates/labels.csv for users of X-Payments Hosted plans), label texts will be pulled from this file. If the custom text labels set contains labels for more than one languages, the language will be selected based on the user's language preferences.