<h1>How the translation of the website is structured</h1>
<h2>Files involved</h2>
<p><strong>Default layout</strong></p>
<ul>
<li>/_layouts/default.html</li>
</ul>
<p><strong>Navbar</strong></p>
<ul>
<li>/_data/main_nav.yml</li>
<li>/_includes/main_nav.html</li>
</ul>
<p><strong>Footer</strong></p>
<ul>
<li>/_includes/footer.html</li>
</ul>
<p><strong>Homepage</strong></p>
<ul>
<li>/index.md</li>
<li>/_includes/homepage_content.html</li>
<li>/_includes/os_selector_options.html</li>
</ul>
<p><strong>Bisq DAO</strong></p>
<ul>
<li>/_data/dao_content.yml</li>
<li>/dao.html</li>
<li>/images/dao</li>
</ul>
<p><strong>Community</strong></p>
<ul>
<li>/community.md</li>
</ul>
<p><strong>Downloads</strong></p>
<ul>
<li>/downloads.html</li>
</ul>
<p><strong>FAQ</strong></p>
<ul>
<li>/faq.html</li>
</ul>
<p><strong>Markets</strong></p>
<ul>
<li>/markets.html</li>
</ul>
<p><strong>Statistics</strong></p>
<ul>
<li>/stats.html</li>
</ul>
<p><strong>Vision</strong></p>
<ul>
<li>/vision.md</li>
</ul>
<h2>The process of translation</h2>
<p>I chose to follow this method - sylvaindurand.org/making-jekyll-multilingual/</p>
<ol>
<li>A folder with the <a href="en.wikipedia.org/wiki/Language_localisation#Language_tags_and_codes">language code</a> is created at the root of the website. This folder will contain:</li>
</ol>
<ul>
<li>
<p>copy of the /images/dao folder with the images translated. I don't find necessary to rename the files. <a href="https://github.com/bisq-network/bisq-website/issues/196" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq-website/issues/196/hovercard">There's currently an issue rendering the translated images</a> and Steve (<a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=735155" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/m52go">@m52go</a>) is trying to solve it.</p>
</li>
<li>
<p>copy of the files, at the root of the website, that serve the pages to be translated:</p>
<ul>
<li>/community.md</li>
<li>/dao.html</li>
<li>/dowloads.html</li>
<li>/faq.html</li>
<li>/index.md</li>
<li>/markets.html</li>
<li>/stats.html</li>
<li>/vision.md</li>
</ul>
<p>The .md files are translated in whole through Transifex, with the exception of index.md. That file doesn't need to be translated and can be copied as it is with the correct front matter tags. The .html files are adapted to fetch translated strings from a single .yml file from the /_data folder.</p>
<pre><code>For the translated faq.html file, for example, a variable called 'item' would be defined,
linking to the faq section in the corresponding .yml file inside the /_data folder.
This variable can then be used through the document to fetch all the key strings.

{% assign item = site.data[page.lang].faq %}

Fetch a specific string
{{ item.hCoreFunctions }}
</code></pre>
<p>These files and their originals need to be connected through variables in their front matter:</p>
<ul>
<li>ref - filename</li>
<li>lang - language code</li>
<li>language - the language name written extensively (this is to be used in the language selector)</li>
</ul>
<pre><code>ref: index
lang: pt-PT
language: Português (PT)
</code></pre>
</li>
</ul>
<ol start="2">
<li>For the files inside the /_data folder (dao_content.yml and main_nav.yml) copies with an added "_tr" suffix will be made. These will include translated versions of all the strings of their respective originals. All translated languages will reside in a single file and will be separated in lists:</li>
</ol>
<pre><code>fr
     list:
       key:Translated string
pt-PT
     list:
       key:Translated string
</code></pre>
<p>A strings_en.yml containing all the strings in .html files to be translated will be placed here, along with its translated versions. The translated versions are simply named with its language code (pt-PT.yml).</p>
<ol start="3">
<li>
<p>For the files inside the /_includes folder (footer.html, homepage_content.html, main_nav and os_selector_options.html), copies with an added "_tr" suffix will be made. The strings to be translated in these files will be replaced with Liquid tags that will fetch the relevant strings to the current page's language form the /_data folder. The main_nav will include a Liquid function to create the language selector to allow to switch between the available translations of the current page.</p>
</li>
<li>
<p>The /_layouts/default.html file will include Liquid tags to include the correct main_nav, homepage_content and footer. The for loop that generates the pages needs to be updated with the language codes as new languages are added.</p>
</li>
</ol>
<h2>Transifex</h2>
<h3>Upload</h3>
<p>The original .md and .yml files will be uploaded to Transifex in whole while the relevant strings from .html files will be gathered into one single .yml file. The strings in images to be translated will gathered in one separate .yml file. So only the following files will be uploaded:</p>
<ul>
<li>community.md</li>
<li>_data/dao_content.yml</li>
<li>_data/main_nav.yml</li>
<li>vision.md</li>
<li>strings.yml</li>
<li>images.yml<br>
All of the "{{ site.url }}" Liquid tags in the strings.yml text have been replaced by "<a href="https://bisq.network" rel="nofollow">https://bisq.network</a>" as Transifex convertes the curly brackets into other characters.</li>
</ul>
<h3>Translating</h3>
<p>Some of these files contain code that doesn't need to be translated. Those can simply be tagged with a "notranslate" tag and it will alert the translators to simply use the English version.<br>
The process can be refined and I believe it will with practice.</p>
<h3>After translation</h3>
<p>Once the resources have been translated, it can be downloaded and it needs to be made sure that the variables in the front matter match each language.</p>
<ol>
<li>Copy the relevant .html files with the strings replaced by Liquid tags plus the index.md file and change the front matter accordingly</li>
</ol>
<ul>
<li>dao.html</li>
<li>downloads.html</li>
<li>faq.html</li>
<li>index.md</li>
<li>markets.html</li>
<li>stats.html</li>
</ul>
<ol start="2">
<li>The translated community.md files needs to be altered so that they can properly load the icons for the different social media platforms. This involves adding one more "../" to the images sources so that the pages search for them one directory above. Alternatively, we can copy the images and place them inside the translated language image folder. This, to me, seemed to waste resources.</li>
<li>The translated dao_content.yml and main_nav.yml files' content need to be copied and pasted into the /data/dao_content_tr.yml and /_data/main_nav_tr.yml respectively beneath their respective language code.<br>
The url of the translated links inside main_nav_tr.yml need to be edited to point to the correct folders.</li>
</ol>
<pre><code>From
url: /vision/
To
url: /pt-PT/vision/
</code></pre>
<ol start="4">
<li>The vison.md files can be put in their respective language folder.</li>
<li>The images.yml file is a reference for anybody willing to translate the images in bisq.network/dao. The process involves copying the folder /images/DAO and paste it inside the respective language folder and edit the .svg images, replacing the strings with a software like Inkscape.</li>
</ol>
<h2>Updating translations</h2>
<p>The website isn't updated often or regularly, so it's likely to happen that the English version may stay ahead of the translated versions.<br>
One solution solution to this asynchronicity is to keep outdated translations up but alert the reader to the fact.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/growth/issues/153?email_source=notifications&email_token=AJFFTNVZ4VGTQ7VNCKNF7MLQCF45VA5CNFSM4IHZB6ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3HAHFY#issuecomment-516817815">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXD4B4G5Y4VK3IWBS3QCF45VANCNFSM4IHZB6ZA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AJFFTNVZ5KCARFWBGOZEFYLQCF45VA5CNFSM4IHZB6ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3HAHFY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/growth/issues/153?email_source=notifications\u0026email_token=AJFFTNVZ4VGTQ7VNCKNF7MLQCF45VA5CNFSM4IHZB6ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3HAHFY#issuecomment-516817815",
"url": "https://github.com/bisq-network/growth/issues/153?email_source=notifications\u0026email_token=AJFFTNVZ4VGTQ7VNCKNF7MLQCF45VA5CNFSM4IHZB6ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3HAHFY#issuecomment-516817815",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>