"Failed Ajax request or invalid JSON returned" errors on Turkish backend

Hi @asmecher
I am grateful to you, and give my heartfelt thanks.
I want to write what I did, because some other users may benefit.
Again I am not sure if it is at correct place, I changed relevant page and the errors have gone.
The final state of initialize function in lib/pkp/classes/i18n/PKPLocale.inc.php is;

	static function initialize($request) {
		self::$request = $request;

		// Use defaults if locale info unspecified.
		$locale = AppLocale::getLocale();

		$sysLocale = $locale . '.' . LOCALE_ENCODING;
		if (!@setlocale(LC_ALL, $sysLocale, $locale)) {
			// For PHP < 4.3.0
			if(setlocale(LC_ALL, $sysLocale) != $sysLocale) {
				setlocale(LC_ALL, $locale);
			}
		}

		AppLocale::registerLocaleFile($locale, "lib/pkp/locale/$locale/common.xml");

		// Set site time zone
		// Starting from PHP 5.3.0 PHP will throw an E_WARNING if the default
		// time zone is not set and date/time functions are used
		// http://pl.php.net/manual/en/function.date-default-timezone-set.php
		$timeZone = self::getTimeZone();
		date_default_timezone_set($timeZone);

		if (Config::getVar('general', 'installed')) {
			// Set the time zone for DB
			// Get the offset from UTC
			$now = new DateTime();
			$mins = $now->getOffset() / 60;
			$sgn = ($mins < 0 ? -1 : 1);
			$mins = abs($mins);
			$hrs = floor($mins / 60);
			$mins -= $hrs * 60;
			$offset = sprintf('%+d:%02d', $hrs*$sgn, $mins);

			$conn = DBConnection::getInstance();
			$dbconn =& $conn->getDBConn();
			switch($conn->getDriver()) {
				case 'mysql':
				case 'mysqli':
					$dbconn->execute('SET time_zone = \''.$offset.'\'');
					break;
				case 'postgres':
					$dbconn->execute('SET TIME ZONE INTERVAL \''.$offset.'\' HOUR TO MINUTE');
					break;
				default: assert(false);
			}
		}
				if ($locale == 'tr_TR') setlocale(LC_CTYPE, 'en_US');
	}

That change solved some other problems too. I had read these problems in other topics of the forum.
In Turkish backend, that issues were solved

  • The past and future issues are displayed now,
  • More information (in list of submissions), review details, submission metadata, editorial history, editorial decision links and other work now.
  • Thus, I can use Turkish email templates too.

Best Regards,
Ugur Kocak