Re: gettext questions




Kenneth Albanowski <kjahds@kjahds.com> writes:

> On 13 Nov 1998, Owen Taylor wrote:
> 
> >  * One difficulty with internationalization is that sometimes
> >    special fonts are required to match the localized text.
> >    
> >    The solution I am thinking of implementing, is, if the locale is,
> >    say ja_JP.ujis, then GTK+, upon initialization, will look for,
> >    in turn:
> > 
> >      $datadir/gtk/gtkrc.ja_JP.ujis
> >      $datadir/gtk/gtkrc.ja_JP
> >      $datadir/gtk/gtkrc.ja
> > 
> >    and parse the first one it finds. A set of these files suitable
> >    for the distributed PO files would be shipped with GTK+.
> 
> Logical, and harmless. However, I'm not sure how useful it will be (can
> the same font be used for translated and untranslated labels?)

Generally, yes, assuming that the untranslated labels are in
ASCII. The fonts here, are generally fontsets, which specify
a set of fonts in different font sets.

For instance, you might specify as a fontset for Japanese:

 fontset = "-*-fixed-medium-r-normal--16-110-100-100-c-160-*-*"

which is turned into:

 -jis-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1983-0
or
 -misc-fixed-medium-r-normal--16-110-100-100-c-160-iso8859-1

as needed. X is able to figure out that it needs to use the iso8859-1
font for untranslated labels because the Japanese encoding include
ASCII as a proper subset.
 
[...]
> >  * Another thing that has to be concerned is internationalization
> >    in GtkItemFactory. My proposal for this is to add:
> > 
> >    typedef gchar *(GtkItemTranslationFunc) (const gchar *path);
> > 
> >      gtk_item_factory_set_translation_func (GtkItemFactory *ifactory,
> > 	  				    GtkItemFactoryTranslationFunc func);
> >    The translation function receives a menu path, say:
> > 
> >      "/File/_Delete"
> > 
> >    and returns the translation of the item. ("_Löschen"). (The
> >    caller would strip off leading path comments from the return.
> >    if necesary)
> > 
> >    Comments?
> 
> This needs to be very carefully specified. Is the intention to translate
> the strings in the source, or to translate during menu generation? Either
> is messy, as I assume the cataloging operations won't work properly if _() 
> isn't used, but using _() inside a structure definition won't work, and
> furthermore it isn't clear whether the Item strings are really arbitrary
> tags (that just happen to match the English menu labels), or the opposite.
> 
> No answers here, I'm afraid.

The strings are translated at menu generation. The standard way
of handling the cataloging is to use a separate tag
(conventionally called N_ or gettext_noop()) that marks the
strings for translation, but doesn't actually do anything.

Regards,
                                        Owen



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