Permalink
Browse files

Add language and collation info to diagnostics

Fixes #1296. Thanks, petecooper.
  • Loading branch information...
Bloke committed Jun 22, 2018
1 parent d21b853 commit 977c59c2bc1ceb3c9b878ad46f11486e5690f7c2
Showing with 5 additions and 1 deletion.
  1. +4 −1 textpattern/include/txp_diag.php
  2. +1 −0 textpattern/mode.ini
@@ -470,6 +470,7 @@ function doDiagnostics()
hed(gTxt('preflight_check'), 2);
$thisLang = get_pref('language_ui', TEXTPATTERN_DEFAULT_LANG);
$siteLang = get_pref('language', TEXTPATTERN_DEFAULT_LANG);
$langs = array_unique(array('en', $thisLang));
$pfcStrings = array();
$langCounter = 0;
@@ -615,6 +616,8 @@ function doDiagnostics()
gTxt('diag_locale').cs.$locale.n,
gTxt('diag_languages', array('{site_lang}' => $siteLang, '{admin_lang}' => $thisLang)).n,
(isset($_SERVER['SERVER_SOFTWARE'])) ? gTxt('diag_web_server').cs.$_SERVER['SERVER_SOFTWARE'].n : '',
(is_callable('apache_get_version')) ? gTxt('diag_apache_version').cs.@apache_get_version().n : '',
@@ -647,7 +650,7 @@ function doDiagnostics()
$out[] = n.gTxt('diag_db_charset').cs.$DB->default_charset.'/'.$DB->charset.n;
$result = safe_query("SHOW variables LIKE 'character_se%'");
$result = safe_query("SHOW variables WHERE Variable_name LIKE 'character_se%' OR Variable_name LIKE 'collation%'");
while ($row = mysqli_fetch_row($result)) {
$out[] = $row[0].cs.$row[1].n;
View
@@ -73,6 +73,7 @@ diag_gd_library="GD Graphics Library"
diag_gmtoffset="Time zone (GMT offset in seconds)"
diag_htaccess_contents=".htaccess file contents"
diag_is_dst="Daylight Saving Time enabled?"
diag_languages="Site / Admin language: {site_lang} / {admin_lang}."
diag_last_update="Last update"
diag_last_update_check="Last update check"
diag_locale="Locale"

1 comment on commit 977c59c

@petecooper

This comment has been minimized.

Show comment
Hide comment
@petecooper

petecooper Jun 22, 2018

Member

Nice one @Bloke - thanks very much!

Member

petecooper commented on 977c59c Jun 22, 2018

Nice one @Bloke - thanks very much!

Please sign in to comment.