From dda68ee58725895fab40079505fa7060e4825c3d Mon Sep 17 00:00:00 2001 From: ajnyga Date: Fri, 5 Mar 2021 11:29:57 +0200 Subject: [PATCH] Use article locale as a default for file locale --- convert.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/convert.php b/convert.php index 185a571..745151b 100755 --- a/convert.php +++ b/convert.php @@ -239,6 +239,12 @@ $fileSeq = 0; for ($i = 1; $i <= $maxFiles; $i++) { + + if (empty($article['fileLocale'.$i])) { + $fileLocale = $articleLocale; + } else { + $fileLocale = $locales[trim($article['fileLocale'.$i])]; + } if (!preg_match("@^https?://@", $article['file'.$i]) && $article['file'.$i] != "") { @@ -274,7 +280,7 @@ # save galley data $galleys[$fileId] = "\t\t\t\t\r\n"; - $galleys[$fileId] .= "\t\t\t\t\t".$article['fileLabel'.$i]."\r\n"; + $galleys[$fileId] .= "\t\t\t\t\t".$article['fileLabel'.$i]."\r\n"; $galleys[$fileId] .= searchLocalisations('fileLabel'.$i, $article, 5, 'name'); $galleys[$fileId] .= "\t\t\t\t\t".$fileSeq."\r\n"; @@ -286,7 +292,7 @@ if (preg_match("@^https?://@", $article['file'.$i]) && $article['file'.$i] != "") { # save remote galley data $galleys[$fileId] = "\t\t\t\t\r\n"; - $galleys[$fileId] .= "\t\t\t\t\t".$article['fileLabel'.$i]."\r\n"; + $galleys[$fileId] .= "\t\t\t\t\t".$article['fileLabel'.$i]."\r\n"; $galleys[$fileId] .= searchLocalisations('fileLabel'.$i, $article, 5, 'name'); $galleys[$fileId] .= "\t\t\t\t\t".$fileSeq."\r\n"; $galleys[$fileId] .= "\t\t\t\t\t\r\n";