OJS 3.2.0.3 Install new language

I was trying to install new language, but when I go {administration->Site Settings->Languages->Install Local->chose one from available locals-> save}, I can only see a moving circle shows the loading status. Then I just stuck on this page. What should I do to resolve this?

Do I need to download the language pack even it shows on the Available Locals list? If the answer is yes, where is the pack. I checked PKP web site but still cannot find it.

HI @botshawn,

When you get an endless spinner, check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, I have the same problem. What specific errors to look for?

Hi @Y_H,

Are you using the same version? If not, what version are you using?

-Roger
PKP Team

Yes. I am using OJS 3.2.0.3. the same version.

Hi @Y_H,

If you copy and paste the error log output here we can try to help out. I can’t say for certain which part would be the most helpful, but if you’re able to see the log errors that correspond to the time at which you are trying to install a new locale, that might be the most helpful.

Best regards,

Roger
PKP Team

Here is the log:

[Thu Oct 14 03:44:37.545556 2021] [php7:warn] [pid 15559] [client 69.137.179.7:57406] PHP Warning: file_put_contents(/var/www/journal/ojs/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permission denied in /var/www/journal/ojs/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: Login
[Thu Oct 14 03:44:37.717263 2021] [php7:warn] [pid 15559] [client 69.137.179.7:57406] PHP Warning: file_put_contents(/var/www/journal/ojs/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permission denied in /var/www/journal/ojs/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: Login
[Thu Oct 14 03:44:54.800449 2021] [php7:warn] [pid 15558] [client 69.137.179.7:57409] PHP Warning: file_put_contents(/var/www/journal/ojs/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permission denied in /var/www/journal/ojs/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: Login
[Thu Oct 14 03:44:54.820932 2021] [php7:error] [pid 15558] [client 69.137.179.7:57409] PHP Fatal error: Uncaught Exception: DB Error: Incorrect string value: ‘\xE6\x9D\xA5\xE8\x87\xAA…’ for column ‘subject’ at row 1 Query: INSERT INTO email_templates_default_data\n\t\t\t\t\t\t(email_key, locale, subject, body, description)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t(‘NOTIFICATION’, ‘zh_CN’, ‘\xe6\x9d\xa5\xe8\x87\xaa{$siteTitle}\xe7\x9a\x84\xe6\x96\xb0\xe9\x80\x9a\xe7\x9f\xa5’, ‘\xe6\x82\xa8\xe6\x9c\x89\xe4\xb8\x80\xe6\x9d\xa1\xe6\x9d\xa5\xe8\x87\xaa{$siteTitle}\xe7\x9a\x84\xe6\x96\xb0\xe9\x80\x9a\xe7\x9f\xa5:
\n
\n{$notificationContents}
\n
\n\xe9\x93\xbe\xe6\x8e\xa5: {$url}
\n
\n{$principalContactSignature}’, ‘\xe8\xbf\x99\xe5\xb0\x81\xe7\x94\xb5\xe5\xad\x90\xe9\x82\xae\xe4\xbb\xb6\xe6\x98\xaf\xe5\x8f\x91\xe9\x80\x81\xe7\xbb\x99\xe9\x9c\x80\xe8\xa6\x81\xe8\xbf\x99\xe7\xa7\x8d\xe7\xb1\xbb\xe5\x9e\x8b\xe9\x80\x9a\xe7\x9f\xa5\xe7\x9a\x84\xe6\xb3\xa8\xe5\x86\x8c\xe7\x94\xa8\xe6\x88\xb7\xe3\x80\x82’) in /var/www/journal/ojs/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/journal/ojs/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), ‘INSERT INTO ema…’)\n#1 /var/www/journal/ojs/lib/pkp/classes/mail/EmailTemplateDAO.inc.php(270): DAO->update(‘INSERT INTO ema…’)\n#2 /var/www/journal/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php(414): EmailTemplateDAO->installEmailTemplateLocaleData(‘registry/emailT…’, Array)\n#3 /var/www/journal/ojs/lib/pkp/controller in /var/www/journal/ojs/lib/pkp/classes/db/DAO.inc.php on line 703, referer: Login

Line 90 of the file " FileCache.inc.php" is " '<?php return ’ . var_export($contents, true) . ‘;’,
LOCK_EX".

So seems DB error of email_key?? Why do we need email for setting up a locale?

Hi @Y_H,

Thanks for sharing your error message logs. I’m not sure what the issue might be but this may help to troubleshoot this issue further. I’ll see if some of my colleagues can help assist with this.

Best regards,

Roger
PKP Team

I checked the code and thought the problem. I tested to enter a mix of English and Chinese characters in metadata (title, abstract etc). Clicking a “save” button will not save any of the Chinese characters.

I had a similar case in a difference system. If the code, or the database is not set as “uff-8”, then characters not in “en_us” will not be saved.

Here is what the database setting now.
mysql> SHOW VARIABLES LIKE ‘char%’; SHOW VARIABLES LIKE ‘collation%’;
±-------------------------±---------------------------+
| Variable_name | Value |
±-------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
±-------------------------±---------------------------+

Here are the questions:

  1. The MySQL language setting by default is “en_us”. Shall it be “utf-8” for multiple languages ?
  2. PHP by default is set as “utf-8”, but “locale” is en_US. Will this be a problem ?
  3. Any OJS code not using “utf-8” ?