Commit 2f044c37 authored by Markus Opolka's avatar Markus Opolka
Browse files

Translate metadata in Letter component

parent 67f1def1
......@@ -13,7 +13,7 @@
<v-card-text>
<ul style="list-style-type:none;">
<li v-for="(value, key) in letter.teiHeader.fileDesc.titleStmt">
<span class="body-2">{{ capitalize(key) }}:</span> {{ value._text }}
<span class="body-2">{{ capitalize(toFrench(key)) }}:</span> {{ value._text }}
</li>
</ul>
</v-card-text>
......@@ -89,7 +89,17 @@ export default {
letter: null,
images: [],
showComments: true,
features: []
features: [],
metadataTranslations: {
title: 'titre',
collection: 'collection',
author: 'auteur(e)',
recipient: 'destinataire',
gender: 'sex',
date: 'date',
place: 'lieur',
stamp: 'tampon'
}
}
},
methods: {
......@@ -104,6 +114,14 @@ export default {
}
return text
},
toFrench (word) {
// Translate some metadata keys to French
if (word in this.metadataTranslations) {
return this.metadataTranslations[word]
} else {
return word
}
},
capitalize (word) {
// Capitalize first letter of a String
return word.charAt(0).toUpperCase() + word.slice(1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment