Back to Software Homepage - To Software Assessment Homepage


Technical issues of translation

This page should give overview and details on how the translation of the user interface texts are implemented. It has the focus on developing the main CAcert web page, but may apply to other projects as well. The CAcert Training System (CATS) translation is currently handeld differently, see the CATS Translation Page.

This is a re-engineering work-in-progress. The information on this page is incomplete and may even be wrong! Please help in improving it!

Overview

If you are writing PHP code as a software developer and have a text that should be presented to the user in her selected language you just enclose the text in  _(  and  )  like in

<h3><?=_("Are you new to CAcert?")?></h3>

The text in the parentheses is used as "ID" for the text to be shown. If no better translation can be found then the text itself is shown, so it should always be in english.

There is a tool which parses the code for this kind of strings, extract them and transfer them to the translation server, for translation by users.

Another tool fetches the hopefully finished translation from the translation server and creates a messages.po file for each language in its own subdirectory of the www/locale directory.

For Software Developers

The most important thing has already been stated in the Overview paragraph: enclose translateable texts in  _(  and  ) .

ToDo: Which feature, library or code file does the translation? Obviously _("text") is a function call which returns the translated text...

Switching to another language

ToDo

Do's and Dont's

ToDo: Are IDs case sensitive? Are white spaces relevant in IDs?

For Administrators / Software Assessors

Extract new translateable texts from the code

ToDo

Install updated translation from the server

To manually install an updated translation on a server, call  make  in the www/locale directory.

On the testservers this seems to be done automatically once every day. ToDo: Which script/service is doing this? Is this the same for the production server?

Inputs & Thoughts


Software/Translation (last edited 2019-02-17 18:44:04 by BernhardFröhlich)