Fix translation of module descriptions
This commit is contained in:
parent
dd6ccf5095
commit
a40bebec40
@ -575,7 +575,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
return $langs->trans("Module".$this->name."Name");
|
return $langs->trans("Module".$this->name."Name");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last change with simple product label
|
// Last chance with simple label
|
||||||
return $langs->trans($this->name);
|
return $langs->trans($this->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -606,6 +606,14 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
if ($val) $langs->load($val);
|
if ($val) $langs->load($val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($langs->trans("Module".$this->name."Desc") != ("Module".$this->name."Desc"))
|
||||||
|
{
|
||||||
|
// If module name translation exists
|
||||||
|
return $langs->trans("Module".$this->name."Desc");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last chance with simple label
|
||||||
return $langs->trans($this->description);
|
return $langs->trans($this->description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -671,16 +679,27 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
*/
|
*/
|
||||||
function getDescLongReadmeFound()
|
function getDescLongReadmeFound()
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
$filefound= false;
|
$filefound= false;
|
||||||
|
|
||||||
// Define path to file README.md.
|
// Define path to file README.md.
|
||||||
// First check README-la_LA.md then README.md
|
// First check README-la_LA.md then README-la.md then README.md
|
||||||
$pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0);
|
$pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0);
|
||||||
if (dol_is_file($pathoffile))
|
if (dol_is_file($pathoffile))
|
||||||
{
|
{
|
||||||
$filefound = true;
|
$filefound = true;
|
||||||
}
|
}
|
||||||
if (! $filefound)
|
if (! $filefound)
|
||||||
|
{
|
||||||
|
$tmp=explode('_', $langs->defaultlang);
|
||||||
|
$pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$tmp[0].'.md', 0);
|
||||||
|
if (dol_is_file($pathoffile))
|
||||||
|
{
|
||||||
|
$filefound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $filefound)
|
||||||
{
|
{
|
||||||
$pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0);
|
$pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0);
|
||||||
if (dol_is_file($pathoffile))
|
if (dol_is_file($pathoffile))
|
||||||
|
|||||||
@ -72,19 +72,13 @@ $page_name = "MyModuleAbout";
|
|||||||
llxHeader('', $langs->trans($page_name));
|
llxHeader('', $langs->trans($page_name));
|
||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
. $langs->trans("BackToModuleList") . '</a>';
|
|
||||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule');
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = mymoduleAdminPrepareHead();
|
$head = mymoduleAdminPrepareHead();
|
||||||
dol_fiche_head(
|
dol_fiche_head($head, 'about', '', 0, 'mymodule@mymodule');
|
||||||
$head,
|
|
||||||
'about',
|
|
||||||
$langs->trans("ModuleMyModuleName"),
|
|
||||||
0,
|
|
||||||
'mymodule@mymodule'
|
|
||||||
);
|
|
||||||
|
|
||||||
dol_include_once('/mymodule/core/modules/modMyModule.class.php');
|
dol_include_once('/mymodule/core/modules/modMyModule.class.php');
|
||||||
$tmpmodule = new modMyModule($db);
|
$tmpmodule = new modMyModule($db);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
$arrayofparameters=array('MYMODULE_MYPARAM1'=>'1', 'MYMODULE_MYPARAM2'=>'2');
|
$arrayofparameters=array('MYMODULE_MYPARAM1'=>array('css'=>'minwidth200'), 'MYMODULE_MYPARAM2'=>array('css'=>'minwidth500'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -72,17 +72,11 @@ llxHeader('', $langs->trans($page_name));
|
|||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule');
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = mymoduleAdminPrepareHead();
|
$head = mymoduleAdminPrepareHead();
|
||||||
dol_fiche_head(
|
dol_fiche_head($head, 'settings', '', -1, "mymodule@mymodule");
|
||||||
$head,
|
|
||||||
'settings',
|
|
||||||
$langs->trans("ModuleMyModuleName"),
|
|
||||||
-1,
|
|
||||||
"mymodule@mymodule"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Setup page goes here
|
// Setup page goes here
|
||||||
echo $langs->trans("MyModuleSetupPage");
|
echo $langs->trans("MyModuleSetupPage");
|
||||||
@ -101,7 +95,7 @@ if ($action == 'edit')
|
|||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
||||||
print '</td><td><input class="flat" name="'.$key.'" size="3" value="' . $conf->global->$key . '"></td></tr>';
|
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user