A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/063531.html below:

[Python-Dev] The "i" string-prefix: I18n'ed strings

[Python-Dev] The "i" string-prefix: I18n'ed strings [Python-Dev] The "i" string-prefix: I18n'ed stringsMartin Blais blais at furius.ca
Fri Apr 7 16:38:33 CEST 2006
On 4/7/06, Alexander Schremmer <2005a at usenet.alexanderweb.de> wrote:
> On Fri, 7 Apr 2006 10:07:26 -0400, Martin Blais wrote:
>
> > There are cases where you need N_() after initialization, so you need
> > both, really.  See the link I sent to Alex earlier (to the GNU manual
> > example).
>
> On the page you were referring to, I cannot find a particular use case that
> does not work with the idea sketched above.

Okie.  Here's one example from actual code:


  class EventEdit(EventEditPages):

      def handle( self, ctxt ):
          ...
          # Render special activate/deactivate button.
          if ctxt.event.state == 'a':
              future_state = u's'
              actstr = N_('Deactivate')
          else:
              future_state = u'a'
              actstr = N_('Activate')

          values = {'state': future_state}
          rdrbutton = HoutFormRenderer(form__state_set, values)
          page.append(rdrbutton.render(submit=actstr))


HoutFormRenderer.render() expects non-translated strings, and it
performs the gettext lookup itself (this is a general library-wide
policy for all widget labels).

(This is just one example.  I have many other use cases like this.)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4