Turkish Local problem

Hi,

I’ve installed OJS system but there are some errors…

Firstly, there is a blank white page. Checked error_log file inside;

[24-Apr-2021 00:37:10 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:37:20 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesindexSite.tp"  on line 11 "{include file="frontend/components/header.tpl"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:37:29 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesindexSite.tp"  on line 11 "{include file="frontend/components/header.tpl"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:37:34 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:37:42 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:45:46 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:45:52 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:47:07 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:47:11 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 00:48:00 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:frontendpagesuserLogin.tp"  on line 11 "{include file="frontend/components/header.tpl" pageTitle="user.login"}" unknown tag 'include' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 11
[24-Apr-2021 01:05:11 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:adminindex.tpl"  on line 18 "{if $newVersionAvailable}" unknown tag 'if' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 18
[24-Apr-2021 01:05:21 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:adminindex.tpl"  on line 18 "{if $newVersionAvailable}" unknown tag 'if' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 18
[24-Apr-2021 01:05:26 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:admincontexts.tpl"  on line 14 "{if $newVersionAvailable}" unknown tag 'if' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 14
[24-Apr-2021 01:05:31 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:adminindex.tpl"  on line 18 "{if $newVersionAvailable}" unknown tag 'if' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 18
[24-Apr-2021 01:20:47 Europe/Istanbul] PHP Fatal error:  Uncaught  --> Smarty Compiler: Syntax error in template "app:app:admincontexts.tpl"  on line 14 "{if $newVersionAvailable}" unknown tag 'if' <-- 
  thrown in /home/tadgentr/dergi.tad.gen.tr/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 14

I searched the forum and realized that this error is related to Turkish. How can I fix?

I fixed.

Find in lib/pkp/classes/i18n/PKPLocale.inc.php;

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

		// Use defaults if locale info unspecified.
		$locale = AppLocale::getLocale();
		setlocale(LC_ALL, $locale . '.' . LOCALE_ENCODING, $locale);
		putenv("LC_ALL=$locale");

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

		// 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);

			switch(Config::getVar('database', 'driver')) {
				case 'mysql':
				case 'mysqli':
					Capsule::statement('SET time_zone = \''.$offset.'\'');
					break;
				case 'postgres':
				case 'postgres64':
				case 'postgres7':
				case 'postgres8':
				case 'postgres9':
					Capsule::statement('SET TIME ZONE INTERVAL \''.$offset.'\' HOUR TO MINUTE');
					break;
				default: assert(false);
			}
		}
	}

change with below;

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

		// Use defaults if locale info unspecified.
		$locale = AppLocale::getLocale();
		setlocale(LC_ALL, $locale . '.' . LOCALE_ENCODING, $locale);
		putenv("LC_ALL=$locale");

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

		// 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);

			switch(Config::getVar('database', 'driver')) {
				case 'mysql':
				case 'mysqli':
					Capsule::statement('SET time_zone = \''.$offset.'\'');
					break;
				case 'postgres':
				case 'postgres64':
				case 'postgres7':
				case 'postgres8':
				case 'postgres9':
					Capsule::statement('SET TIME ZONE INTERVAL \''.$offset.'\' HOUR TO MINUTE');
					break;
				default: assert(false);
			}
		}
      
        if ($locale == 'tr_TR') setlocale(LC_CTYPE, 'en_US');
	}

Yes, it was fixed years ago…

Hi all,

I think this is still an open problem in the Smarty library we use:

I’ve proposed a fix a while ago but have not had any feedback.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
I have tested it a few weeks ago. I think the OJS version was 3.3.0.3.
Unfortunately, I faced some kind of errors including blank white page after a successfull install. Without modifiying PKPLocale.inc.php, unfortunately, the Turkish locale interface didn’t work properly. So, I make that change as the last step of git install.
I might test that fix again in a few days on a clean install. I did apply PKPLocale.inc.php modification on all current test sites during installation. So, I need to test it on a clean install.
Regards,

Blank page problem still continues at last version of OJS. I solved it but why do people have to face this problem? Why is the software developer team not fixing this error? This error has existed for a long time, as I understand. It’s really weird…

The problem belongs to PHP, not OJS. So, all software developers working with Turkish locale face to this problem.

Are you sure? I use Wordpress and OsCommerce (with Turkish locale) for ten years and I never faced kind of that error.

This topic was automatically closed after 25 hours. New replies are no longer allowed.