[bisq-network/growth] Translator Call 2019.07.31 (#153)

huey735 notifications at github.com
Wed Jul 31 11:58:18 UTC 2019

# How the translation of the website is structured

## Files involved

**Default layout**
 * /_layouts/default.html

 * /_data/main_nav.yml
 * /_includes/main_nav.html

 * /_includes/footer.html

  * /index.md
  * /_includes/homepage_content.html
  * /_includes/os_selector_options.html

**Bisq DAO**
 * /_data/dao_content.yml
 * /dao.html
 * /images/dao

* /community.md

* /downloads.html

   * /faq.html

  * /markets.html

  * /stats.html

  * /vision.md

## The process of translation

I chose to follow this method - sylvaindurand.org/making-jekyll-multilingual/

1. A folder with the [language code](en.wikipedia.org/wiki/Language_localisation#Language_tags_and_codes) is created at the root of the website. This folder will contain:
  * copy of the /images/dao folder with the images translated. I don't find necessary to rename the files. [There's currently an issue rendering the translated images](https://github.com/bisq-network/bisq-website/issues/196) and Steve (@m52go) is trying to solve it.
  * copy of the files, at the root of the website, that serve the pages to be translated:
    * /community.md
    * /dao.html
    * /dowloads.html
    * /faq.html
    * /index.md
    * /markets.html
    * /stats.html
    * /vision.md  

    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.
    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 }}
    These files and their originals need to be connected through variables in their front matter:
      * ref - filename
      * lang - language code
      * language - the language name written extensively (this is to be used in the language selector)
    ref: index
    lang: pt-PT
    language: Português (PT)

2. 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:
       key:Translated string
       key:Translated string

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).

3. 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.

4. 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.

## Transifex

### Upload

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:

 * community.md
 * _data/dao_content.yml
 * _data/main_nav.yml
 * vision.md
 * strings.yml
 * images.yml  
 All of the "{{ site.url }}" Liquid tags in the strings.yml text have been replaced by "https://bisq.network" as Transifex convertes the curly brackets into other characters.

### Translating

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.  
The process can be refined and I believe it will with practice.

### After translation

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.

1. Copy the relevant .html files with the strings replaced by Liquid tags plus the index.md file and change the front matter accordingly

 * dao.html
 * downloads.html
 * faq.html
 * index.md
 * markets.html
 * stats.html

2. 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.
3. 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.  
The url of the translated links inside main_nav_tr.yml need to be edited to point to the correct folders.  
url: /vision/
url: /pt-PT/vision/
4. The vison.md files can be put in their respective language folder.
5. 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.

## Updating translations

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.  
One solution solution to this asynchronicity is to keep outdated translations up but alert the reader to the fact.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190731/3223d389/attachment.html>

More information about the bisq-github mailing list