Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28649/spambayes

Modified Files:
        ImapUI.py Options.py ProxyUI.py __init__.py 
Log Message:
Prepare for i18n.

Index: ImapUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ImapUI.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** ImapUI.py   23 Dec 2004 18:14:32 -0000      1.42
--- ImapUI.py   2 Jan 2005 05:00:40 -0000       1.43
***************
*** 47,51 ****
  
  import UserInterface
! from spambayes.Options import options, optionsPathname
  
  # These are the options that will be offered on the configuration page.
--- 47,51 ----
  
  import UserInterface
! from spambayes.Options import options, optionsPathname, _
  
  # These are the options that will be offered on the configuration page.
***************
*** 55,59 ****
  # fields/variables.
  parm_map = (
!     ('IMAP Options',          None),
      ('imap',                  'server'),
      ('imap',                  'username'),
--- 55,59 ----
  # fields/variables.
  parm_map = (
!     (_('IMAP Options'),       None),
      ('imap',                  'server'),
      ('imap',                  'username'),
***************
*** 65,75 ****
      ('imap',                  'password'),
      ('imap',                  'use_ssl'),
!     ('Header Options',        None),
      ('Headers',               'notate_to'),
      ('Headers',               'notate_subject'),
!     ('Storage Options',       None),
      ('Storage',               'persistent_storage_file'),
      ('Storage',               'messageinfo_storage_file'),
!     ('Statistics Options',    None),
      ('Categorization',        'ham_cutoff'),
      ('Categorization',        'spam_cutoff'),
--- 65,75 ----
      ('imap',                  'password'),
      ('imap',                  'use_ssl'),
!     (_('Header Options'),     None),
      ('Headers',               'notate_to'),
      ('Headers',               'notate_subject'),
!     (_('Storage Options'),    None),
      ('Storage',               'persistent_storage_file'),
      ('Storage',               'messageinfo_storage_file'),
!     (_('Statistics Options'), None),
      ('Categorization',        'ham_cutoff'),
      ('Categorization',        'spam_cutoff'),
***************
*** 79,109 ****
  # advanced configuration page.
  adv_map = (
!     ('Statistics Options',  None),
!     ('Classifier',          'max_discriminators'),
!     ('Classifier',          'minimum_prob_strength'),
!     ('Classifier',          'unknown_word_prob'),
!     ('Classifier',          'unknown_word_strength'),
!     ('Classifier',          'use_bigrams'),
!     ('Header Options',      None),
!     ('Headers',             'include_score'),
!     ('Headers',             'header_score_digits'),
!     ('Headers',             'header_score_logarithm'),
!     ('Headers',             'include_thermostat'),
!     ('Headers',             'include_evidence'),
!     ('Headers',             'clue_mailheader_cutoff'),
!     ('Storage Options',     None),
!     ('Storage',             'persistent_use_database'),
!     ('Tokenising Options',  None),
!     ('Tokenizer',           'mine_received_headers'),
!     ('Tokenizer',           'replace_nonascii_chars'),
!     ('Tokenizer',           'summarize_email_prefixes'),
!     ('Tokenizer',           'summarize_email_suffixes'),
!     ('Tokenizer',           'x-pick_apart_urls'),
!     ('Interface Options',   None),
!     ('html_ui',             'display_adv_find'),
!     ('html_ui',             'allow_remote_connections'),
!     ('html_ui',             'http_authentication'),
!     ('html_ui',             'http_user_name'),
!     ('html_ui',             'http_password'),
  )
  
--- 79,109 ----
  # advanced configuration page.
  adv_map = (
!     (_('Statistics Options'), None),
!     ('Classifier',            'max_discriminators'),
!     ('Classifier',            'minimum_prob_strength'),
!     ('Classifier',            'unknown_word_prob'),
!     ('Classifier',            'unknown_word_strength'),
!     ('Classifier',            'use_bigrams'),
!     (_('Header Options'),     None),
!     ('Headers',               'include_score'),
!     ('Headers',               'header_score_digits'),
!     ('Headers',               'header_score_logarithm'),
!     ('Headers',               'include_thermostat'),
!     ('Headers',               'include_evidence'),
!     ('Headers',               'clue_mailheader_cutoff'),
!     (_('Storage Options'),    None),
!     ('Storage',               'persistent_use_database'),
!     (_('Tokenising Options'), None),
!     ('Tokenizer',             'mine_received_headers'),
!     ('Tokenizer',             'replace_nonascii_chars'),
!     ('Tokenizer',             'summarize_email_prefixes'),
!     ('Tokenizer',             'summarize_email_suffixes'),
!     ('Tokenizer',             'x-pick_apart_urls'),
!     (_('Interface Options'),  None),
!     ('html_ui',               'display_adv_find'),
!     ('html_ui',               'allow_remote_connections'),
!     ('html_ui',               'http_authentication'),
!     ('html_ui',               'http_user_name'),
!     ('html_ui',               'http_password'),
  )
  
***************
*** 139,151 ****
          del statusTable.proxyDetails
          # This could be a bit more modular
!         statusTable.configurationLink += """<br />&nbsp;&nbsp;&nbsp;&nbsp;
!         &nbsp;You can also <a href='filterfolders'>configure folders to
!         filter</a><br />and <a
!         href='trainingfolders'>Configure folders to train</a>"""
!         findBox = self._buildBox('Word query', 'query.gif',
                                   self.html.wordQuery)
          if not options["html_ui", "display_adv_find"]:
              del findBox.advanced
!         content = (self._buildBox('Status and Configuration',
                                    'status.gif', statusTable % stateDict)+
                     self._buildTrainBox() +
--- 139,152 ----
          del statusTable.proxyDetails
          # This could be a bit more modular
!         statusTable.configurationLink += "<br />&nbsp;&nbsp;&nbsp;&nbsp;" \
!             "&nbsp;" + _("You can also <a href='filterfolders'>configure" \
!                          " folders to filter</a><br />and " \
!                          "<a href='trainingfolders'>Configure folders to" \
!                          " train</a>")
!         findBox = self._buildBox(_('Word query'), 'query.gif',
                                   self.html.wordQuery)
          if not options["html_ui", "display_adv_find"]:
              del findBox.advanced
!         content = (self._buildBox(_('Status and Configuration'),
                                    'status.gif', statusTable % stateDict)+
                     self._buildTrainBox() +
***************
*** 153,157 ****
                     findBox
                     )
!         self._writePreamble("Home")
          self.write(content)
          self._writePostamble()
--- 154,158 ----
                     findBox
                     )
!         self._writePreamble(_("Home"))
          self.write(content)
          self._writePostamble()
***************
*** 173,177 ****
  
      def onFilterfolders(self):
!         self._writePreamble("Select Filter Folders")
          self._login_to_imap()
          if self.imap_logged_in:
--- 174,178 ----
  
      def onFilterfolders(self):
!         self._writePreamble(_("Select Filter Folders"))
          self._login_to_imap()
          if self.imap_logged_in:
***************
*** 179,185 ****
              content = self.html.configForm.clone()
              content.configFormContent = ""
!             content.introduction = """This page allows you to change which
!             folders are filtered, and where filtered mail ends up."""
!             content.config_submit.value = "Save Filter Folders"
              content.optionsPathname = optionsPathname
  
--- 180,187 ----
              content = self.html.configForm.clone()
              content.configFormContent = ""
!             content.introduction = _("This page allows you to change " \
!                                      "which folders are filtered, and " \
!                                      "where filtered mail ends up.")
!             content.config_submit.value = _("Save Filter Folders")
              content.optionsPathname = optionsPathname
  
***************
*** 208,219 ****
              if not self.imap.connected:
                # Failed to connect.
!               content = self._buildBox("Error", None,
!                                        "Please check server/port details.")
                self.write(content)
                self._writePostamble()
                return
          if self.imap is None:
!             content = self._buildBox("Error", None,
!                                      """Must specify server details first.""")
              self.write(content)
              self._writePostamble()
--- 210,221 ----
              if not self.imap.connected:
                # Failed to connect.
!               content = self._buildBox(_("Error"), None,
!                                        _("Please check server/port details."))
                self.write(content)
                self._writePostamble()
                return
          if self.imap is None:
!             content = self._buildBox(_("Error"), None,
!                                      _("Must specify server details first."))
              self.write(content)
              self._writePostamble()
***************
*** 223,228 ****
              username = username[0]
          if not username:
!             content = self._buildBox("Error", None,
!                                      """Must specify username first.""")
              self.write(content)
              self._writePostamble()
--- 225,230 ----
              username = username[0]
          if not username:
!             content = self._buildBox(_("Error"), None,
!                                      _("Must specify username first."))
              self.write(content)
              self._writePostamble()
***************
*** 233,238 ****
                  self.imap_pwd = self.imap_pwd[0]
          if not self.imap_pwd:
!             content = self._buildBox("Error", None,
!                                      """Must specify password first.""")
              self.write(content)
              self._writePostamble()
--- 235,240 ----
                  self.imap_pwd = self.imap_pwd[0]
          if not self.imap_pwd:
!             content = self._buildBox(_("Error"), None,
!                                      _("Must specify password first."))
              self.write(content)
              self._writePostamble()
***************
*** 242,246 ****
  
      def onTrainingfolders(self):
!         self._writePreamble("Select Training Folders")
          self._login_to_imap()
          if self.imap_logged_in:
--- 244,248 ----
  
      def onTrainingfolders(self):
!         self._writePreamble(_("Select Training Folders"))
          self._login_to_imap()
          if self.imap_logged_in:
***************
*** 248,254 ****
              content = self.html.configForm.clone()
              content.configFormContent = ""
!             content.introduction = """This page allows you to change which
!             folders contain mail to train Spambayes."""
!             content.config_submit.value = "Save Training Folders"
              content.optionsPathname = optionsPathname
  
--- 250,257 ----
              content = self.html.configForm.clone()
              content.configFormContent = ""
!             content.introduction = _("This page allows you to change " \
!                                      "which folders contain mail to " \
!                                      "train Spambayes.")
!             content.config_submit.value = _("Save Training Folders")
              content.optionsPathname = optionsPathname
  
***************
*** 263,268 ****
      def onChangeopts(self, **parms):
          backup = self.parm_ini_map
!         if parms["how"] == "Save Training Folders" or \
!            parms["how"] == "Save Filter Folders":
              del parms["how"]
              self.parm_ini_map = ()
--- 266,271 ----
      def onChangeopts(self, **parms):
          backup = self.parm_ini_map
!         if parms["how"] == _("Save Training Folders") or \
!            parms["how"] == _("Save Filter Folders"):
              del parms["how"]
              self.parm_ini_map = ()

Index: Options.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -d -r1.118 -r1.119
*** Options.py  22 Nov 2004 00:26:44 -0000      1.118
--- Options.py  2 Jan 2005 05:00:40 -0000       1.119
***************
*** 26,30 ****
      True, False = 1, 0
  
! __all__ = ['options']
  
  # Grab the stuff from the core options class.
--- 26,35 ----
      True, False = 1, 0
  
! try:
!     _
[...1969 lines suppressed...]
!      _("""The username to give to the HTTP proxy when required.  If a
!      username is not necessary, simply leave blank."""),
       r"[\w]+", DO_NOT_RESTORE),
!     ("proxy_password", _("HTTP Proxy Password"), "",
!      _("""The password to give to the HTTP proxy when required.  This is
       stored in clear text in your configuration file, so if that bothers
       you then don't do this.  You'll need to use a proxy that doesn't need
!      authentication, or do without any SpamBayes HTTP activity."""),
       r"[\w]+", DO_NOT_RESTORE),
!     ("proxy_server", _("HTTP Proxy Server"), "",
!      _("""If a spambayes application needs to use HTTP, it will try to do so
       through this proxy server.  The port defaults to 8080, or can be
!      entered with the server:port form."""),
       SERVER, DO_NOT_RESTORE),
  
!     ("language", _("User Interface Language"), ("en_US",),
!      _("""If possible, the user interface should use a language from this
!      list (in order of preference)."""),
       r"\w\w(?:_\w\w)?", RESTORE),
    ),

Index: ProxyUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** ProxyUI.py  23 Dec 2004 18:14:32 -0000      1.57
--- ProxyUI.py  2 Jan 2005 05:00:40 -0000       1.58
***************
*** 74,78 ****
  import tokenizer
  import UserInterface
! from spambayes.Options import options
  from email.Iterators import typed_subpart_iterator
  
--- 74,78 ----
  import tokenizer
  import UserInterface
! from spambayes.Options import options, _
  from email.Iterators import typed_subpart_iterator
  
***************
*** 111,159 ****
  # advanced configuration page.
  adv_map = (
!     ('Statistics Options',  None),
!     ('Classifier',          'max_discriminators'),
!     ('Classifier',          'minimum_prob_strength'),
!     ('Classifier',          'unknown_word_prob'),
!     ('Classifier',          'unknown_word_strength'),
!     ('Classifier',          'use_bigrams'),
!     ('Header Options',      None),
!     ('Headers',             'include_score'),
!     ('Headers',             'header_score_digits'),
!     ('Headers',             'header_score_logarithm'),
!     ('Headers',             'include_thermostat'),
!     ('Headers',             'include_evidence'),
!     ('Headers',             'clue_mailheader_cutoff'),
!     ('Storage Options',     None),
!     ('Storage',             'persistent_use_database'),
!     ('Storage',             'cache_expiry_days'),
!     ('Storage',             'cache_use_gzip'),
!     ('Storage',             'ham_cache'),
!     ('Storage',             'spam_cache'),
!     ('Storage',             'unknown_cache'),
!     ('Tokenising Options',  None),
!     ('Tokenizer',           'mine_received_headers'),
!     ('Tokenizer',           'replace_nonascii_chars'),
!     ('Tokenizer',           'summarize_email_prefixes'),
!     ('Tokenizer',           'summarize_email_suffixes'),
!     ('Training Options',    None),
!     ('Hammie',              'train_on_filter'),
!     ('Interface Options',   None),
!     ('html_ui',             'display_headers'),
!     ('html_ui',             'display_received_time'),
!     ('html_ui',             'display_score'),
!     ('html_ui',             'display_adv_find'),
!     ('html_ui',             'default_ham_action'),
!     ('html_ui',             'default_spam_action'),
!     ('html_ui',             'default_unsure_action'),
!     ('html_ui',             'ham_discard_level'),
!     ('html_ui',             'spam_discard_level'),
!     ('html_ui',             'allow_remote_connections'),
!     ('html_ui',             'http_authentication'),
!     ('html_ui',             'http_user_name'),
!     ('html_ui',             'http_password'),
!     ('pop3proxy',           'allow_remote_connections'),
!     ('smtpproxy',           'allow_remote_connections'),
!     ('POP3 Proxy Options',  None),
!     ('pop3proxy',           'retrieval_timeout'),
  )
  
--- 111,159 ----
  # advanced configuration page.
  adv_map = (
!     (_('Statistics Options'), None),
!     ('Classifier',            'max_discriminators'),
!     ('Classifier',            'minimum_prob_strength'),
!     ('Classifier',            'unknown_word_prob'),
!     ('Classifier',            'unknown_word_strength'),
!     ('Classifier',            'use_bigrams'),
!     (_('Header Options'),     None),
!     ('Headers',               'include_score'),
!     ('Headers',               'header_score_digits'),
!     ('Headers',               'header_score_logarithm'),
!     ('Headers',               'include_thermostat'),
!     ('Headers',               'include_evidence'),
!     ('Headers',               'clue_mailheader_cutoff'),
!     (_('Storage Options'),    None),
!     ('Storage',               'persistent_use_database'),
!     ('Storage',               'cache_expiry_days'),
!     ('Storage',               'cache_use_gzip'),
!     ('Storage',               'ham_cache'),
!     ('Storage',               'spam_cache'),
!     ('Storage',               'unknown_cache'),
!     (_('Tokenising Options'), None),
!     ('Tokenizer',             'mine_received_headers'),
!     ('Tokenizer',             'replace_nonascii_chars'),
!     ('Tokenizer',             'summarize_email_prefixes'),
!     ('Tokenizer',             'summarize_email_suffixes'),
!     (_('Training Options'),   None),
!     ('Hammie',                'train_on_filter'),
!     (_('Interface Options'),  None),
!     ('html_ui',               'display_headers'),
!     ('html_ui',               'display_received_time'),
!     ('html_ui',               'display_score'),
!     ('html_ui',               'display_adv_find'),
!     ('html_ui',               'default_ham_action'),
!     ('html_ui',               'default_spam_action'),
!     ('html_ui',               'default_unsure_action'),
!     ('html_ui',               'ham_discard_level'),
!     ('html_ui',               'spam_discard_level'),
!     ('html_ui',               'allow_remote_connections'),
!     ('html_ui',               'http_authentication'),
!     ('html_ui',               'http_user_name'),
!     ('html_ui',               'http_password'),
!     ('pop3proxy',             'allow_remote_connections'),
!     ('smtpproxy',             'allow_remote_connections'),
!     (_('POP3 Proxy Options'), None),
!     ('pop3proxy',             'retrieval_timeout'),
  )
  
***************
*** 183,202 ****
          statusTable = self.html.statusTable.clone()
          if not state.servers:
!             statusTable.proxyDetails = "No POP3 proxies running.<br/>"
!         findBox = self._buildBox('Word query', 'query.gif',
                                   self.html.wordQuery)
          if not options["html_ui", "display_adv_find"]:
              del findBox.advanced
!         content = (self._buildBox('Status and Configuration',
                                    'status.gif', statusTable % stateDict)+
!                    self._buildBox('Train on proxied messages',
                                    'train.gif', self.html.reviewText) +
                     self._buildTrainBox() +
                     self._buildClassifyBox() +
                     findBox +
!                    self._buildBox('Find message', 'query.gif',
                                    self.html.findMessage)
                     )
!         self._writePreamble("Home")
          self.write(content)
          self._writePostamble(help_topic="home_proxy")
--- 183,202 ----
          statusTable = self.html.statusTable.clone()
          if not state.servers:
!             statusTable.proxyDetails = _("No POP3 proxies running.<br/>")
!         findBox = self._buildBox(_('Word query'), 'query.gif',
                                   self.html.wordQuery)
          if not options["html_ui", "display_adv_find"]:
              del findBox.advanced
!         content = (self._buildBox(_('Status and Configuration'),
                                    'status.gif', statusTable % stateDict)+
!                    self._buildBox(_('Train on proxied messages'),
                                    'train.gif', self.html.reviewText) +
                     self._buildTrainBox() +
                     self._buildClassifyBox() +
                     findBox +
!                    self._buildBox(_('Find message'), 'query.gif',
                                    self.html.findMessage)
                     )
!         self._writePreamble(_("Home"))
          self.write(content)
          self._writePostamble(help_topic="home_proxy")
***************
*** 215,219 ****
  
          # Return a link Home.
!         self.write("<p>OK. Return <a href='home'>Home</a>.</p>")
  
      def _keyToTimestamp(self, key):
--- 215,219 ----
  
          # Return a link Home.
!         self.write(_("<p>OK. Return <a href='home'>Home</a>.</p>"))
  
      def _keyToTimestamp(self, key):
***************
*** 310,314 ****
              except ValueError:
                  score = None
!             if label == 'Spam':
                  if score is not None \
                     and score > options["html_ui", "spam_discard_level"]:
--- 310,314 ----
              except ValueError:
                  score = None
!             if label == _('Spam'):
                  if score is not None \
                     and score > options["html_ui", "spam_discard_level"]:
***************
*** 317,321 ****
                      r_att = getattr(row, options["html_ui",
                                             "default_spam_action"])
!             elif label == 'Ham':
                  if score is not None \
                     and score < options["html_ui", "ham_discard_level"]:
--- 317,321 ----
                      r_att = getattr(row, options["html_ui",
                                             "default_spam_action"])
!             elif label == _('Ham'):
                  if score is not None \
                     and score < options["html_ui", "ham_discard_level"]:
***************
*** 375,387 ****
          numTrained = 0
          numDeferred = 0
!         if params.get('go') != 'Refresh':
              for key, value in params.items():
                  if key.startswith('classify:'):
                      id = key.split(':')[2]
!                     if value == 'spam':
                          targetCorpus = state.spamCorpus
!                     elif value == 'ham':
                          targetCorpus = state.hamCorpus
!                     elif value == 'discard':
                          targetCorpus = None
                          try:
--- 375,387 ----
          numTrained = 0
          numDeferred = 0
!         if params.get('go') != _('Refresh'):
              for key, value in params.items():
                  if key.startswith('classify:'):
                      id = key.split(':')[2]
!                     if value == _('spam'):
                          targetCorpus = state.spamCorpus
!                     elif value == _('ham'):
                          targetCorpus = state.hamCorpus
!                     elif value == _('discard'):
                          targetCorpus = None
                          try:
***************
*** 408,412 ****
                                                           fromCache=True)
                                  if numTrained == 0:
!                                     self.write("<p><b>Training... ")
                                      self.flush()
                                  numTrained += 1
--- 408,412 ----
                                                           fromCache=True)
                                  if numTrained == 0:
!                                     self.write(_("<p><b>Training... "))
                                      self.flush()
                                  numTrained += 1
***************
*** 417,424 ****
          if numTrained > 0:
              plural = ''
!             if numTrained != 1:
!                 plural = 's'
              self._doSave()
!             self.write("Trained on %d message%s. " % (numTrained, plural))
              self.write("<br>&nbsp;")
  
--- 417,426 ----
          if numTrained > 0:
              plural = ''
!             if numTrained == 1:
!                 response = "Trained on one message. "
!             else:
!                 response = "Trained on %d messages. " % (numTrained,)
              self._doSave()
!             self.write(response)
              self.write("<br>&nbsp;")
  
***************
*** 442,448 ****
  
          # Else if they've hit Previous or Next, display that page.
!         elif params.get('go') == 'Next day':
              start = self._keyToTimestamp(params['next'])
!         elif params.get('go') == 'Previous day':
              start = self._keyToTimestamp(params['prior'])
  
--- 444,450 ----
  
          # Else if they've hit Previous or Next, display that page.
!         elif params.get('go') == _('Next day'):
              start = self._keyToTimestamp(params['next'])
!         elif params.get('go') == _('Previous day'):
              start = self._keyToTimestamp(params['prior'])
  
***************
*** 466,470 ****
              if key == "":
                  error = True
!                 page = "<p>You must enter a search string.</p>"
              else:
                  if len(keys) < max_results and \
--- 468,472 ----
              if key == "":
                  error = True
!                 page = _("<p>You must enter a search string.</p>")
              else:
                  if len(keys) < max_results and \
***************
*** 480,484 ****
                      # This is an expensive operation, so let the user know
                      # that something is happening.
!                     self.write('<p>Searching...</p>')
                      for corp in [state.unknownCorpus, state.hamCorpus,
                                     state.spamCorpus]:
--- 482,486 ----
                      # This is an expensive operation, so let the user know
                      # that something is happening.
!                     self.write(_('<p>Searching...</p>'))
                      for corp in [state.unknownCorpus, state.hamCorpus,
                                     state.spamCorpus]:
***************
*** 510,522 ****
                                          push((k, corp))
                  if len(keys):
!                     title = "Found message%s" % (['','s'][len(keys)>1],)
                      keys = list(keys)
                  else:
!                     page = "<p>Could not find any matching messages. " \
!                            "Maybe they expired?</p>"
!                     title = "Did not find message"
                      box = self._buildBox(title, 'status.gif', page)
                      self.write(box)
!                     self.write(self._buildBox('Find message', 'query.gif',
                                                self.html.findMessage))
                      self._writePostamble()
--- 512,528 ----
                                          push((k, corp))
                  if len(keys):
!                     if len(keys) == 1:
!                         title = _("Found message")
!                     else:                      
!                         title = _("Found messages")
                      keys = list(keys)
                  else:
!                     page = _("<p>Could not find any matching messages. " \
!                              "Maybe they expired?</p>")
!                     title = _("Did not find message")
                      box = self._buildBox(title, 'status.gif', page)
                      self.write(box)
!                     self.write(self._buildBox(_('Find message'),
!                                               'query.gif',
                                                self.html.findMessage))
                      self._writePostamble()
***************
*** 616,626 ****
              page.table += self.html.trainRow
              if title == "":
!                 title = "Untrained messages received on %s" % date
              box = self._buildBox(title, None, page)  # No icon, to save space.
          else:
!             page = "<p>There are no untrained messages to display. "
!             page += "Return <a href='home'>Home</a>, or "
!             page += "<a href='review'>check again</a>.</p>"
!             title = "No untrained messages"
              box = self._buildBox(title, 'status.gif', page)
  
--- 622,632 ----
              page.table += self.html.trainRow
              if title == "":
!                 title = _("Untrained messages received on %s") % date
              box = self._buildBox(title, None, page)  # No icon, to save space.
          else:
!             page = _("<p>There are no untrained messages to display. " \
!                      "Return <a href='home'>Home</a>, or " \
!                      "<a href='review'>check again</a>.</p>")
!             title = _("No untrained messages")
              box = self._buildBox(title, 'status.gif', page)
  
***************
*** 639,643 ****
      def onView(self, key, corpus):
          """View a message - linked from the Review page."""
!         self._writePreamble("View message", parent=('review', 'Review'))
          sourceCorpus = None
          message = None
--- 645,650 ----
      def onView(self, key, corpus):
          """View a message - linked from the Review page."""
!         self._writePreamble(_("View message"),
!                             parent=('review', _('Review')))
          sourceCorpus = None
          message = None
***************
*** 653,657 ****
              self.write("<pre>%s</pre>" % cgi.escape(message.as_string()))
          else:
!             self.write("<p>Can't find message %r. Maybe it expired.</p>" % 
key)
          self._writePostamble()
  
--- 660,664 ----
              self.write("<pre>%s</pre>" % cgi.escape(message.as_string()))
          else:
!             self.write(_("<p>Can't find message %r. Maybe it expired.</p>") % 
key)
          self._writePostamble()
  
***************
*** 659,663 ****
          """Show clues for a message - linked from the Review page."""
          tokens = bool(int(tokens)) # needs the int, as bool('0') is True
!         self._writePreamble("Message clues", parent=('review', 'Review'))
          sourceCorpus = None
          message = None
--- 666,671 ----
          """Show clues for a message - linked from the Review page."""
          tokens = bool(int(tokens)) # needs the int, as bool('0') is True
!         self._writePreamble(_("Message clues"),
!                             parent=('review', _('Review')))
          sourceCorpus = None
          message = None
***************
*** 676,680 ****
              self.write(results)
          else:
!             self.write("<p>Can't find message %r. Maybe it expired.</p>" % 
key)
          self._writePostamble()
  
--- 684,688 ----
              self.write(results)
          else:
!             self.write(_("<p>Can't find message %r. Maybe it expired.</p>") % 
key)
          self._writePostamble()
  
***************
*** 721,731 ****
                  text, unused = tokenizer.crack_html_comment(text)
                  text = tokenizer.html_re.sub(' ', text)
!                 text = '(this message only has an HTML body)\n' + text
              except StopIteration:
!                 text = '(this message has no text body)'
          if type(text) == type([]):  # gotta be a 'right' way to do this
!             text = "(this message is a digest of %s messages)" % (len(text))
          elif text is None:
!             text = "(this message has no body)"
          else:
              text = text.replace('&nbsp;', ' ')      # Else they'll be quoted
--- 729,739 ----
                  text, unused = tokenizer.crack_html_comment(text)
                  text = tokenizer.html_re.sub(' ', text)
!                 text = _('(this message only has an HTML body)\n') + text
              except StopIteration:
!                 text = _('(this message has no text body)')
          if type(text) == type([]):  # gotta be a 'right' way to do this
!             text = _("(this message is a digest of %s messages)") % 
(len(text))
          elif text is None:
!             text = _("(this message has no body)")
          else:
              text = text.replace('&nbsp;', ' ')      # Else they'll be quoted
***************
*** 770,775 ****
          plist = list(parms['pop3proxy_listen_ports'])
          if len(slist) != len(plist):
!             errmsg += '<li>The number of POP3 proxy ports specified ' + \
!                       'must match the number of servers specified</li>\n'
  
          # check for duplicate ports
--- 778,783 ----
          plist = list(parms['pop3proxy_listen_ports'])
          if len(slist) != len(plist):
!             errmsg += _('<li>The number of POP3 proxy ports specified ' \
!                         'must match the number of servers specified</li>\n')
  
          # check for duplicate ports
***************
*** 778,782 ****
              try:
                  if plist[p] == plist[p+1]:
!                     errmsg += '<li>All POP3 port numbers must be unique</li>'
                      break
              except IndexError:
--- 786,790 ----
              try:
                  if plist[p] == plist[p+1]:
!                     errmsg += _('<li>All POP3 port numbers must be 
unique</li>')
                      break
              except IndexError:
***************
*** 787,792 ****
          plist = list(parms['smtpproxy_listen_ports'])
          if len(slist) != len(plist):
!             errmsg += '<li>The number of SMTP proxy ports specified ' + \
!                       'must match the number of servers specified</li>\n'
  
          # check for duplicate ports
--- 795,800 ----
          plist = list(parms['smtpproxy_listen_ports'])
          if len(slist) != len(plist):
!             errmsg += _('<li>The number of SMTP proxy ports specified ' \
!                         'must match the number of servers specified</li>\n')
  
          # check for duplicate ports
***************
*** 795,799 ****
              try:
                  if plist[p] == plist[p+1]:
!                     errmsg += '<li>All SMTP port numbers must be unique</li>'
                      break
              except IndexError:
--- 803,807 ----
              try:
                  if plist[p] == plist[p+1]:
!                     errmsg += _('<li>All SMTP port numbers must be 
unique</li>')
                      break
              except IndexError:

Index: __init__.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/__init__.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** __init__.py 23 Dec 2004 18:14:33 -0000      1.14
--- __init__.py 2 Jan 2005 05:00:41 -0000       1.15
***************
*** 1,4 ****
  # package marker.
  
  __version__ = "1.1a0"
! __date__ = "January 2005"
--- 1,9 ----
  # package marker.
  
+ try:
+     _
+ except NameError:
+     _ = lambda arg: arg
+ 
  __version__ = "1.1a0"
! __date__ = _("January 2005")

_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to