Skip to content

Commit

Permalink
Changed to show a warning after upgrade or migration if the language …
Browse files Browse the repository at this point in the history
…the user was using is no longer supported
  • Loading branch information
mystralkk committed Apr 10, 2022
1 parent 49de585 commit 2d2aaab
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 115 deletions.
2 changes: 2 additions & 0 deletions public_html/admin/install/classes/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Upgrade extends Common
*/
private function fixPathsAndUrls($path, $path_html, $site_url, $site_admin_url)
{
global $_TABLES;

require_once $path . 'system/classes/ConfigInterface.php';
require_once $path . 'system/classes/config.class.php';

Expand Down
6 changes: 4 additions & 2 deletions public_html/admin/install/classes/installer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ private function checkPost150Upgrade($dbConfigFilePath, $siteConfigFilePath)
*/
private function installEngine($installType, $installStep)
{
global $_CONF, $_TABLES, $_DB, $_DB_dbms, $_DB_host, $_DB_name, $_DB_user, $_DB_pass, $_DB_table_prefix, $_DEVICE, $_URL;
global $_CONF, $_LOCALE, $_TABLES, $_DB, $_DB_dbms, $_DB_host, $_DB_name, $_DB_user, $_DB_pass, $_DB_table_prefix, $_DEVICE, $_URL;

$retval = '';

Expand Down Expand Up @@ -1052,6 +1052,7 @@ private function installEngine($installType, $installStep)
'msg' => ($numFailures === 0) ? 27 : 28,
]);
header('Location: ' . $nextLink);
exit();
}

$installPlugins = ($this->get('install_plugins') === 'true');
Expand All @@ -1076,7 +1077,8 @@ private function installEngine($installType, $installStep)
*/
public function run()
{
global $_CONF, $_TABLES, $_VARS, $_URL, $_DEVICE, $_SCRIPTS, $_IMAGE_TYPE, $TEMPLATE_OPTIONS, $_GROUPS, $_RIGHTS, $_USER, $_DB_dbms, $_DB_table_prefix;
global $_CONF, $_LOCALE, $_TABLES, $_VARS, $_URL, $_DEVICE, $_SCRIPTS, $_IMAGE_TYPE, $TEMPLATE_OPTIONS;
global $_GROUPS, $_RIGHTS, $_USER, $_DB_dbms, $_DB_table_prefix;

Common::$env['html_path'] = $this->getHtmlPath();
Common::$env['siteconfig_path'] = Common::$env['html_path'] . 'siteconfig.php';
Expand Down
43 changes: 21 additions & 22 deletions public_html/admin/install/language/chinese_simplified_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
25 => 'No, thanks. I will manually delete them afterwards.',
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.'
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down Expand Up @@ -430,6 +431,25 @@
'plugin_upload' => 'Choose a plugin archive (in .zip, .tar.gz, or .tgz format) to upload and install.'
);

// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);

// +---------------------------------------------------------------------------+
// rescue.php

Expand Down Expand Up @@ -481,24 +501,3 @@
44 => 'Email my password',
45 => 'Geeklog appears not to be installed or the install did not complete properly as core information is missing in the Geeklog database. Therefore this rescue tool cannot be used.'
);


// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'utf8' => $LANG_INSTALL[92],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);
43 changes: 21 additions & 22 deletions public_html/admin/install/language/chinese_traditional_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
25 => 'No, thanks. I will manually delete them afterwards.',
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.'
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down Expand Up @@ -430,6 +431,25 @@
'plugin_upload' => 'Choose a plugin archive (in .zip, .tar.gz, or .tgz format) to upload and install.'
);

// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);

// +---------------------------------------------------------------------------+
// rescue.php

Expand Down Expand Up @@ -481,24 +501,3 @@
44 => 'Email my password',
45 => 'Geeklog appears not to be installed or the install did not complete properly as core information is missing in the Geeklog database. Therefore this rescue tool cannot be used.'
);


// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'utf8' => $LANG_INSTALL[92],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);
1 change: 1 addition & 0 deletions public_html/admin/install/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down
1 change: 1 addition & 0 deletions public_html/admin/install/language/english_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down
43 changes: 21 additions & 22 deletions public_html/admin/install/language/german_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@
25 => 'No, thanks. I will manually delete them afterwards.',
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.'
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down Expand Up @@ -429,6 +430,25 @@
'plugin_upload' => 'W&auml;hle ein Plugin-Archiv (in den Formaten .zip, .tar.gz oder .tgz format) zum Hochladen und Installieren.'
);

// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);

// +---------------------------------------------------------------------------+
// rescue.php

Expand Down Expand Up @@ -480,24 +500,3 @@
44 => 'Email my password',
45 => 'Geeklog appears not to be installed or the install did not complete properly as core information is missing in the Geeklog database. Therefore this rescue tool cannot be used.'
);


// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'utf8' => $LANG_INSTALL[92],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);
43 changes: 21 additions & 22 deletions public_html/admin/install/language/hebrew_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
25 => 'No, thanks. I will manually delete them afterwards.',
26 => 'Remember, if you have disabled your site in <code>public_html/siteconfig.php</code>, you will need to reenable it again before you can use your site.',
27 => 'Successfully upgraded all plugins.',
28 => 'Failed to upgrade some plugins. They are disabled now.'
28 => 'Failed to upgrade some plugins. They are disabled now.',
29 => 'The language file "%s" you were using is no longer supported with the current version, so we are using "english.php" instead.',
);

// +---------------------------------------------------------------------------+
Expand Down Expand Up @@ -423,6 +424,25 @@
'plugin_upload' => 'ביחרו ארכיון plugin (בצורת zip, tar.gz או tgz) בשביל להעלות ולהתקין.'
);

// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);

// +---------------------------------------------------------------------------+
// rescue.php

Expand Down Expand Up @@ -474,24 +494,3 @@
44 => 'שליחת הססמה באימייל',
45 => 'Geeklog appears not to be installed or the install did not complete properly as core information is missing in the Geeklog database. Therefore this rescue tool cannot be used.'
);


// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'utf8' => $LANG_INSTALL[92],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);
43 changes: 21 additions & 22 deletions public_html/admin/install/language/japanese_utf-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
25 => 'いいえ、後で自分で削除します。',
26 => '注意: <code>public_html/siteconfig.php</code>内の設定でサイトを無効にしている場合、再び有効にするまではサイトを使用できません。',
27 => 'すべてのプラグインを更新しました。',
28 => '更新できなかったプラグインを無効にしました。'
28 => '更新できなかったプラグインを無効にしました。',
29 => 'お使いの言語ファイル "%s" はもはやサポートされていないため、代わりに "english.php" を使用しています。',
);

// +---------------------------------------------------------------------------+
Expand Down Expand Up @@ -431,6 +432,25 @@
'plugin_upload' => 'アップロードするプラグインの圧縮ファイル(.zip, .tar.gz, .tgzファーマット)を選んでインストールしてください。'
);

// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);

// +---------------------------------------------------------------------------+
// rescue.php

Expand Down Expand Up @@ -482,24 +502,3 @@
44 => 'パスワードをメールで送信する',
45 => 'Geeklogのデータベースにコア情報がないため、Geeklogは未インストールまたはインストールが正常に完了していないようです。したがって、このレスキューツールを使用することはできません。'
);


// which texts to use as labels, so they don't have to be translated again
$LANG_LABEL = array(
'site_name' => $LANG_INSTALL[32],
'site_slogan' => $LANG_INSTALL[33],
'db_type' => $LANG_INSTALL[34],
'db_host' => $LANG_INSTALL[39],
'db_name' => $LANG_INSTALL[40],
'db_user' => $LANG_INSTALL[41],
'db_pass' => $LANG_INSTALL[42],
'db_prefix' => $LANG_INSTALL[43],
'site_url' => $LANG_INSTALL[45],
'site_admin_url' => $LANG_INSTALL[47],
'site_mail' => $LANG_INSTALL[48],
'noreply_mail' => $LANG_INSTALL[49],
'utf8' => $LANG_INSTALL[92],
'charactersets' => $LANG_INSTALL[123],
'migrate_file' => $LANG_MIGRATE[6],
'plugin_upload' => $LANG_PLUGINS[10]
);
10 changes: 10 additions & 0 deletions public_html/admin/install/success.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
define('GL_INSTALL_ACTIVE', true);

use Geeklog\Input;
use Geeklog\LocaleData;

require_once '../../lib-common.php';

Expand Down Expand Up @@ -160,6 +161,15 @@ function SUCCESS_deleteAll($baseDir)
$message = $LANG_SUCCESS[22];
}

// Check if the language the user is using is supported, and show a warning if necessary
if (!LocaleData::isLanguageSupported($language)) {
if (!empty($msg)) {
$msg .= '<br>';
}

$msg .= sprintf($LANG_SUCCESS[29], $language);
}

$T->set_var([
'conf_path' => $_CONF['path'],
'conf_path_html' => $_CONF['path_html'],
Expand Down

0 comments on commit 2d2aaab

Please sign in to comment.