gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] one further aspect of i18n()ing


From: Karsten Hilbert
Subject: [Gnumed-devel] one further aspect of i18n()ing
Date: Fri, 6 Dec 2002 00:15:05 +0100
User-agent: Mutt/1.3.22.1i

Hi all,

I have devised the following scheme to facilitate further
translation: Some strings that need translation are not
hardcoded in the source code but rather live in the database
itself. For code strings we can use the convention of marking
them with _(). For SQL strings there is no such convention.
One will thus have to mark them in another way that is
compatible with both gettext and psql script syntax.

For an example take a look at gmidentity.sql. The table
"relation_types" lists a bunch of English words for certain
types of relations. You will notice that all the lines that
need translation are marked with "-- i18n". The translation
input generation script will now parse sql files, too, and
extract strings (that's the stuff between the ''). Those
strings will be collected in a temporary file and wrapped
with the _() gettext marker. Thus they will end up in the
translation source file.

For translations to take effect some more work is needed. The
results of queries will need to be wrapped in _() judiciously.
E.g. when I am querying for the name of a relation I would
force translation of the result and display the resulting
string.

Please comment on this scheme !

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]