You are viewing the PKP Support Forum | PKP Home Wiki

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
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

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: 10
Joined: Fri Mar 25, 2011 5:58 am

Re: Mass-copy issues into new language

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

I'm bumping this topic.
Posts: 2
Joined: Mon May 09, 2011 1:13 am

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
Posts: 9936
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 3 guests