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

Translate metadata in Letter component

parent 67f1def1
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<v-card-text> <v-card-text>
<ul style="list-style-type:none;"> <ul style="list-style-type:none;">
<li v-for="(value, key) in letter.teiHeader.fileDesc.titleStmt"> <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> </li>
</ul> </ul>
</v-card-text> </v-card-text>
...@@ -89,7 +89,17 @@ export default { ...@@ -89,7 +89,17 @@ export default {
letter: null, letter: null,
images: [], images: [],
showComments: true, showComments: true,
features: [] features: [],
metadataTranslations: {
title: 'titre',
collection: 'collection',
author: 'auteur(e)',
recipient: 'destinataire',
gender: 'sex',
date: 'date',
place: 'lieur',
stamp: 'tampon'
}
} }
}, },
methods: { methods: {
...@@ -104,6 +114,14 @@ export default { ...@@ -104,6 +114,14 @@ export default {
} }
return text 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 (word) {
// Capitalize first letter of a String // Capitalize first letter of a String
return word.charAt(0).toUpperCase() + word.slice(1) 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