On Mon, 22 Sep 2014 06:17:36 -0500
"Edward K. Ream" <edream...@gmail.com> wrote:

> On Sun, Sep 21, 2014 at 2:04 PM, Peter Noske
> <noske.span...@t-online.de> wrote:
> 
> > Is there a way now to have / get a version of Leo in German
> > language, a localization one's?

Maybe not adding much here, but my just guessing haven't done
it myself impression of the most general approach to localization is
that all in code strings are wrapped in a function call, with the
function often being called `_` to minimize its intrusiveness.  E.g

  g.es("No @file nodes in tree")

becomes

  g.es(_("No @file nodes in tree"))

I.e. english (typically) is chosen as the language to use throughout
the source, and then the localization machinery handles the
translation, using a lookup table for each supported language, going
from the english to the language in question.

Which is fine for simple text output from code.

Leo will be a bit more complicated because of the way it uses plain
text as a data type.  How would we distinguish non-translatable text,
e.g. 

  @string body-font-family = @font-family

non-translatable in the sense that 

  @string körper-sind-familie = @sind-familie

won't work, vs. translatable text, e.g.

  @string cleo_time_name = 'weeks'

could be

  @string cleo_time_name = 'wochen'

I'm guessing the second case is extremely rare though.

But I don't see any reason the _("") part couldn't be worked on - apart
from adding the _("") I assume it's mostly automatic in terms of
extracting the list of strings to translate and generating the tables
for other languages - assuming you can find someone to fill them in.
Presumably the english is shown for untranslated strings.

Cheers -Terry


> For menus, see @@menu 文件 in leoSettings.leo
> 
> In other words, all you need to do is create your own @menu settings
> (in myLeoSettings.leo)
> 
> For log message, note the docstring for g.es:
> 
>     Put all non-keyword args to the log pane.
>     The first, third, fifth, etc. arg translated by g.translateString.
> 
> The g.translateString function essentially just returns
> gettext.gettext(s)  See:
> 
>     https://docs.python.org/2/library/gettext.html
> 
> I doubt that gettext is properly inited, but I could be wrong.  In
> other words, a bit more work will likely be needed to translate g.es
> text to German.
> 
> HTH.
> 
> Edward
> 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to