Re: simplelist and non-western languages



Am Freitag, den 19.11.2004, 14:58 -0600 schrieb Shaun McCance:
> DocBook has a simplelist element, which has far from simple processing
> expectations.  When it has the type="inline" attribute, it's supposed to
> be rendered as an inline list.  So this
> 
> <simplelist>
>   <member>fe</member>
>   <member>fi</member>
>   <member>fo</member>
>   <member>fum</member>
> </simplelist>
> 
> becomes fe, fi, fo, fum.  Seperating terms with commas is pretty common
> to western languages, but I don't know how non-western languages would
> want this rendered.  Would it be sufficient to mark the string ", " for
> translation, or do translators need more control?

", " doesn't seem to be enough. At least for RTL languages, swapping the
argument order would be desirable. My proposal would be:

gchar *oldstr, *str = NULL;
GList *members, *l;

members = /* member getter, returns list of strings, or maybe some kind
of node struct */;

g_return_if_fail (members);

for (l = members; l->data; l = l->next) {
     if (!str) /* first run */ {
       str = g_strdup (member->data);
       next;
     }

     oldstr = str;
     /* explain what this means, that swapping 1 and 2 swaps
        display order etc. */
     str = g_strdup_printf (_("%1$s, %2$s"),
                            str,
                            member->data);
     g_free (oldstr);
}

/* free members */

Does this sound reasonable?

regs,
 Chris



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