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

[Cheetahtemplate-discuss] Fwd: Re: PSP, Cheetah, PTL, ZOPE, etc ...

Expand Messages
  • Chuck Esterbrook
    ... _______________________________________________ Cheetahtemplate-discuss mailing list Cheetahtemplate-discuss@lists.sourceforge.net
    Message 1 of 10 , Aug 1, 2001
    • 0 Attachment
      >X-Track: 1: 40
      >X-Yahoo-Forwarded: from chuckesterbrook@... to echuck@...
      >From: posting-system@...
      >Date: Wed, 1 Aug 2001 11:14:01 -0700
      >Reply-To: posting-system@...
      >To: ChuckEsterbrook@...
      >Subject: Re: PSP, Cheetah, PTL, ZOPE, etc ...
      >
      >From: ChuckEsterbrook@... (Chuck Esterbrook)
      >Newsgroups: comp.lang.python
      >Subject: Re: PSP, Cheetah, PTL, ZOPE, etc ...
      >References: <dc6f5c99.0108010315.70be0de0@...>
      >NNTP-Posting-Host: 216.175.70.94
      >Message-ID: <112e9d13.0108011014.1fb2241a@...>
      >
      >grahamd@... (Graham Dumpleton) wrote in message
      >news:<dc6f5c99.0108010315.70be0de0@...>...
      > > Go to:
      > >
      > > http://webware.sourceforge.net/Papers/Templates/
      > >
      >[snip]
      > > What I am wanting to know is what we have learnt from all of this. If
      > > one were designing yet another template system, what might be the best way
      > > of approaching it? The idea being for it to be simple in appearance and
      > > use, yet be powerful enough to harness features within the back end server.
      >
      >We *did* design YATL this past spring. It started with some examples
      >and discussion on the webware-discuss list. Cheetah emerged as our
      >victor for various reasons including [a] we liked the design and [b]
      >the author took it to maturity.
      >
      >Although the docs don't reflect it yet, Cheetah will pretty much be
      >the recommended templating solution for Webware developers.
      >
      >So no one gets confused: Cheetah is an independent project and can be
      >used sans Webware. Also, Webware could be used with any Pythonic
      >templating solution (I have even baked my own simple ones from time to
      >time).
      >
      >Also, Zope is a web dev environment, not a templating language. More
      >specifically, Zope has 2 templating languages: DTML and ZPT. I'm not
      >sure if StructuredText counts as one because I forget if it allows for
      >substitution of variable names.
      >
      >The approximate consensus seems to be that DTML is "old school" and
      >that ZPT is the new, shiny way to do templating in Zope. That brings
      >us to my next topic:
      >
      >Outside of *SP, the 2 major templating camps that I see are "dollar
      >sign/pound" or $#, and *ML.
      >
      >In $# you use $ for substitution, often with dotted notation such as
      >$employee.manager.salary, and # for directives like #if, #for, and
      >#set. The idea is to provide enough power for simple display logic,
      >but to keep your application logic outside the templates.
      >
      >Packages in this camp include Cheetah, Webmacro and Velocity, the last
      >2 of which are for Java.
      >
      >The *ML camp uses XML or XML-like tags for all instructions and
      >substitutions. These include ZPT, Ehydra and others. There is a *ML
      >like kit for Webware, but I don't think any serious time was put into
      >it, hence it is hard to recommend (for Webware).
      >
      >In any case, I prefer the $# approach because it is:
      > - very easy to write
      > - very easy to read
      > - very easy to learn
      > (hmmm, kind of like Python)
      > - understandable by non-programmers (like an HTML designer)
      > - uses few symbols (mostly just $ and #)
      > - works with all formats (plain text, SQL, HTML, etc.)
      > - language neutral on the outside
      >
      >Some prefer the *ML approach because...? Maybe they like the
      >structured nature of mark up languages. Disclaimer: When you're not a
      >proponent of something, it's hard to represent that something's user
      >base. For example, I no longer have any idea why people use Java and
      >Perl. :-)
      >
      >Some clickables:
      >
      >Cheetah, Python-powered templates
      > http://www.cheetahtemplate.org/
      >
      >Webware, Python-powered web dev
      > http://webware.sourceforge.net/
      >
      >
      >Hope that helps,
      >-Chuck


      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Clark C . Evans
      Chuck, How are you planning to handle internationalization? Thanks! Clark _______________________________________________ Cheetahtemplate-discuss mailing list
      Message 2 of 10 , Aug 1, 2001
      • 0 Attachment
        Chuck,

        How are you planning to handle internationalization?

        Thanks!

        Clark

        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Chuck Esterbrook
        ... For Cheetah or Webware? For Webware, we were planning on doing what the GNU mailman guys did as described in a presentation at Python 9. I don t see a
        Message 3 of 10 , Aug 2, 2001
        • 0 Attachment
          At 02:46 AM 8/2/2001 -0400, Clark C . Evans wrote:
          >Chuck,
          >
          >How are you planning to handle internationalization?
          >
          >Thanks!
          >
          >Clark

          For Cheetah or Webware? For Webware, we were planning on doing what the GNU
          mailman guys did as described in a presentation at Python 9. I don't see a
          ready to go link at www.python9.org for online papers and python.org is
          still down, so I don't have a handy link to the paper that was presented.

          I'm not sure what, if any, plans Tavis has for Cheetah. Nor have I thought
          much about internationalized templates.


          -Chuck


          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Mike Orr
          ... What needs to be internationalized? Is there anything language-specific or locale-specific in how Cheetah works? The function libraries and macro
          Message 4 of 10 , Aug 2, 2001
          • 0 Attachment
            On Thu, Aug 02, 2001 at 02:46:30AM -0400, Clark C . Evans wrote:
            > How are you planning to handle internationalization?

            What needs to be internationalized? Is there anything language-specific
            or locale-specific in how Cheetah works?

            The function libraries and macro libraries could do with some multilingual
            support, but they are all optional. For instance, we've talked about a
            join function that would convert
            $joinAnd('A', 'B', C') -> "A, B and C"
            $joinAnd('A', 'B') -> "A and B"
            and one could ask, "What about other languges? Where would the equivalent
            functions for those go?" Or, "What about locale-aware templates, with
            methods that return different things according to the locale/language/charset?"

            But it's unclear what form these features should take, or whether this
            even needs to be addressed by Cheetah at all, or whether we should just
            let the programmer handle that with a wrapper around Cheetah. For instance,
            if you change the language, you don't just have to change the functions, but
            the Template Definition too, so perhaps each Cheetah object only needs to be
            unilingual.

            --
            -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
            http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

            _______________________________________________
            Cheetahtemplate-discuss mailing list
            Cheetahtemplate-discuss@...
            http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Ian Bicking
            ... Maybe he means internationalization like gettext or whatever -- string substitution of languages. UTF-8 should work fine with Cheetah, of course, since it
            Message 5 of 10 , Aug 2, 2001
            • 0 Attachment
              Mike Orr <iron@...> wrote:
              > > How are you planning to handle internationalization?
              >
              > What needs to be internationalized? Is there anything language-specific
              > or locale-specific in how Cheetah works?

              Maybe he means internationalization like gettext or whatever --
              string substitution of languages.

              UTF-8 should work fine with Cheetah, of course, since it looks like
              ASCII text. Dealing with other encodings can get to be a pain... but
              hopefully that can just be ignored.

              One way would be to abstract your text in an object, and do things
              like $lang.helloMessage. Other string substitution is probably beyond
              the scope of what Cheetah does.

              The actual directives and such are just tokens, which happen to have
              English cognates. This is pervasive in programming, so I don't see a
              justification for internationalizing them.

              Ian

              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            • Tavis Rudd
              Clark, I assume by internationalization you mean producing Cheetah output in other languages, rather than internationalizing the Template Definition Language
              Message 6 of 10 , Aug 2, 2001
              • 0 Attachment
                Clark,
                I assume by 'internationalization' you mean producing
                Cheetah output in other languages, rather than
                internationalizing the Template Definition Language itself.
                As Cheetah template definitions and $placeholder values can
                be unicode strings (see the Python docs for more) I think
                Cheetah is already capable of 'internationalization'.
                However, this hasn't been tested thouroughly.

                Are you working on a project that requires this?

                Cheers,
                Tavis

                _______________________________________________
                Cheetahtemplate-discuss mailing list
                Cheetahtemplate-discuss@...
                http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
              • Clark C . Evans
                ... I need to have multiple various versions of my website (Spanish and English at first, French and German wouldn t hurt); and I was wondering if your
                Message 7 of 10 , Aug 2, 2001
                • 0 Attachment
                  | I assume by 'internationalization' you mean producing
                  | Cheetah output in other languages, rather than
                  | internationalizing the Template Definition Language itself.

                  I need to have multiple various versions of my website (Spanish
                  and English at first, French and German wouldn't hurt); and I
                  was wondering if your template mechanism is planning to
                  facilitate this requirement; via a string "localization"
                  resource table or similar mechanism.

                  Best,

                  Clark


                  _______________________________________________
                  Cheetahtemplate-discuss mailing list
                  Cheetahtemplate-discuss@...
                  http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                • Tavis Rudd
                  Clark, ... It already facilitates it via Python s gettext module, which is a wrapper around the GNU gettext API. Have a look at gettext in the Python Global
                  Message 8 of 10 , Aug 2, 2001
                  • 0 Attachment
                    Clark,

                    On Thursday 02 August 2001 11:28, you wrote:
                    > I need to have multiple various versions of my website
                    > (Spanish and English at first, French and German wouldn't
                    > hurt); and I was wondering if your template mechanism is
                    > planning to facilitate this requirement; via a string
                    > "localization" resource table or similar mechanism.

                    It already facilitates it via Python's gettext module,
                    which is a wrapper around the GNU gettext API.
                    Have a look at 'gettext' in the Python 'Global Module
                    Index'. This will handle all strings in your normal Python
                    modules; i.e. all the text that you'd include with
                    $placeholder tags. You'd need to do some extra work to get
                    it working with the text makes up the raw 'template
                    definition'.

                    Keep us posted on how you go with it.

                    Tavis

                    _______________________________________________
                    Cheetahtemplate-discuss mailing list
                    Cheetahtemplate-discuss@...
                    http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                  • Mike Orr
                    ... Perhaps Template.__init__ could take a keyword argument encoding to say what format the Template Definition string or file is. That would reduce a
                    Message 9 of 10 , Aug 2, 2001
                    • 0 Attachment
                      On Thu, Aug 02, 2001 at 12:41:01PM -0500, Ian Bicking wrote:
                      > UTF-8 should work fine with Cheetah, of course, since it looks like
                      > ASCII text. Dealing with other encodings can get to be a pain... but
                      > hopefully that can just be ignored.

                      Perhaps Template.__init__ could take a keyword argument 'encoding' to
                      say what format the Template Definition string or file is. That would
                      reduce a little bit of clutter in the wrapper programs. Of course,
                      you'd still be on your own to encode the Search List values.

                      Regarding any other changes, we need somebody who uses maintains
                      multilingual documents to tell us what in particular would make their
                      job easier. Perhaps we can add a few more arguments and hooks to make
                      Cheetah and gettext integrate better, but at this point we don't know
                      what is desirable.

                      --
                      -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
                      http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

                      _______________________________________________
                      Cheetahtemplate-discuss mailing list
                      Cheetahtemplate-discuss@...
                      http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                    • Ian Bicking
                      ... I wouldn t do encoding unless it was clear exactly how. Otherwise it s just going to be awkward or prone to double-encoding or something. Python is still
                      Message 10 of 10 , Aug 2, 2001
                      • 0 Attachment
                        Mike Orr <iron@...> wrote:
                        > Perhaps Template.__init__ could take a keyword argument 'encoding' to
                        > say what format the Template Definition string or file is. That would
                        > reduce a little bit of clutter in the wrapper programs. Of course,
                        > you'd still be on your own to encode the Search List values.

                        I wouldn't do encoding unless it was clear exactly how. Otherwise
                        it's just going to be awkward or prone to double-encoding or
                        something. Python is still up in the air about some of this, anyway.
                        In the next version or two all might be clarified.

                        > Regarding any other changes, we need somebody who uses maintains
                        > multilingual documents to tell us what in particular would make their
                        > job easier. Perhaps we can add a few more arguments and hooks to make
                        > Cheetah and gettext integrate better, but at this point we don't know
                        > what is desirable.

                        I don't know that there's anything like gettext for Python -- it's
                        more of a C thing. I think it's also oriented towards retrofitting
                        internationalization on programs. I suppose the .po file format -- of
                        which I know very little -- might be useful.

                        But the simplistic $lang.messageName system works pretty much the
                        same, but doesn't require much of any help.

                        You can just have a dictionary of messages, maybe one language per
                        file or something. You put the appropriate language dictionary in the
                        searchList, and you are off. Uses a dictionary in the original
                        meaning, too.

                        Ian

                        _______________________________________________
                        Cheetahtemplate-discuss mailing list
                        Cheetahtemplate-discuss@...
                        http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                      Your message has been successfully submitted and would be delivered to recipients shortly.