I can't get i18n (in Kid templates) working. - I am using admi18n of
the toolbox (everything seems to work fine here), however I can't see
a single translated string. Don't know if this is a matter of
configuration or something else.

Steps to reproduce this problem:

For the purpose of this e-mail I am starting in an environment with
$LANG set to en_US.UTF-8 and try to translate some strings to
german. (I guess this is the more common case, also covered in the
docs, actually later I want to do it the other way around: have a
german default environment and translate some strings to English)

My system is TG 1.0b1, fetched with easy_install, on Debian sarge,
python 2.4.1

I am starting with a quickstart project

  $ tg-admin quickstart
  ...

and I am trying to translate some of the string in welcome.kid.
Fromthe toolbox

  $ tg-admin toolbox

I can choose admi18n, collect the strings form welcome.kid
and generate a locales/messages.pot file.

Then I manage my languages (> Manage your languages):
I added a new locale for "de (German)" from the list.

Now editing this de locale gives me a chance to
to translate some of the strings:

* let's say the very last string:
  "Welcome to TurboGears"

  (This is used in the title tag of welcome.kid: 
  <title>Welcome to Turbogears</title> 
  and is used by the WindowManager for my Browser Window.)

  German: "Wilkommen zu TG."

* as another string I am choosing
  "Your TurboGears application is now running."
  in german that is:
  "Ihr TG Programm läuft jetzt."

I save those strings and I can seem them now in
locales/de/LC_MESSAGES/messages.po

clicking on "Manage your languages" once more
(and having the de locale selected) gives me a chance to 
"Compile selected locales to .mo files"
- seems successfull so far, too: When I look into the (binary)
locales/de/LC_MESSAGES/messages.mo file, I can see those two
translated strings.

So I restarted my server - experimenting with a couple
of configuration options and Browser language configurations,
but no tranlation.

I used:

  i18n.run_template_filter=True

and also tried 

  i18n.default_locale='de'

in dev.cfg, also I am using de before en in the list of my
browser's (firefox) preferred languages, all this with
no success.

An older doc for i18n in tg (http://www.checkandshare.com/admi18n)
suggests having

  sessionFilter.on = True
  
so I tried that, too. Don't now if this is still valid:
the suggested modification to controllers.py there

  def index(self, lang=None)
     ...
     if lang: cherrypy.session['locale'] = lang

doesn't seem to work any more(?)

The documentation 
http://docs.turbogears.org/1.0/Internationalization
states:

  Handling text strings in Kid templates is somewhat easier. If you
  set the cherrypy configuration setting i18n.run_template_filter to
  True, all text inside your Kid templates will be passed through
  _() automatically.

So it should be working just out of the box.

Any ideas? What am I missing?

Later I actually want to use genshi templates -
don't know what's the status of i18n there?
I figured, I should first try to get it running with
kid templates.

-Andreas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to