Multiple languages in ojs3.2

Hello all,
I tried to check new version of OJS, and have the following problem.

  1. I downloaded the tarblall from your site
  2. I created new database
  3. I fixed file permissions as always
  4. I loaded the default page. All conditions are satisfied.
  5. I did the basic configuration, but added one more language (Ukrainian)
  6. I started the install process.
    Result:

DB Error: Incorrect string value: '\xD0\x9D\xD0\xBE\xD0\xB2...' for column 'subject' at row 1 Query: INSERT INTO email_templates_default_data (email_key, locale, subject, body, description) VALUES ('NOTIFICATION', 'uk_UA', 'Нове повідомлення від сайту {$siteTitle}', 'Ви маєте нове повідомлення від сайту {$siteTitle}:<br />\n<br />\n{$notificationContents}<br />\n<br />\nПосилання: {$url}<br />\n<br />\n{$principalContactSignature}', 'Цей лист надсилається зареєстрованому користувачу, який обрав опцію отримання повідомлень цього типу електронною поштою.')

  1. OK, I changed “Installed” to “off” in the config, recreated the database, and restarted the install process with English only. All went smoothly.
  2. I created a new journal, and (as expected) have only one language available. What is bad, that I do not see any kind of option like “Add another language” (which was possible in 3.1)

Did the same with the latest git version, the result is the same.

Any ideas?

Update:

  1. On the Administration page, the site configuration page link is missing.
  2. I manually pointed to /index.php/index/admin/settings and here, I see the Intall Locale option.
    However, an attempt to install Ukrainian locale failed with the same error (visible in the logfile only)
  3. I tried different locales, and noticed that the following 13 locales produce errors on install:
  •  Čeština
  •  Français (Canada)
  •  Hrvatski
  •  Język Polski
  •  Русский
  •  Slovenščina
  •  Cрпски
  •  Srpski
  •  Türkçe
  •  Українська
  •  简体中文
  •  العربية
  •  فارسی

Hi @Vasyl_Ostrovskyi,

Is your database created with a UTF-8 character set?

Regards,
Alec Smecher
Public Knowledge Project Team

Try once again. Recreate the database, see what we have

sudo mysqldump ojs32 
-- MySQL dump 10.13  Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost    Database: ojs32
-- ------------------------------------------------------
-- Server version	5.7.29-0ubuntu0.18.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2020-03-13 19:08:1234: 

Looks OK. Run the installer.
Unlike 3.1., in 3.2 there is no option “database chareset” available. Select single default locale and choose MYSQLI driver.
Ups!

-- MySQL dump 10.13  Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost    Database: ojs32
-- ------------------------------------------------------
-- Server version	5.7.29-0ubuntu0.18.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `access_keys`
--

DROP TABLE IF EXISTS `access_keys`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `access_keys` (
  `access_key_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context` varchar(40) NOT NULL,
  `key_hash` varchar(40) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `assoc_id` bigint(20) DEFAULT NULL,
  `expiry_date` datetime NOT NULL,
  PRIMARY KEY (`access_key_id`),
  KEY `access_keys_hash` (`key_hash`,`user_id`,`context`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

Notice DEFAULT CHARSET=latin1; Repeat the same with 3.1, and get ... DEFAULT CHARSET=utf8;
Looks like a bug

Hi @Vasyl_Ostrovskyi,

Could you try creating the database using…

CREATE DATABASE my_database_name DEFAULT CHARACTER SET utf8;

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, it worked!

But still, on the Administration page, the site configuration page link is missing.
But this is another question

Regards,
Vasyl

1 Like

Can you be more specific for less coding experienced people?

Hi @jonovski,

How are you creating your database? Using MySQLAdmin, or the MySQL command line, or something else?

Regards,
Alec Smecher
Public Knowledge Project Team

I have being using OJS for two years and have 3 issues there. While putting the 4rth i saw the ??? problem so i di not post the 4th issue. Therefore I decided to translate OJS in the Macedonian language, And I translated everything that was on the translation site. I do not know how to do the rest of translation when it does not appear on the translation site.

Back to My SQL, I never created this, it was done by installation, I guess. I see on my CPanel there is an option for creating MySQL.

Hi @jonovski,

Regarding the content in Weblate that needs translation, have you seen the Translation Guide?

For creating the database: you must’ve done this somehow, as creating a database is a prerequisite for the installation process. The problem that’s causing the ??? characters is likely that your database was created with the wrong character set, or that your character set configuration accidentally got changed in config.inc.php during the upgrade process. When upgrading, make sure you don’t change the character set configuration in config.inc.php (unless you are also transcoding your database). When you create your database, make sure you create it with a UTF-8 character set unless you’re really sure you need something else.

Now that you’ve run an upgrade and run into trouble, you’ll need to restore your database from the backup you took when you began the upgrade process. That’ll involve deleting the database, creating a fresh empty one, and then loading the backup file into it. When you create the database, that’s when you need to make sure you specify UTF-8.

Regards,
Alec Smecher
Public Knowledge Project Team

The OSJ was installed from CPanel using SOFTACOULOUS APP INSTALER, so I di not create any database myself.

I open the config.inc.php of the updated version, and there it state utf-8.

BTW where to find the MySQL database to delete?

I seen the Translation Guide.

It says that I should open an account and specify that I would like to start new translation. Do I need to open another account for translating Common Plugins and PKP Web Application Library?

Hi @jonovski,

No, the same Weblate account should work for translating all parts of the application-- but I think what’s probably missing from your translation is the PKP Web Application Library parts. I’d suggest reviewing those to make sure they’re translated as well.

I haven’t used the Softaculous installer, and we don’t maintain it, so unfortunately I can’t give you much advice there. I suspect it creates the database, and I wonder if it’s missing the specification of a character set, thus depending on the MySQL server’s default character set, which I’m guessing might be Latin1. You can check by running the following MySQL query from the MySQL documentation (using phpMyAdmin or whatever client your server offers):

SELECT @@character_set_database, @@collation_database;

Regards,
Alec Smecher
Public Knowledge Project Team

Hi there,

I checked the Weblate and the PKP Web Application library and Common Plugins are not available for translation in Macedonian. What to do?

What would be a installation from scratch, not using Softaculous installer?

Hi @jonovski,

You can create a translation for each component in each of these – you’ll just need to make sure you sign the CLA first, and then look on the bottom of the page for a button to create the new translation. (The CLA process is a bit cumbersome – unfortunately we haven’t found a way to make the signing effective for everything globally.)

Regards,
Alec Smecher
Public Knowledge Project Team

what is CLA? can you please be more specific with your answers?

Hi @jonovski,

CLA stands for Contributor License Agreement. You should see a button at the top of the page when viewing a potential component to translate:

image
(“View contributor agreement”)

Once you sign the agreement, you should see a button at the bottom of the page labelled “Start New Translation”:
image

Regards,
Alec Smecher
Public Knowledge Project Team

CLA opens only when i am in OJS, (which is already translated) when switching to PKP Web… it is not there.

Hi @jonovski,

Is the “Start new translation” button not showing at the bottom? (Maybe PM me a complete screenshot of the screen you’re seeing?)

Regards,
Alec Smecher
Public Knowledge Project Team