You are viewing the PKP Support Forum | PKP Home Wiki

Native imp/exp plugin error importing w/ alternative locale

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

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.

Native imp/exp plugin error importing w/ alternative locale

Postby Marc » Wed Mar 22, 2006 11:06 am

Hi all,

We have found a little problem using the native import/export plugin with more than language.

We have locales in ca_ES, es_ES, en_US, and our primary locale is Catalan (alternatives are es_ES and en_US).

When we try to import an article with the title in Catalan, but using the English interface, the plugin return this error:

Import Error

One or more errors occurred during import. Please check to ensure that the format of the import file correctly matches the specification. Specific details of the import errors are listed below.

* An article title ("CatalanTitle") was provided for the issue "Year: 2006 Vol.: 1 Núm.: 57" in a locale ("ca_ES") that this journal does not support.

Searching into the code source, I have found the comparison with the accepted locales is with the alternates and with de current locale (en_US in the example). Therefore, the ca_ES is not recognized and the error appears.

Doing this little change in the source that works for me:

--- NativeImportDom.inc.php.22032006 2006-03-22 18:44:49.987055632 +0100
+++ NativeImportDom.inc.php 2006-03-22 18:57:51.107307304 +0100
@@ -396,7 +396,7 @@

for ($index=0; ($node = $articleNode->getChildByName('title', $index)); $index++) {
$locale = $node->getAttribute('locale');
- if ($locale == '' || $locale == Locale::getLocale()) {
+ if ($locale == '' || $locale == Locale::getPrimaryLocale()) {
} elseif ($locale == $journal->getSetting('alternateLocale1')) {

What do you think about that?


Posts: 34
Joined: Thu Jul 07, 2005 5:16 am
Location: Barcelona

Postby asmecher » Wed Mar 22, 2006 12:23 pm

Hi Marc,

See http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=2120 for a patch for this; I'd suggest comparing against $journal->getLocale() rather than Locale::getPrimaryLocale(), and you'll also need to apply this fix to the abstracts a few lines further down. Thanks for the note; this will be corrected in the next release of OJS.

Alec Smecher
Open Journal Systems Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Technical Support

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 2 guests