aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua14
-rw-r--r--mediawiki.lrdevplugin/MediaWikiMetadataProvider.lua17
2 files changed, 29 insertions, 2 deletions
diff --git a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
index 9b4fa96..ff27185 100755
--- a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
+++ b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
@@ -70,7 +70,19 @@ MediaWikiExportServiceProvider.processRenderedPhotos = function(functionContext,
local photo = rendition.photo
local fallbackDescription = exportSettings.fallback_description
- local description = photo:getFormattedMetadata('caption')
+ local descriptionEn = photo:getPropertyForPlugin(Info.LrToolkitIdentifier, 'description_en')
+ local descriptionDe = photo:getPropertyForPlugin(Info.LrToolkitIdentifier, 'description_de')
+ local descriptionAdditional = photo:getPropertyForPlugin(Info.LrToolkitIdentifier, 'description_additional')
+ local description = ''
+ if not isStringEmpty(descriptionEn) then
+ description = '{{en|1=' .. descriptionEn .. '}}\n'
+ end
+ if not isStringEmpty(descriptionDe) then
+ description = description .. '{{de|1=' .. descriptionDe .. '}}\n'
+ end
+ if not isStringEmpty(descriptionAdditional) then
+ description = description .. descriptionAdditional
+ end
if isStringEmpty(description) then
if fallbackDescription then
description = fallbackDescription
diff --git a/mediawiki.lrdevplugin/MediaWikiMetadataProvider.lua b/mediawiki.lrdevplugin/MediaWikiMetadataProvider.lua
index 72cdda2..2f1c89a 100644
--- a/mediawiki.lrdevplugin/MediaWikiMetadataProvider.lua
+++ b/mediawiki.lrdevplugin/MediaWikiMetadataProvider.lua
@@ -16,11 +16,26 @@
return {
metadataFieldsForPhotos = {
{
+ id = 'description_en',
+ title = LOC '$$$/LrMediaWiki/Metadata/DescriptionEn=Description (en)',
+ dataType = 'string',
+ },
+ {
+ id = 'description_de',
+ title = LOC '$$$/LrMediaWiki/Metadata/DescriptionDe=Description (de)',
+ dataType = 'string',
+ },
+ {
+ id = 'description_additional',
+ title = LOC '$$$/LrMediaWiki/Metadata/DescriptionAdditional=Description (other)',
+ dataType = 'string',
+ },
+ {
id = 'categories',
title = LOC '$$$/LrMediaWiki/Metadata/Categories=Categories',
dataType = 'string',
},
},
- schemaVersion = 1,
+ schemaVersion = 2,
} \ No newline at end of file