aboutsummaryrefslogtreecommitdiff
path: root/mediawiki.lrdevplugin
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2014-08-24 03:39:30 +0200
committerRobin Krahl <me@robin-krahl.de>2014-08-24 03:39:30 +0200
commitac5c99847112d207508acb3c08605f219916c7e6 (patch)
tree82e06ce5c3728f0bd09642f97f99fa54de3fbd34 /mediawiki.lrdevplugin
parent53cb610bdcbd32a417a58890061b36b2f2f9ea6a (diff)
downloadLrMediaWiki-ac5c99847112d207508acb3c08605f219916c7e6.tar.gz
LrMediaWiki-ac5c99847112d207508acb3c08605f219916c7e6.tar.bz2
Fix #7: Move file description to plugin metadata.
Diffstat (limited to 'mediawiki.lrdevplugin')
-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