Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

#9319 closed defect (fixed)

There is some non-localized strings in the source code

Reported by: nzoltan Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: i18n Version: 0.12dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

"bytes" at trac/util/text.py line 275

    return '%d bytes' % size

"Line" and "Line numbers" at trac/mimeview/api.py line 1074

    return 'lineno', 'Line', 'Line numbers'

"Show " at trac/htdocs/js/folding.js line 59

    .text("Show " + th.text())

Attachments (1)

proposed_fix_for_#9319.patch (1.5 KB ) - added by nzoltan 14 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Christian Boos, 14 years ago

Thanks! We already have a page for such things (MissingTranslations) … but now that you've created a ticket, I guess a patch will follow? ;-)

Note that 'lineno' is probably used for a CSS class, and should not be marked for translation.

by nzoltan, 14 years ago

comment:2 by nzoltan, 14 years ago

Patch attached, but in this form maybe breaks the trac coding rule. I mean that the patch for trac/utils/text.py introduces a chicken-egg problem. The simple fix is that from trac.util.text import to_unicode line must be move after the ThreadLocal declaration in trac/util/__init__.py, otherwise the trac gets an ImportError exception:

Traceback (most recent call last):
  File "/usr/bin/tracd", line 7, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 277, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2179, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1912, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.4/site-packages/trac/web/__init__.py", line 17, in ?
    from trac.web.api import *
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 31, in ?
    from trac.util import get_last_traceback, md5, unquote
  File "/usr/lib/python2.4/site-packages/trac/util/__init__.py", line 40, in ?
    from trac.util.text import to_unicode
  File "/usr/lib/python2.4/site-packages/trac/util/text.py", line 27, in ?
    from trac.util.translation import _
  File "/usr/lib/python2.4/site-packages/trac/util/translation.py", line 21, in ?
    from trac.util import ThreadLocal, threading
ImportError: cannot import name ThreadLocal

My fix is ugly, but I can't better solve this problem.

The format character in utils/text.py also changed from d to s, because '%(size)s bytes' already exists (and translated) in some place of code but '%(size)d bytes' is brand new.

Last edited 14 years ago by nzoltan (previous) (diff)

in reply to:  2 comment:3 by Remy Blank, 14 years ago

Replying to nzoltan:

Patch attached, but in this form maybe breaks the trac coding rule. I mean that the patch for trac/utils/text.py introduces a chicken-egg problem. The simple fix is that from trac.util.text import to_unicode line must be move after the ThreadLocal declaration in trac/util/__init__.py, otherwise the trac gets an ImportError exception:

Yes, I don't like that either. I was tempted to move ThreadLocal and the imports of threading into a separate trac.util.thread module at some point, so that we don't have to import all trac.util into trac.util.translation. I guess I'll just do that.

in reply to:  description comment:4 by Christian Boos, 14 years ago

Owner: set to Remy Blank

Replying to nzoltan:

"Show " at trac/htdocs/js/folding.js line 59

… and translation of Javascript texts is a whole domain in its own ;-) See #6353.

Remy, from comment:3 I suppose you'll take care of this ticket?

comment:5 by Remy Blank, 14 years ago

Yes, I will. Forgot to reassign.

comment:6 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Moved concurrency primitives into trac.util.concurrency in [9668], together with the missing translation markers.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.