Modify

Opened 14 years ago

Closed 13 years ago

Last modified 21 months ago

#8813 closed defect (fixed)

German documents of options is leaked when browser's locale is other than 'de'

Reported by: Jun Omae Owned by: Steffen Hoffmann
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords: i18n Python doc
Cc: Trac Release: 0.12

Description

Reproduce

  1. Launch tracd.
  2. Add 'de' locale to the browser langauage settings. (Accept-Language: de,ja,en;q=0.7,en-us;q=0.3)
  3. Access wiki:TracIni, hash_method's document is Standard-Hash-Typ für neue/aktualisierte Kennwörter.
  4. Remove 'de' locale from the browser languages settings. (Accept-Language: ja,en;q=0.7,en-us;q=0.3)
  5. Reload the page of wiki:TracIni. hash_method's document is still German.

_ (gettext) method must not be used at the doc keyword argument of Option family. In trunk, the documents of options can be translated.

See http://trac.edgewall.org/ticket/9666.

Attachments (1)

t8813.diff (5.2 KB) - added by Jun Omae 13 years ago.
using N_ and gettext patch based on r10315

Download all attachments as: .zip

Change History (11)

comment:1 in reply to:  description ; Changed 14 years ago by Steffen Hoffmann

Keywords: i18n Python doc added
Status: newassigned

Replying to jun66j5:

Reproduce

Confirmed.

_ (gettext) method must not be used at the doc keyword argument of Option family. In trunk, the documents of options can be translated.

See http://trac.edgewall.org/ticket/9666.

Thanks for the link. I was not aware of that development, but it's very good to know. So we'll need some special code for 0.13, since current stable doesn't know about get_l10n_trac_cmdclass(), right?

There are some more occurances, that I'll correct as well on next occasion.

comment:2 in reply to:  1 Changed 14 years ago by Jun Omae

Replying to hasienda:

Thanks for the link. I was not aware of that development, but it's very good to know. So we'll need some special code for 0.13, since current stable doesn't know about get_l10n_trac_cmdclass(), right?

Right, However plugin's author never use get_l10n_trac_cmdclass(), cause the function is only for tracini.pot of Trac.

In plugins for Trac 0.13 and later, we'll need to change setup.py to extract options' doc.

Index: setup.py
===================================================================
@@ -16,7 +16,7 @@
     if cmdclass:
         extra['cmdclass'] = cmdclass
         extractors = [
-            ('**.py',                'python', None),
+            ('**.py',                'trac.dist:extract_python', None),
             ('**/templates/**.html', 'genshi', None),
         ]
         extra['message_extractors'] = {

The function trac.dist:extract_python can extract the messages of keyword arguments and it extracts options' doc.

See trac:source:trunk/trac/dist.py@10617#L61.

Changed 13 years ago by Jun Omae

Attachment: t8813.diff added

using N_ and gettext patch based on r10315

comment:3 Changed 13 years ago by Jun Omae

I just create a patch, t8813.diff.

In the patch, it uses N_ instead of _ in Options' doc keyword argument and translates Options' document using gettext.

comment:4 Changed 13 years ago by Steffen Hoffmann

I didn't recognize, it's already Christmas. ;-)

I was about to start working on this issue. Thanks a bunch for your support. I'll test and commit this ASAP.

comment:5 Changed 13 years ago by Steffen Hoffmann

I've test this and it works well with existing translations.

You're always two steps ahead with i18n issues, I feel honored for your cooperation supporting this plugin (and others as well), and I enjoy it a lot.

comment:6 Changed 13 years ago by Steffen Hoffmann

(In [10332]) AccountManagerPlugin: Change translation method for password store docs, refs #8813.

And again I owe Jun Omae a grateful heart for contributing this solution.

comment:7 Changed 13 years ago by Steffen Hoffmann

(In [10339]) AccountManagerPlugin: Add another import missing from changeset [10332], refs #8813.

Some additional changes are added to propagate recent code style here too.

comment:8 Changed 13 years ago by anonymous

Trac is important

comment:9 in reply to:  8 Changed 13 years ago by Steffen Hoffmann

Replying to anonymous:

Trac is important

Fine (and the message is what?) - we wouldn't put such effort into it's plugins otherwise.

comment:10 Changed 13 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

(In [10393]) AccountManagerPlugin: Releasing version 0.3, pushing development to 0.4.

This new feature release finally propagates a number of solutions into an official release, after some time of testing with trunk, so explicitely closes #442, #816, #2966, #3989, #4160, #6821, #7111, #8534, #8549, #8663, #8813, #8892, #8925, #8936 and #8939.

Should have made this months ago, but felt so many pending issues were too bad for a new release. But it has been a tremendous ticket burndown since last year, so it's really worth considering an upgrade now. See fresh changelog for details.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.