diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php
index b21cc7c01..e29eb15c3 100644
--- a/admin/include/functions_upgrade.php
+++ b/admin/include/functions_upgrade.php
@@ -132,11 +132,8 @@ WHERE id IN ("' . implode('","', $plugins) . '")
;';
mysql_query($query);
- array_push(
- $page['infos'],
- 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:
-
This page proposes to upgrade your database corresponding to your old
-version of Piwigo to the current version. The upgrade assistant
-thinks you are currently running a
-release {$introduction.CURRENT_RELEASE} (or equivalent).
';
for ($upgrade_id = 61; ; $upgrade_id++)
@@ -115,6 +116,7 @@ INSERT INTO `'.PREFIX_TABLE.'upgrade`
}
echo '
';
+ob_clean();
// now we upgrade from 2.0.0
// include_once(PHPWG_ROOT_PATH.'install/upgrade_2.0.0.php');
diff --git a/language/de_DE/upgrade.lang.php b/language/de_DE/upgrade.lang.php
new file mode 100644
index 000000000..04ed605a7
--- /dev/null
+++ b/language/de_DE/upgrade.lang.php
@@ -0,0 +1,39 @@
+release %s (or equivalent).';
+$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
+$lang['Statistics'] = 'Statistics';
+$lang['total upgrade time'] = 'total upgrade time';
+$lang['total SQL time'] = 'total SQL time';
+$lang['SQL queries'] = 'SQL queries';
+$lang['Upgrade informations'] = 'Upgrade informations';
+$lang['delete upgrade files'] = '[Security] Delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install" directory';
+$lang['remove line from mysql.inc.php'] = 'In include/mysql.inc.php, remove:';
+$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>General>Maintenance] if you encounter any problem.';
+$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
+
+?>
\ No newline at end of file
diff --git a/language/en_UK/upgrade.lang.php b/language/en_UK/upgrade.lang.php
new file mode 100644
index 000000000..8a65bf810
--- /dev/null
+++ b/language/en_UK/upgrade.lang.php
@@ -0,0 +1,38 @@
+release %s (or equivalent).';
+$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
+$lang['Statistics'] = 'Statistics';
+$lang['total upgrade time'] = 'total upgrade time';
+$lang['total SQL time'] = 'total SQL time';
+$lang['SQL queries'] = 'SQL queries';
+$lang['Upgrade informations'] = 'Upgrade informations';
+$lang['delete upgrade files'] = '[Security] Delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install" directory';
+$lang['remove line from mysql.inc.php'] = 'In include/mysql.inc.php, remove:';
+$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>General>Maintenance] if you encounter any problem.';
+$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
+
+?>
\ No newline at end of file
diff --git a/language/es_ES/upgrade.lang.php b/language/es_ES/upgrade.lang.php
new file mode 100644
index 000000000..04ed605a7
--- /dev/null
+++ b/language/es_ES/upgrade.lang.php
@@ -0,0 +1,39 @@
+release %s (or equivalent).';
+$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
+$lang['Statistics'] = 'Statistics';
+$lang['total upgrade time'] = 'total upgrade time';
+$lang['total SQL time'] = 'total SQL time';
+$lang['SQL queries'] = 'SQL queries';
+$lang['Upgrade informations'] = 'Upgrade informations';
+$lang['delete upgrade files'] = '[Security] Delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install" directory';
+$lang['remove line from mysql.inc.php'] = 'In include/mysql.inc.php, remove:';
+$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>General>Maintenance] if you encounter any problem.';
+$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
+
+?>
\ No newline at end of file
diff --git a/language/fr_FR/upgrade.lang.php b/language/fr_FR/upgrade.lang.php
new file mode 100644
index 000000000..41ec88d58
--- /dev/null
+++ b/language/fr_FR/upgrade.lang.php
@@ -0,0 +1,38 @@
+version %s (ou équivalente).';
+$lang['Upgrade from %s to %s'] = 'Mise à jour de la version %s à %s';
+$lang['Statistics'] = 'Statistiques';
+$lang['total upgrade time'] = 'temps total de la mise à jour';
+$lang['total SQL time'] = 'temps total des requêtes SQL';
+$lang['SQL queries'] = 'nombre de requêtes SQL';
+$lang['Upgrade informations'] = 'Informations sur la mise à jour';
+$lang['delete upgrade files'] = '[Sécurité] Effacez les fichiers "upgrade.php", "upgrade_feed.php", "install.php" ainsi que le dossier "install"';
+$lang['remove line from mysql.inc.php'] = 'Dans le fichier include/mysql.inc.php, effacez la ligne suivante:';
+$lang['perform a maintenance check'] = 'Veuillez effectuer une maintenance dans [Administration>Spéciales>Maintenance] si vous rencontrez des problèmes.';
+$lang['deactivated plugins'] = 'Par précaution, les plugins suivants ont été désactivés. Vérifiez s\'il existe des mises à jour avant de les réactiver:';
+
+?>
\ No newline at end of file
diff --git a/language/it_IT/upgrade.lang.php b/language/it_IT/upgrade.lang.php
new file mode 100644
index 000000000..04ed605a7
--- /dev/null
+++ b/language/it_IT/upgrade.lang.php
@@ -0,0 +1,39 @@
+release %s (or equivalent).';
+$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
+$lang['Statistics'] = 'Statistics';
+$lang['total upgrade time'] = 'total upgrade time';
+$lang['total SQL time'] = 'total SQL time';
+$lang['SQL queries'] = 'SQL queries';
+$lang['Upgrade informations'] = 'Upgrade informations';
+$lang['delete upgrade files'] = '[Security] Delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install" directory';
+$lang['remove line from mysql.inc.php'] = 'In include/mysql.inc.php, remove:';
+$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>General>Maintenance] if you encounter any problem.';
+$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
+
+?>
\ No newline at end of file
diff --git a/language/nl_NL/upgrade.lang.php b/language/nl_NL/upgrade.lang.php
new file mode 100644
index 000000000..04ed605a7
--- /dev/null
+++ b/language/nl_NL/upgrade.lang.php
@@ -0,0 +1,39 @@
+release %s (or equivalent).';
+$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
+$lang['Statistics'] = 'Statistics';
+$lang['total upgrade time'] = 'total upgrade time';
+$lang['total SQL time'] = 'total SQL time';
+$lang['SQL queries'] = 'SQL queries';
+$lang['Upgrade informations'] = 'Upgrade informations';
+$lang['delete upgrade files'] = '[Security] Delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install" directory';
+$lang['remove line from mysql.inc.php'] = 'In include/mysql.inc.php, remove:';
+$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>General>Maintenance] if you encounter any problem.';
+$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
+
+?>
\ No newline at end of file
diff --git a/upgrade.php b/upgrade.php
index cb1d7337e..83d1f12a0 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -147,14 +147,49 @@ function print_time($message)
// echo $upgrade_id, ' ';
// }
+// +-----------------------------------------------------------------------+
+// | language |
+// +-----------------------------------------------------------------------+
+if (isset($_GET['language']))
+{
+ $language = strip_tags($_GET['language']);
+}
+else
+{
+ $language = 'en_UK';
+ // Try to get browser language
+ foreach (get_languages('utf-8') as $language_code => $language_name)
+ {
+ if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2))
+ {
+ $language = $language_code;
+ break;
+ }
+ }
+}
+
+load_language( 'common.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+load_language( 'upgrade.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+
// +-----------------------------------------------------------------------+
// | template initialization |
// +-----------------------------------------------------------------------+
-$template = new Template(PHPWG_ROOT_PATH.'admin/template/goto');
+$template = new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma');
$template->set_filenames(array('upgrade'=>'upgrade.tpl'));
$template->assign('RELEASE', PHPWG_VERSION);
+foreach (get_languages('utf-8') as $language_code => $language_name)
+{
+ if ($language == $language_code)
+ {
+ $template->assign('language_selection', $language_code);
+ }
+ $languages_options[$language_code] = $language_name;
+}
+$template->assign('language_options', $languages_options);
+
// +-----------------------------------------------------------------------+
// | upgrade choice |
// +-----------------------------------------------------------------------+
@@ -210,7 +245,7 @@ if (!isset($_GET['version']))
array(
'CURRENT_RELEASE' => $current_release,
'RUN_UPGRADE_URL' =>
- PHPWG_ROOT_PATH.'upgrade.php?version='.$current_release,
+ PHPWG_ROOT_PATH.'upgrade.php?version='.$current_release.'&language='.$language,
)
);
}
@@ -263,24 +298,10 @@ else
)
);
- array_push(
- $page['infos'],
- '[security] delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install"
-directory'
- );
-
- array_push(
- $page['infos'],
- 'in include/mysql.inc.php, remove
-
-define(\'PHPWG_IN_UPGRADE\', true);
-
'
- );
-
- array_push(
- $page['infos'],
- 'Perform a maintenance check in [Administration>General>Maintenance]
-if you encounter any problem.'
+ array_push($page['infos'],
+ l10n('delete upgrade files'),
+ l10n('remove line from mysql.inc.php') . '
define(\'PHPWG_IN_UPGRADE\', true);
',
+ l10n('perform a maintenance check')
);
$template->assign('infos', $page['infos']);