How To Define a Custom Default Language in ProcessMaker
By jamie | May 3, 2011 | How To, ProcessMaker
English is the default ProcessMaker’s language. But if your users are using a different one and your processes are not designed to be run in English, it’s not easy to always remember to choose the appropriate one in the Language drop-down every time you log in. In this article we will show you in two easy steps how to define Spanish as the default language in the login screen.
Step 1. Make a backup copy of the file you’re about to modify:
cp /opt/processmaker/workflow/engine/methods/login/login.php /opt/processmaker/workflow/engine/methods/login/login.php.bak
We’re assuming your installation directory is the default one: /opt/processmaker/.
Step 2. Edit the login file (using vim here, but you may use your preferred editor):
vim opt/processmaker/workflow/engine/methods/login/login.php
Make the appropriate changes so your login.php file looks similar to the following lines:
94 $availableLangArray = array ();
95 $aks = array(); //Added to display only Spanish
96 $availableLangArray [] = array ('LANG_ID' => 'char', 'LANG_NAME' => 'char' );
97 $aks [] = array ('LANG_ID' => 'char', 'LANG_NAME' => 'char' );//Added to display only Spanish
98 foreach ( $translationsTable as $locale ) {
99 $row['LANG_ID'] = $locale['LOCALE'];
100 if( $locale['COUNTRY'] != '.' )
101 $row['LANG_NAME'] = $locale['LANGUAGE'] . ' (' . (ucwords(strtolower($locale['COUNTRY']))) . ')';
102 else
103 $row['LANG_NAME'] = $locale['LANGUAGE'];
104
105 $availableLangArray [] = $row;
106 }
107 global $_DBArray;
108 $aks [] = array ('LANG_ID' => 'es', 'LANG_NAME' => 'Espanol' ); //Added to display Spanish only
109 $_DBArray ['langOptions'] = $aks; //Added to display Spanish only
110 //$_DBArray ['langOptions'] = $availableLangArray; // Added to display Spanish only
That’s all. Now your users can omit specifying their language every time they log in.