Skip to content

Translating & Text Revisions

GEA Admin edited this page Nov 17, 2024 · 3 revisions

GoBrik and Ecobricks.org Translation System

GoBrik and Ecobricks.org are designed from the ground up to enable collaborative translation, editing, and updating.

Over the years, we've experimented with various third-party translation platforms. We started with Text-Pattern, then WP-Translations when we were still on WordPress. We used a JavaScript service for a while, and finally, we've built our own! Our pages use our own language switcher function, which is fully open source. It has its own repository here.


How It Works

The way our GoBrik pages work is through the insertion of texts. Each page on our site has its own source file of "snippets" that correspond to every text element on the page. Each text element has its own data-lang-id, and each snippet in the language file matches these IDs. These snippets are bits of text and HTML that compose all the elements of the page.

When a user loads a page in English, the browser looks for all the snippets in the English translation file, matches their data-lang-id with those on the page, and inserts the text accordingly.

For example, here's a coded snippet in our Indonesian translation file for our project page:

'025-block-2-list-project': '<strong>My Project</strong>',

A translator focuses on the snippet's text on the right-hand side. The text on the left is the data-lang-id and doesn't need to be translated. For instance, here's how the above snippet should be translated into Indonesian:

'025-block-2-list-project': '<strong>Proyek Anda</strong>',

Notice that the <strong> tags are not translated. HTML tags are always left in English.

While most snippets are simple text, some contain HTML, file names, and links. The translator should only focus on the non-HTML text. For example:

'018-block-2-main-image-alt': '<img src="../svgs/02-Choose-your-Bottle-1.svg" width="640" alt="Pilih jenis botol yang ideal" loading="lazy" class="full-width-image">',

Here, the only text that needs review is the alt tag: "Pilih jenis botol yang ideal". Everything else—the file name and the HTML—needs to remain in English.

One final note: all single apostrophes must have a backslash in front of them, like this: '.


Glossaries

There are many unique terms and words in the Earthen and Ecobrick movements. We keep track of them in our GEA glossaries:

Nomenclature note

In the GoBrik table we write table names with tb_ at the start of the table name (using a plural noun i.e. ecobricks, ecobrickers, etc) if it is only used on GoBrik. On the buwana database we add the _tb at the end of the name (using a plural nound i.e. users, countries, watershed, etc.). On the GoBrik database, if a table is mirrored on Buwana, we name it the same as on the Buwana database (i.e. communities_tb, languages_tb, countries_tb etc.)

Clone this wiki locally