by 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