Changing text messages

From ISPWiki

Jump to: navigation, search

We need to change a text message into a custom one, for example, to provide information about your company.

Task

  • We need to change the existing text on the phone verification form (the Fraud protection module in BILLmanager) that a customer needs to use if automatic phone verification fails.
  • The phone number in our example is +7 495 111 11 11

Solution

1) Create a description file /usr/local/ispmgr/etc/billmgr_mod_myfraud.xml for the plug-in with the following contents

 
 <?xml version="1.0" encoding="UTF-8"?>
 <mgrdata>
  <lang name="ru">
    <messages name="validate.phone.check">
       <msg name="vinfo1">При возникновении трудностей с автоматической активацией вам следует позвонить по телефону +7 495 111 11 11</msg>
    </messages>
  </lang>
  <lang name="en">
    <messages name="validate.phone.check">
       <msg name="vinfo1">If you have any problems with automatic activation, please call us +7 495 111 11 11</msg>
    </messages>
  </lang>
 </mgrdata>


2) Restart BILLmanager

Comments

In this example we changed the interface XML-description into custom and changed the message with the internal name vinfo1 in the validate.phone.check module for the default (en) and Russian (ru) languages.

You can get these internal names using the following methods:


The first method (the simplest):


You may view an original text message in the interface. In our form the text reads "If you have any problems with your phone number verification, please contact our Support center." Open the file /usr/local/ispmgr/etc/billmgr_msg_en.xml in your favourite text editor to search an original message. Something like this will be displayed (inessential data are changed into dots):

   <messages name="validate.phone.check">
     ...
     <msg name="vinfo1">If you have any problems with your phone number verification, please contact our Support center. </msg>
     ...
   </messages>

The internal name of the phone verification module is "validate.phone.check" (value of the name attribute of the message tag), the internal name of the message is "vinfo1" (the value of the name attribute of the msg tag).

This method has one drawback. If a massage is short, such as "Name", it can be used multiple times. In this case you'd better use the second method:


Open a required form in your browser to view the control panel's logs (in our example it is /usr/local/ispmgr/var/billmgr.log) to find the function that processed this form. You will see something like this:

May 16 23:46:35 [71288] INFO Request [192.168.1.1][myusername] 'func=validate.phone.check&country=55&nextfunc=vds%2Eorder%2E1&noback=on&phone=1111111111&price=414'

Consider the func parameter. validate.phone.check is the internal name of the phone verification module. Open the file /usr/local/ispmgr/etc/billmgr_msg_en.xml to find description of its text messages that starts with

<messages name="validate.phone.check">

When in this block, find a required message to learn its internal name in the similar manner.


The third method (theoretical):


Open the API documentation for a required control panel (in our example open BILLmanager_API) to find description of the needed function. There you can see its internal name and internal names of parameters (fields). However, in some situations you won't be able to use it, because it describes parameters, rather than text messages. Besides, not all the modules can be accessed via API. The task under consideration cannot be solved using this method.

Was this helpful? Yes | No
Views
Personal tools