Softaculous


Topic : How to translate texts in mod_install.xml


Posted By: manoaratefy on September 8, 2021, 6:55 am
Hello,
I've written a mod for WordPress in Softaculous, using /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/conf/mods/wp/mod_install.xml and /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/conf/mods/wp/mods.php files.
Now, I want to translate texts on it for multiple languages. How to achieve that? I didn't found any documentation about this.
Thanks in advance.

Posted By: Brijesh on September 8, 2021, 11:46 am | Post: 1
Hi,
I will explain it here :
1. In mod_install.xml you can use double curly braces instead of the original text. E.g. I want to translate the plugin name "Smart Maintenance Mode" so I will replace it as follows :
<head>{{maintenance_mode}}</head>
2. Now in mods.php in __wp_mod_settings function please globalize $softlang e.g.
global $softlang;
3. Now add your translated strings in this function after globalizing the array e.g. :
$softlang['english']['maintenance_mode'] = 'Smart Maintenance Mode';
$softlang['french']['maintenance_mode'] = 'Mode d\'entretien intelligent ';

Make sure the keys in $softlang matches the values you want to replace within double curly braces {{}} in the mod_install.xml
Let me know if you face any issues.


Edited by Brijesh : September 8, 2021, 11:47 am

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.