Closed ghost closed 5 years ago
Yes that wouldn't be too hard to do.
Now uses a page variable is_translated: false
.
The {{content}}
variable need to be wrapped with a container which set the lang
attribute, like:
<div lang="en">
<p>Need to be translated</p>
{{ content }}
</div>
Regarding the attribute is_translated
, we should use it in a way that if the page is written in the native language of the layout, then that properties should not required.
May be renaming like not_translated
or written_lang
and when it's value is null or false then that would mean the content of that page correspond to the language of the layout. And if that property is set on a page, then the language code (provided by the property) would wrap all the content of that page.
May be something like:
<main property="mainContentOfPage" class="container">
<h1 id="wb-cont" property="name">{{ page.title }}</h1>
{% include content-buttons-fr.html %}
{% if page.written_lang != false %}
<div class="alert alert-warning">
<p>Cette page n'est pas disponible en version française présentement.</p>
</div>
<div lang="{{ page.written_lang }}">
{% endif %}
{{ content }}
{% if page.written_lang != false %}
</div>
{% endif %}
Change made.
Addresses #369
Also following main wet-boew repo model add the French pages, but untranslated.