Opened 16 years ago
Closed 16 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)
Change History (7)
comment:1 by , 16 years ago
by , 16 years ago
| Attachment: | proposed_fix_for_#9319.patch added |
|---|
follow-up: 3 comment:2 by , 16 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.
comment:3 by , 16 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_unicodeline must be move after the ThreadLocal declaration intrac/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.
comment:4 by , 16 years ago
| Owner: | set to |
|---|
comment:6 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Moved concurrency primitives into trac.util.concurrency in [9668], together with the missing translation markers.



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.