Case Studies

OJS 3.5.0-5 Installation Error: Fixing Smarty “Unknown Tag translate”

The OJS 3.5.0-5 “unknown tag 'translate'” Smarty error can occur when OJS is running on PHP 8.4. In this case, the official OJS package, Smarty vendor files, and permissions were correct. Changing PHP from 8.4 to 8.3 resolved the installation error. The OJS install.tpl template and Smarty files did not need to be modified.

The Issue

During a fresh installation of Open Journal Systems (OJS) 3.5.0-5, the installation stopped with the following fatal error:

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template"app:install/install.tpl" on line 16"{translate key="installer.appInstallation"}"unknown tag 'translate'<-- thrown in app:install/install.tpl on line 16

Because the error mentioned Smarty and the {translate} tag, the initial suspicion was a missing Smarty component, damaged template, or incorrect file permissions.

Environment

ComponentConfigurationApplicationOpen Journal Systems 3.5.0-5InstallationFresh OJS installationOJS packageOfficial release packageSmarty vendor directoryPresentFile permissionsCorrectInitial PHP versionPHP 8.4Working PHP versionPHP 8.3

What We Checked

We first verified the OJS installation files and confirmed that the bundled Smarty vendor directory was present. File permissions were also correct.

The {translate} tag in install/install.tpl was valid OJS template syntax, so modifying the template was not the appropriate solution.

The next critical check was the PHP runtime.

The Root Cause

The server was running PHP 8.4.

PKP has documented an OJS 3.5.0-5 compatibility issue involving PHP 8.4 and the locale initialization process. OJS passes a large list of language tags to PHP's Locale::lookup(). In the documented case, the list contains 799 language entries.

Under PHP 8.3, the diagnostic returned an empty string. Under PHP 8.4, it returned NULL. That value could then reach Locale::setDefault(), which expects a string and throws a TypeError.

PKP records the resulting failure as preventing the default theme from being initialized correctly. This explains why an apparently unrelated Smarty template error can appear during OJS startup. PKP Issue #13139.

The Fix

We changed the PHP version used by the OJS website from:

PHP 8.4

to:

PHP 8.3

After changing the PHP runtime, the OJS installation proceeded normally.

No changes were made to:

  1. install/install.tpl
  2. OJS translation files
  3. Smarty vendor files

Before and After

ConfigurationResultOJS 3.5.0-5 + PHP 8.4Fatal Smarty “unknown tag 'translate'” errorOJS 3.5.0-5 + PHP 8.3Installation completed successfully

Why This Error Is Misleading

The important lesson is that the final Smarty error was a symptom rather than the underlying problem.

When OJS fails during application initialization, a failure in localization or plugin/theme initialization can surface later as a template compilation error.

Therefore, when a standard OJS template suddenly reports an unknown built-in tag, check the complete PHP/OJS environment before editing the template.

  1. Confirm the exact OJS version.
  2. Confirm the PHP version actually used by the website.
  3. Verify required PHP extensions, especially intl.
  4. Verify that the official OJS package is complete.
  5. Check filesystem permissions.
  6. Clear OJS compiled-template/cache directories.
  7. Review the PHP/OJS error log for the underlying exception.
  8. Compare the OJS/PHP combination against known PKP compatibility issues.

Conclusion

The OJS 3.5.0-5 installation was failing with:

Smarty Compiler: unknown tag 'translate'

The OJS package and Smarty files were intact, and permissions were correct. The decisive difference was the PHP runtime.

Changing PHP 8.4 to PHP 8.3 resolved the problem without modifying OJS core files.

PKP has subsequently documented the underlying PHP 8.4 locale-related issue and associated the fix with the OJS/PKP 3.5.0-6 development milestone. See PKP Issue #13139.

Key takeaway: If OJS 3.5.0-5 reports a Smarty unknown tag 'translate' error during installation while the official files and permissions are correct, check the PHP version before changing the OJS template.

Frequently Asked Questions

What causes the OJS “unknown tag translate” error?

For the OJS 3.5.0-5/PHP 8.4 compatibility issue documented by PKP, a failure in locale initialization can prevent the normal OJS theme and template environment from being initialized.

Is the OJS install.tpl file broken?

Not necessarily. The {translate} tag is valid OJS template syntax. The runtime environment should be investigated before modifying the template.

Does OJS 3.5.0-5 work with PHP 8.3?

Yes. In this case study, changing the website from PHP 8.4 to PHP 8.3 resolved the installation failure.

Should Smarty be reinstalled?

No. If the official OJS package contains the expected Smarty vendor files, manually replacing Smarty can introduce a version mismatch.

What PHP version should I use for OJS 3.5.0-5?

For this specific OJS 3.5.0-5 issue, PHP 8.3 is the practical working configuration demonstrated by this case. Always verify the PHP/OJS combination against the current PKP requirements and release-specific compatibility information.

Was this caused by incorrect file permissions?

No. In this case, permissions were verified as correct. The problem was resolved by changing the PHP runtime.


Frequently Asked Questions

Common OJS problems include installation errors, database connection failures, PHP compatibility issues, HTTP 500 errors, Smarty/template errors, file-permission problems, upgrade failures, email delivery problems, missing PHP extensions, and cache-related issues. The exact cause depends on the OJS version, PHP version, database server, web server, configuration, and the specific error shown in the logs.

An OJS HTTP 500 error generally means that PHP encountered an unrecoverable application or configuration error. Common causes include: Incompatible PHP version Missing PHP extension Incorrect file permissions Incompatible or outdated plugin OJS/PKP library mismatch Database or migration error Invalid server configuration PHP memory or execution limits The most useful diagnostic information is the PHP error log, rather than the generic “500 Internal Server Error” displayed in the browser.

Ready to talk about OJS 3.5.0-5 Installation Error: Fixing Smarty “Unknown Tag translate”?

Contact Us Request a Quote