OJS OCS OMP OHS

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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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()) {
$article->setTitle($node->getValue());
} elseif ($locale == $journal->getSetting('alternateLocale1')) {
$article->setTitleAlt1($node->getValue());

What do you think about that?

Cheers,

Marc
Marc
 
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.

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


Return to OJS Technical Support

Who is online

Users browsing this forum: GeorgeBiology and 3 guests