forked from Wavyzz/dolibarr
New: Add flag on product translation page.
This commit is contained in:
@@ -39,6 +39,8 @@ if (file_exists($conffile) && isset($dolibarr_main_url_root))
|
||||
exit;
|
||||
}
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -54,10 +56,7 @@ print '<img src="../theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
|
||||
print DOL_VERSION.'<br><br>';
|
||||
print '</center>';
|
||||
|
||||
// Propose la langue d'installation
|
||||
$langs->load("admin");
|
||||
$langs_available=$langs->get_available_languages("..");
|
||||
|
||||
// Ask installation language
|
||||
print '<br><br><center>';
|
||||
print '<table><tr>';
|
||||
print '<td>'.$langs->trans("DefaultLanguage").' : </td><td align="left">';
|
||||
|
||||
@@ -996,7 +996,7 @@ function picto_from_langcode($codelang)
|
||||
if ($codelang == 'auto') $ret=img_picto('',DOL_URL_ROOT.'/theme/common/flags/int.png','',1);
|
||||
else {
|
||||
//print $codelang;
|
||||
$langtocountryflag=array('fr_CA'=>'mq','ca_ES'=>'catalonia','ar_AR'=>'');
|
||||
$langtocountryflag=array('da_DA'=>'dk','fr_CA'=>'mq','ca_ES'=>'catalonia','ar_AR'=>'');
|
||||
$tmpcode='';
|
||||
if (isset($langtocountryflag[$codelang])) $tmpcode=$langtocountryflag[$codelang];
|
||||
else
|
||||
|
||||
@@ -605,20 +605,13 @@ class Product extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge toutes les traductions du produit
|
||||
* \brief Load array this->multilangs
|
||||
*/
|
||||
function getMultiLangs($langue='')
|
||||
function getMultiLangs()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs_available = $langs->get_available_languages();
|
||||
|
||||
if ( $langue != '')
|
||||
foreach ($langs_available as $key => $value)
|
||||
if ( $key == $langue ) $current_lang = $key; // si $langue est une valeur correcte
|
||||
|
||||
if ( !$current_lang )
|
||||
$current_lang = $langs->getDefaultLang(); // sinon on choisi la langue par defaut
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
$sql = "SELECT lang, label, description, note";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang";
|
||||
|
||||
@@ -68,14 +68,14 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
if ( $_POST["lang"] == $current_lang )
|
||||
{
|
||||
$product->libelle = $_POST["libelle"];
|
||||
$product->description = $_POST["desc"];
|
||||
$product->note = $_POST["note"];
|
||||
$product->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$product->note = dol_htmlcleanlastbr($_POST["note"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$product->multilangs[$_POST["lang"]]["libelle"] = $_POST["libelle"];
|
||||
$product->multilangs[$_POST["lang"]]["description"] = $_POST["desc"];
|
||||
$product->multilangs[$_POST["lang"]]["note"] = $_POST["note"];
|
||||
$product->multilangs[$_POST["lang"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$product->multilangs[$_POST["lang"]]["note"] = dol_htmlcleanlastbr($_POST["note"]);
|
||||
}
|
||||
|
||||
// sauvegarde en base
|
||||
@@ -104,14 +104,14 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
if ( $key == $current_lang )
|
||||
{
|
||||
$product->libelle = $_POST["libelle-".$key];
|
||||
$product->description = $_POST["desc-".$key];
|
||||
$product->note = $_POST["note-".$key];
|
||||
$product->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$product->note = dol_htmlcleanlastbr($_POST["note-".$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$product->multilangs[$key]["libelle"] = $_POST["libelle-".$key];
|
||||
$product->multilangs[$key]["description"] = $_POST["desc-".$key];
|
||||
$product->multilangs[$key]["note"] = $_POST["note-".$key];
|
||||
$product->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$product->multilangs[$key]["note"] = dol_htmlcleanlastbr($_POST["note-".$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights-
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@@ -416,9 +416,9 @@ class Translate {
|
||||
* Parameters of this method must not contains any HTML tags.
|
||||
* \param key key of string to translate
|
||||
* \param param1 chaine de param1
|
||||
* \param param2 chaine de param1
|
||||
* \param param3 chaine de param1
|
||||
* \param param4 chaine de param1
|
||||
* \param param2 chaine de param2
|
||||
* \param param3 chaine de param3
|
||||
* \param param4 chaine de param4
|
||||
* \return string chaine traduite
|
||||
*/
|
||||
function transnoentities($key, $param1='', $param2='', $param3='', $param4='')
|
||||
|
||||
Reference in New Issue
Block a user