Mass-copy issues into new language

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 10
Joined: Fri Mar 25, 2011 5:58 am

Mass-copy issues into new language

Postby mirkh » Thu Apr 07, 2011 2:11 am

Several of our journals have been started in a faulty way. They are Swedish journals, but the swedish text has been entered as English (default). This could perhaps be because the Swedish language code was wrong in older versions.

Is there a tool / script / SQL query to copy everything in one journal into a new language (from English to Swedish)? This would at least make the Swedish version of the journals correct.

I think I posted a similar reply in one of the topics of Technical support, but it kind of disappeared.

Posts: 2
Joined: Mon May 09, 2011 1:13 am

Re: Mass-copy issues into new language

Postby MikeG » Mon May 09, 2011 1:21 am

I'm bumping this topic.

Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Mass-copy issues into new language

Postby asmecher » Mon May 09, 2011 2:25 am

Hi all,

Sorry for the delay in responding; this thread looks like it slipped through the cracks. You can find almost all language codes in the various "locale" columns of the database (see the schema descriptors referenced in dbscripts/xml/install.xml for the OJS schema). You can update those columns e.g. from en_US to fr_CA to change the designation of existing content from English to French. For Article settings, i.e. titles, abstracts, and other multilingual content associated with articles, that would be:

Code: Select all

UPDATE article_settings SET locale = 'fr_CA' WHERE locale = 'en_US';
Note that there is a unique index on article_id, setting_name, and locale, meaning that if you already have e.g. French abstracts entered somewhere, the update will fail on a duplication error and you'll have to resolve those first.

The above example is for article data, such as abstracts and titles; journal-level metadata (titles, etc.) are in journal_settings, issue-level metadata is in issue_settings, etc.

The only exception to this pattern is some of the journal settings that are structured as objects. You can find these with the following query:

Code: Select all

SELECT * FROM journal_settings WHERE setting_type = 'object';
Look for language codes (e.g. en_US) in those and replace them as needed.

You may have to flush your caches after updating these settings (e.g. for journal-level settings) before the changes will be reflected in the application. The easiest way to do that is to remove all .php (and possibly .html) files from the cache/ subdirectory.

Alec Smecher
Public Knowledge Project Team

Return to “OJS Editorial Support and Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest