comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: gettext for Ada
Date: Thu, 23 Nov 2017 14:23:08 +0100
Date: 2017-11-23T14:23:08+01:00	[thread overview]
Message-ID: <ov6i3r$1n3l$1@gioia.aioe.org> (raw)
In-Reply-To: 8760a1yyxp.fsf@jacob-sparre.dk

On 23/11/2017 13:14, Jacob Sparre Andersen wrote:
> Dmitry A. Kazakov wrote:
> 
>>     Put (Image (n) & Image (Verb) & ' ' & Image ("Tail"));
>>
>> Image (0) would return empty string. But first I would avoid sentences
>> difficult to translate without having AI. Anyway a format string would
>> have more problems with inflections.
>>
>> BTW, for a right to left languages you could define "+" for strings
>> that reorders arguments:
>>
>>     Put (A + B + C); --> Put (C & B & A);
> 
> I can't see how you can do that without having a programmer sit down
> with a translator for each language, and implement an "Image" function
> for each parametrised, user-visible sentence in the application.  That
> sounds quite costly to me.

No. You do everything in English. When you run your program, each time 
an Image is called it creates or modifies an entry in the translation 
table backed by a single-file DB maybe with source file and line 
reference attached to the entry.

Once you decide to deploy your project, you walk through the DB entries 
and provide translations to the languages you want to support. The 
source line reference helps to understand the meaning of the sentence as 
a whole. The DB is deployed together with the application.

> Do you have an idea (or experience) doing it in an efficient way, which
> doesn't make it prohibitively costly to add more languages?  (Or to
> change the user interface for that matter?)

I don't do text messages translations, it is IMO pointless. If a user 
does not know English enough to understand a text message, he should 
walk away. However I used the schema described above once.

A GUI is a different thing. There is little choice because frameworks 
like GTK already implement one or another translation schema. GTK has an 
official method which I don't like and a semi-official one I prefer to use.

I have all texts (button names, tool-tip texts etc) coming as a string 
widget style property with the default value to serve as the English 
fallback. GTK widget styles are defined/overridden using CSS and can be 
reloaded using GtkCssProvider any time. The DB I described above is not 
necessary because in GTK you can walk all properties of a widget (and 
its children for containers). This how you can get a full list of all 
texts and devise some localized CSS' to deploy.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2017-11-23 13:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 20:40 gettext for Ada Victor Porton
2017-11-20 15:40 ` Shark8
2017-11-20 19:28   ` Jacob Sparre Andersen
2017-11-20 19:59     ` Shark8
2017-11-20 20:33       ` Dmitry A. Kazakov
2017-11-21 19:15         ` Jacob Sparre Andersen
2017-11-21 20:54           ` Dmitry A. Kazakov
2017-11-23  9:15             ` Jacob Sparre Andersen
2017-11-23  9:47               ` Dmitry A. Kazakov
2017-11-23 10:03                 ` Jacob Sparre Andersen
2017-11-23 10:37                   ` Dmitry A. Kazakov
2017-11-23 12:14                     ` Jacob Sparre Andersen
2017-11-23 13:23                       ` Dmitry A. Kazakov [this message]
2017-11-21 19:22       ` Jacob Sparre Andersen
2017-11-20 22:43   ` Randy Brukardt
2017-11-21  0:28     ` Shark8
2017-11-21  8:29       ` G. B.
2017-11-21 13:48         ` J-P. Rosen
2017-11-22  1:10       ` Randy Brukardt
2017-11-22 15:38         ` Shark8
2017-11-23  0:30           ` Randy Brukardt
2017-11-23  3:08             ` Shark8
2017-11-28  0:48               ` Randy Brukardt
2017-11-28 16:47                 ` Simon Wright
2017-11-28 17:03                 ` Dmitry A. Kazakov
2017-11-28 22:41                   ` Randy Brukardt
2017-11-29  9:09                     ` Dmitry A. Kazakov
2017-11-23  8:25           ` G. B.
2017-11-23 16:02             ` Shark8
2017-11-23 18:55               ` G. B.
2017-11-23 20:24                 ` Shark8
2017-11-28  0:55                   ` Randy Brukardt
2017-11-22 21:36 ` Blady
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox