Loading ...
Sorry, an error occurred while loading the content.

Re: [Cheetahtemplate-discuss] Using pygettext.py in Cheetah Templates

Expand Messages
  • Shannon -jj Behrens
    Cheetah recognizes the $_ and makes sure to leave something pygettext.py can parse (i.e. with no NameMapper cruft): if 0: _( This is a string. ) # Normal
    Message 1 of 4 , Mar 1, 2006
    • 0 Attachment
      Cheetah recognizes the $_ and makes sure to leave something
      pygettext.py can parse (i.e. with no NameMapper cruft):

      if 0:
      _("This is a string.")
      # Normal NameMapper cruft goes here.

      By the way, you may want to switch to xgettext if you care about
      supporting plurals. I use:

      xgettext --language=Python -k --keyword=_ --keyword=N_ --keyword=ngettext:1,2

      Happy Hacking!
      -jj

      On 2/28/06, Jerick S. Colendres <jerick@...> wrote:
      > It works! Why I never thought about that!
      >
      > Thank you!
      >
      > -Jerick
      >
      > > Try compiling your templates into .py files using the command line tool, then
      > > using pygettext on the .py files.
      > >
      > > On Tuesday 28 February 2006 7:39 pm, Jerick S. Colendres wrote:
      > >
      > >>Hello,
      > >>
      > >>I have the following lines in my template file:
      > >>
      > >> #set $foo = $_("This is a test")
      > >>
      > >>Then tried to run pygettext.py, but the tokenizer treated the whole line as
      > >>a comment token and did not parsed the line.
      > >>
      > >>Does anyone here have modified pygettext.py so that lines starting with '#'
      > >>in Cheetah templates can be processed?
      > >>
      > >>Thanks,
      > >>Jerick
      > >>
      > >>
      > >>-------------------------------------------------------
      > >>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
      > >>that extends applications into web and mobile media. Attend the live
      > >>webcast and join the prime developer group breaking into this new coding
      > >>territory!
      > >>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
      > >>_______________________________________________
      > >>Cheetahtemplate-discuss mailing list
      > >>Cheetahtemplate-discuss@...
      > >>https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      > >
      > >
      > >
      >
      >
      >
      > -------------------------------------------------------
      > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
      > that extends applications into web and mobile media. Attend the live webcast
      > and join the prime developer group breaking into this new coding territory!
      > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
      > _______________________________________________
      > Cheetahtemplate-discuss mailing list
      > Cheetahtemplate-discuss@...
      > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      >


      -------------------------------------------------------
      This SF.Net email is sponsored by xPML, a groundbreaking scripting language
      that extends applications into web and mobile media. Attend the live webcast
      and join the prime developer group breaking into this new coding territory!
      http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    Your message has been successfully submitted and would be delivered to recipients shortly.