Trad: La mcanique du programme d'installation est galement multilangue maintenant. Reste traduire les chaines.
This commit is contained in:
parent
13d8eaf4ce
commit
ca92001001
@ -20,14 +20,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
include_once("./inc.php");
|
||||
|
||||
if (is_readable($conf))
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
|
||||
if (is_readable($conffile))
|
||||
{
|
||||
include ($conf);
|
||||
include_once($conffile);
|
||||
}
|
||||
|
||||
include("./inc.php");
|
||||
pHeader();
|
||||
|
||||
|
||||
|
||||
@ -31,12 +31,14 @@
|
||||
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
pHeader("Fichier de configuration","etape2");
|
||||
|
||||
$etape = 1;
|
||||
|
||||
$conffile = "../conf/conf.php";
|
||||
|
||||
// Répertoire des pages dolibarr
|
||||
$main_dir=isset($_POST["main_dir"])?$_POST["main_dir"]:'';
|
||||
|
||||
|
||||
@ -20,15 +20,19 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
include("./inc.php");
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
pHeader("Création des objets de la base","etape4");
|
||||
|
||||
$etape = 2;
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
if (file_exists($conf))
|
||||
if (file_exists($conffile))
|
||||
{
|
||||
include($conf);
|
||||
include_once($conffile);
|
||||
}
|
||||
|
||||
if($dolibarr_main_db_type == "mysql")
|
||||
|
||||
@ -21,12 +21,17 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
include("./inc.php");
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
pHeader("Création du compte administrateur","etape5");
|
||||
$conf = "../conf/conf.php";
|
||||
if (file_exists($conf))
|
||||
|
||||
if (file_exists($conffile))
|
||||
{
|
||||
include($conf);
|
||||
include_once($conffile);
|
||||
}
|
||||
|
||||
if($dolibarr_main_db_type == "mysql")
|
||||
|
||||
@ -28,13 +28,17 @@
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
include("./inc.php");
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
$success=0;
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
if (file_exists($conf))
|
||||
if (file_exists($conffile))
|
||||
{
|
||||
include($conf);
|
||||
include($conffile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -29,13 +29,16 @@
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
include("./inc.php");
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
pHeader("Fichier de configuration","etape1");
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
|
||||
// Ici, le fichier conf.php existe et est forcément editable car le test a été fait précédemment.
|
||||
include($conf);
|
||||
include_once($conffile);
|
||||
|
||||
print '<table border="0" cellpadding="1" cellspacing="0">';
|
||||
|
||||
|
||||
@ -22,44 +22,75 @@
|
||||
*
|
||||
*/
|
||||
|
||||
$etapes=5;
|
||||
/** \file htdocs/install/inc.php
|
||||
\brief Fichier include du programme d'installation
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
|
||||
$docurl = '<a href="doc/dolibarr-install.html">documentation</a>';
|
||||
$conffile = "../conf/conf.php";
|
||||
|
||||
|
||||
// Récupère langues du navigateur et defini langcode
|
||||
$langpref=$_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
||||
$langpref=eregi_replace(";[^,]*","",$langpref);
|
||||
$langpref=eregi_replace("-","_",$langpref);
|
||||
$langlist=split("[;,]",$langpref);
|
||||
$langpart=split("_",$langlist[0]);
|
||||
if ($langpart[1]) $langcode=$langpart[0]."_".strtoupper($langpart[1]);
|
||||
else $langcode=$langpart[0]."_".strtoupper($langpart[0]);
|
||||
// Defini objet langs
|
||||
require_once("../translate.class.php");
|
||||
$langs = new Translate("../langs", $langcode);
|
||||
|
||||
|
||||
|
||||
function pHeader($soutitre,$next)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("main");
|
||||
$langs->load("admin");
|
||||
|
||||
print '
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="./default.css">
|
||||
<title>Dolibarr Installation</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="titre">
|
||||
<span class="titre"><a class="titre" href="index.php">Dolibarr Installation</a></span>
|
||||
</div>
|
||||
';
|
||||
print '<form action="'.$next.'.php" method="POST">
|
||||
<input type="hidden" name="action" value="set">';
|
||||
print '<div class="main"><div class="soustitre">'.$soutitre.'</div>
|
||||
<div class="main-inside">
|
||||
';
|
||||
print '<html>';
|
||||
print '<head>';
|
||||
print '<meta http-equiv="content-type" content="text/html; charset=iso8859-1">';
|
||||
print '<link rel="stylesheet" type="text/css" href="./default.css">';
|
||||
print '<title>'.$langs->trans("DolibarrSetup").'</title>';
|
||||
print '</head>';
|
||||
print '<body>';
|
||||
|
||||
print '<div class="titre">';
|
||||
print '<span class="titre"><a class="titre" href="index.php">'.$langs->trans("DolibarrSetup").'</a></span>';
|
||||
print '</div>';
|
||||
|
||||
print '<form action="'.$next.'.php" method="POST"><input type="hidden" name="action" value="set">';
|
||||
print '<div class="main">';
|
||||
if ($soutitre) {
|
||||
print '<div class="soustitre">'.$soutitre.'</div>';
|
||||
}
|
||||
print '<div class="main-inside">';
|
||||
}
|
||||
|
||||
|
||||
function pFooter($nonext=0)
|
||||
function pFooter($nonext=0,$addlang=1)
|
||||
{
|
||||
print '</div></div>';
|
||||
if ($nonext == 0)
|
||||
{
|
||||
print '<div class="barrebottom"><input type="submit" value="Etape suivante ->"></div>';
|
||||
}
|
||||
print '
|
||||
</form>
|
||||
</body>
|
||||
</html>';
|
||||
global $langs;
|
||||
$langs->load("main");
|
||||
$langs->load("admin");
|
||||
|
||||
print '</div></div>';
|
||||
if (! $nonext)
|
||||
{
|
||||
print '<div class="barrebottom"><input type="submit" value="'.$langs->trans("NextStep").' ->"></div>';
|
||||
}
|
||||
if ($addlang) {
|
||||
print '<input type="hidden" name="selectlang" value="'.$langs->defaultlang.'">';
|
||||
}
|
||||
print '</form>';
|
||||
print '</body>';
|
||||
print '</html>';
|
||||
}
|
||||
|
||||
|
||||
function dolibarr_syslog($message)
|
||||
|
||||
@ -27,60 +27,53 @@
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
include("./inc.php");
|
||||
pHeader("Bienvenu dans Dolibarr", "licence"); // Etape suivante = license
|
||||
include_once("./inc.php");
|
||||
|
||||
|
||||
print "Nous avons fait en sorte que l'installation soit le plus simple possible, vous n'avez qu'à suivre les étapes une à une.";
|
||||
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
|
||||
|
||||
if (is_readable($conf))
|
||||
// Si fichier conf existe deja, on est pas sur une premiere install,
|
||||
// on ne passe donc pas par la page de choix de langue
|
||||
if (file_exists($conffile))
|
||||
{
|
||||
include ($conf);
|
||||
}
|
||||
else
|
||||
{
|
||||
$fp = @fopen("$conf", "w");
|
||||
if($fp)
|
||||
{
|
||||
@fwrite($fp, '<?php');
|
||||
@fputs($fp,"\n");
|
||||
@fputs($fp,"?>");
|
||||
fclose($fp);
|
||||
}
|
||||
header("Location: check.php");
|
||||
}
|
||||
|
||||
if (!file_exists($conf))
|
||||
{
|
||||
print "<br /><br />Le fichier de configuration <b>conf.php</b> n'existe pas !<br />";
|
||||
print "Vous devez créer un fichier <b>htdocs/conf/conf.php</b> et donner les droits d'écriture dans celui-ci au serveur Apache.<br /><br />";
|
||||
|
||||
print 'Corrigez le problème et <a href="index.php">rechargez la page</a>';
|
||||
pHeader("", "check"); // Etape suivante = index2
|
||||
|
||||
$err++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!is_writable("../conf/conf.php"))
|
||||
{
|
||||
print "<br /><br />Le fichier de configuration <b>conf.php</b> existe.<br />";
|
||||
print "Le fichier <b>conf.php</b> n'est pas accessible en écriture, vérifiez les droits sur celui-ci, le serveur Apache doit avoir le droit d'écrire dans ce fichier le temps de la configuration (chmod 666 par exemple)<br>";
|
||||
|
||||
|
||||
$err++;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<br /><br />Le fichier de configuration <b>conf.php</b> existe.<br />";
|
||||
print "Le fichier <b>conf.php</b> est accessible en écriture<br /><br />Vous pouvez continuer...";
|
||||
print '<center><img src="../theme/dolibarr_logo.png"></center>';
|
||||
|
||||
// Propose la langue d'installation
|
||||
$langs->load("admin");
|
||||
$langs_available=$langs->get_available_languages("..");
|
||||
$selected=$langs->defaultlang;
|
||||
|
||||
print '<br><br>';
|
||||
print '<table><tr>';
|
||||
print '<td>'.$langs->trans("DefaultLanguage").' : </td><td align="left"> ';
|
||||
print '<select name="selectlang">';
|
||||
$num = count($langs_available);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
if ($selected == $langs_available[$i])
|
||||
{
|
||||
print '<option value="'.$langs_available[$i].'" selected>'.$langs_available[$i].'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$langs_available[$i].'">'.$langs_available[$i].'</option>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '</tr></table>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Si pas d'erreur, on affiche le bouton pour passer à l'étape suivante
|
||||
if ($err == 0) pFooter();
|
||||
if ($err == 0) pFooter(0,0);
|
||||
|
||||
?>
|
||||
|
||||
@ -20,7 +20,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
include("./inc.php");
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=$_POST["selectlang"];
|
||||
$langs->defaultlang=$setuplang;
|
||||
$langs->load("install");
|
||||
|
||||
pHeader("Licence d'utilisation","fileconf");
|
||||
|
||||
print '<pre>';
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
# Dolibarr language file - en_US - admin
|
||||
Version=Version
|
||||
DolibarrSetup=Dolibarr setup
|
||||
GlobalSetup=Global setup
|
||||
GUISetup=GUI setup
|
||||
DictionnarySetup=Dictionnary setup
|
||||
|
||||
3
htdocs/langs/en_US/install.lang
Normal file
3
htdocs/langs/en_US/install.lang
Normal file
@ -0,0 +1,3 @@
|
||||
# Dolibarr language file - en_US - install
|
||||
InstallEasy=We tried to make Dolibarr setup as easy as possible. Just follow instructions step by step.
|
||||
DolibarrWelcome=Welcome on Dolibarr
|
||||
@ -1,5 +1,6 @@
|
||||
# Dolibarr language file - fr_FR - admin
|
||||
Version=Version
|
||||
DolibarrSetup=Installation Dolibarr
|
||||
GlobalSetup=Général
|
||||
GUISetup=Interface
|
||||
DictionnarySetup=Dictionnaires
|
||||
|
||||
3
htdocs/langs/fr_FR/install.lang
Normal file
3
htdocs/langs/fr_FR/install.lang
Normal file
@ -0,0 +1,3 @@
|
||||
# Dolibarr language file - fr_FR - install
|
||||
InstallEasy=Nous avons fait en sorte que l'installation soit le plus simple possible, vous n'avez qu'à suivre les étapes une à une.
|
||||
DolibarrWelcome=Bienvenu sur Dolibarr
|
||||
@ -147,10 +147,10 @@ class Translate {
|
||||
* \return array list of languages
|
||||
*/
|
||||
|
||||
function get_available_languages()
|
||||
function get_available_languages($langdir=DOL_DOCUMENT_ROOT)
|
||||
{
|
||||
// On parcour le répertoire langs pour détecter les langues disponibles
|
||||
$handle=opendir(DOL_DOCUMENT_ROOT ."/langs");
|
||||
$handle=opendir($langdir ."/langs");
|
||||
$langs_available=array();
|
||||
while ($file = trim(readdir($handle))){
|
||||
if($file != "." && $file != ".." && $file != "CVS") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user