dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Small Localization enhancement DolibarrModules.class.


From: Laurent Destailleur (eldy)
Subject: Re: [Dolibarr-dev] Small Localization enhancement DolibarrModules.class.php
Date: Thu, 03 May 2012 22:47:00 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Why not putting the
ModuleNNNName

into you own module language file. This avoid to edit admin.lang and allow your module to bring its own translation of its name.


Le 03/05/2012 18:50, Philippe Gerland a écrit :
Module name/description specified in module descriptor (modMyModule.class.php) is currently not localized (unless you use the ModuleNNNName/Module inside generic admin.lang).
In order to allow use of module langs definition, only a small change would be required, as the module langs file is already loaded :
DolibarrModules.class.php : 
 function getName
 Line 238 : 
    replace "return $this->name;" by "return $langs->trans($this->name);"
 function getDesc
 Line 262 : 
   replace "return $this->description;" by "return $langs->trans($this->description);"

With this change, you just need to put the keys towards your module lang files inside your modMyModule.class.php.
  $this->name = 'KeyModuleName';
  $this->description = 'KeyModuleDescription';
$this->langfiles = array("address@hidden")



_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

-- 
Eldy (Laurent Destailleur).
---------------------------------------------------------------
EMail: address@hidden
Web: http://www.destailleur.fr

Dolibarr (Project leader): http://www.dolibarr.org
To make a donation for Dolibarr project via Paypal: address@hidden
AWStats (Author) : http://awstats.sourceforge.net
To make a donation for AWStats project via Paypal: address@hidden
AWBot (Author) : http://awbot.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]