@@ -209,6 +209,7 @@ public function monographFileView($hookName, $args)
209
209
$ press = $ request ->getContext ();
210
210
211
211
$ publicationLocale = $ publication ->getData ('locale ' );
212
+ $ publicationFormatLocale = $ publicationFormat ->getData ('locale ' );
212
213
$ submissionBestId = strlen ($ urlPath = (string ) $ publication ->getData ('urlPath ' )) ? $ urlPath : $ monograph ->getId ();
213
214
214
215
$ templateMgr = TemplateManager::getManager ($ request );
@@ -235,7 +236,11 @@ public function monographFileView($hookName, $args)
235
236
236
237
$ authors = $ chapter ? $ chapter ->getAuthors ()->toArray () : $ publication ->getData ('authors ' );
237
238
foreach ($ authors as $ i => $ author ) {
238
- $ templateMgr ->addHeader ('dublinCoreAuthor ' . $ i ++, '<meta name="DC.Creator.PersonalName" content=" ' . htmlspecialchars ($ author ->getFullName (false , false , $ publicationLocale )) . '"/> ' );
239
+ $ authorPreferedLocale = $ publicationFormatLocale ;
240
+ if (!$ author ->getGivenName ($ authorPreferedLocale )) {
241
+ $ authorPreferedLocale = $ publicationLocale ;
242
+ }
243
+ $ templateMgr ->addHeader ('dublinCoreAuthor ' . $ i ++, '<meta name="DC.Creator.PersonalName" content=" ' . htmlspecialchars ($ author ->getFullName (false , false , $ authorPreferedLocale )) . '"/> ' );
239
244
}
240
245
241
246
$ datePublished = $ chapter
@@ -278,9 +283,13 @@ public function monographFileView($hookName, $args)
278
283
279
284
$ templateMgr ->addHeader ('dublinCoreUri ' , '<meta name="DC.Identifier.URI" content=" ' . $ request ->getDispatcher ()->url ($ request , Application::ROUTE_PAGE , null , 'catalog ' , 'book ' , [$ submissionBestId , $ publicationFormat ->getId (), $ submissionFile ->getId ()], urlLocaleForPage: '' ) . '"/> ' );
280
285
281
- $ templateMgr ->addHeader ('dublinCoreLanguage ' , '<meta name="DC.Language" scheme="ISO639-1" content=" ' . str_replace (['_ ' , '@ ' ], '- ' , $ publicationLocale ) . '"/> ' );
286
+ $ templateMgr ->addHeader ('dublinCoreLanguage ' , '<meta name="DC.Language" scheme="ISO639-1" content=" ' . str_replace (['_ ' , '@ ' ], '- ' , $ publicationFormatLocale ) . '"/> ' );
282
287
283
- if (($ copyrightHolder = $ publication ->getData ('copyrightHolder ' , $ publicationLocale )) && ($ copyrightYear = $ publication ->getData ('copyrightYear ' ))) {
288
+ $ copyrightHolderPreferedLocale = $ publicationFormatLocale ;
289
+ if (!$ publication ->getData ('copyrightHolder ' , $ copyrightHolderPreferedLocale )) {
290
+ $ copyrightHolderPreferedLocale = $ publicationLocale ;
291
+ }
292
+ if (($ copyrightHolder = $ publication ->getData ('copyrightHolder ' , $ copyrightHolderPreferedLocale )) && ($ copyrightYear = $ publication ->getData ('copyrightYear ' ))) {
284
293
$ templateMgr ->addHeader ('dublinCoreCopyright ' , '<meta name="DC.Rights" content=" ' . htmlspecialchars (__ ('submission.copyrightStatement ' , ['copyrightHolder ' => $ copyrightHolder , 'copyrightYear ' => $ copyrightYear ])) . '"/> ' );
285
294
}
286
295
if ($ licenseURL = $ publication ->getData ('licenseUrl ' )) {
@@ -309,12 +318,16 @@ public function monographFileView($hookName, $args)
309
318
}
310
319
}
311
320
312
-
313
- $ title = $ chapter ? $ chapter ->getLocalizedFullTitle ($ publicationLocale ) : $ publication ->getLocalizedFullTitle ($ publicationLocale );
321
+ $ titlePreferredLocale = $ publicationFormatLocale ;
322
+ $ titleTmp = $ chapter ? $ chapter ->getDate ('title ' , $ titlePreferredLocale ) : $ publication ->getData ('title ' , $ titlePreferredLocale );
323
+ if (!$ titleTmp ) {
324
+ $ titlePreferredLocale = $ publicationLocale ;
325
+ }
326
+ $ title = $ chapter ? $ chapter ->getLocalizedFullTitle ($ titlePreferredLocale ) : $ publication ->getLocalizedFullTitle ($ titlePreferredLocale );
314
327
$ templateMgr ->addHeader ('dublinCoreTitle ' , '<meta name="DC.Title" content=" ' . htmlspecialchars ($ title ) . '"/> ' );
315
328
$ titles = $ chapter ? $ chapter ->getFullTitles () : $ publication ->getFullTitles ();
316
329
foreach ($ titles as $ locale => $ altTitle ) {
317
- if ($ title != '' && $ locale != $ publicationLocale ) {
330
+ if ($ title != '' && $ locale != $ titlePreferredLocale ) {
318
331
$ templateMgr ->addHeader ('dublinCoreAltTitle ' . $ locale , '<meta name="DC.Title.Alternative" xml:lang=" ' . htmlspecialchars (str_replace (['_ ' , '@ ' ], '- ' , $ locale )) . '" content=" ' . htmlspecialchars ($ altTitle ) . '"/> ' );
319
332
}
320
333
}
0 commit comments