It has been a while since I wanted to add Portuguese language to the A2Billing application.
Some time ago, I saw that nice Brazilian prompts were made available in the distribution, but there was no code in the system to actually use them.
This is an attempt to share the modifications I implemented in the system to make these prompts available. I have tested it on my lab and production systems with no problems so far.
Though is being done for Portuguese, it can be used to add any other language, provided that you put the right sound files in the right directory as shown later on.
Any comments/improvements are welcomed.
These modifications were done on an Astersk2Billing version 1.3.0.
I am using the following web server path to the asterisk2billing application in my system: /var/www/a2b/
You may have a different setup and thus will need to use the right path for your system.
1. Modifications in file /var/www/a2b/A2Billing_UI/Public/form_data/FG_var_card.inc:
a) Look for "$language_list = array();" (without the quotes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"), "br"); //NEW NEW NEW
b) right after that, you will find another list. Add the following line at the end of that list:
Code:
$language_list_r["3"] = array("br", gettext("PORTUGUESE")); //NEW NEW NEW
The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( gettext("ENGLISH"), "en");
$language_list["1"] = array( gettext("SPANISH"), "es");
$language_list["2"] = array( gettext("FRENCH"), "fr");
$language_list["3"] = array( gettext("PORTUGUESE"), "br"); //NEW NEW NEW
$language_list_r = array();
$language_list_r["0"] = array("en", gettext("ENGLISH"));
$language_list_r["1"] = array("es", gettext("SPANISH"));
$language_list_r["2"] = array("fr", gettext("FRENCH"));
$language_list_r["3"] = array("br", gettext("PORTUGUESE")); //NEW NEW NEW
2. Modifications in file /var/www/a2b/A2Billing_UI/Public/form_data/FG_var_ecommerce.inc
Look for "$language_list = array();" (without the qoutes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"), "br"); //NEW NEW NEW
The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( gettext("ENGLISH"), "en");
$language_list["1"] = array( gettext("SPANISH"), "es");
$language_list["2"] = array( gettext("FRENCH"), "fr");
$language_list["3"] = array( gettext("PORTUGUESE"), "br"); //NEW NEW NEW
3. Modifications in file /var/www/a2b/A2Billing_UI/signup/form_data/FG_var_index.inc
a) Look for "$language_list = array();" (without the quotes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"), "br"); //NEW NEW NEW
b) right after that, you will find another list. Add the following line at the end of that list:
Code:
$language_list_r["3"] = array("br", gettext("PORTUGUESE")); //NEW NEW NEW
The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( "ENGLISH", "en");
$language_list["1"] = array( "SPANISH", "es");
$language_list["2"] = array( "FRENCH", "fr");
$language_list["3"] = array( "PORTUGUESE", "br"); //NEW NEW NEW
$language_list_r = array();
$language_list_r["0"] = array("en", "ENGLISH");
$language_list_r["1"] = array("es", "SPANISH");
$language_list_r["2"] = array("fr", "FRENCH");
$language_list_r["3"] = array("br", "PORTUGUESE"); //NEW NEW NEW
That finishes the needed modifications in the asterisk2billing files.
Be sure to place the Brazilian sound files in the /var/lib/asterisk/sounds/br directory so that asterisk can find them. Note that the "br" directory matches the "br" assignments in the lists of parameters modified before.
If you add another language you must use a different letters combination in both places: the lists and the directory name so they match all the time.
After this modifications, when you go into Customers--> List Customers --> Edit and you click on the LANGUAGE selection, you should be able to see and select the PORTUGUESE option.
Once selected, the A2Billing will use the Brazilian sounds for that card users.
Enjoy,
Eduardo