Translate static strings
We should provide a way to translate static content along with the data coming from ldp servers. This includes:
- texts from the HTML. ie:
<h1>My Title</h1>
- texts included in components. ie:
<sib-display data-src='...' fields='customField, ...' value-customField='Whatever text' ></sib-display>
Proposed spec (WIP):
A sib-translations
component will load jsonld content, and replace all the keys found in a page by the corresponding texts.
<sib-translations data-src="texts.json" />
<sib-display
data-src='...'
fields='customField, ...'
value-customField='app.customField'
></sib-display>
// texts.json
{
"fr": {
"app.customField": "Je suis un champs personnalisé"
},
"en": {
"app.customField": "I'm a custom field"
}
}
Questions:
- we need to find an optimized way to scan text content
- we should not override texts not meant to be translated