Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Opolka
vue-cdbp
Commits
2f044c37
Commit
2f044c37
authored
Dec 19, 2018
by
Markus Opolka
Browse files
Translate metadata in Letter component
parent
67f1def1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/Letter.vue
View file @
2f044c37
...
...
@@ -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
)
...
...
Markus Opolka
@bi40resu
mentioned in issue
#20 (closed)
·
Dec 19, 2018
mentioned in issue
#20 (closed)
mentioned in issue #20
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment