Ticket #8813 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: jun66j5 Assigned to: hasienda
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

t8813.diff (5.2 kB) - added by jun66j5 on 06/19/11 16:57:32.
using N_ and gettext patch based on r10315

Change History

(in reply to: ↑ description ; follow-up: ↓ 2 ) 05/19/11 19:47:13 changed by hasienda

  • keywords set to i18n Python doc.
  • status changed from new to assigned.

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.

(in reply to: ↑ 1 ) 05/22/11 17:41:22 changed by jun66j5

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.

06/19/11 16:57:32 changed by jun66j5

  • attachment t8813.diff added.

using N_ and gettext patch based on r10315

06/19/11 16:58:32 changed by jun66j5

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.

06/19/11 23:21:42 changed by hasienda

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.

06/19/11 23:50:09 changed by hasienda

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.

06/19/11 23:53:47 changed by hasienda

(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.

06/20/11 22:31:37 changed by hasienda

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

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

(follow-up: ↓ 9 ) 07/02/11 18:47:07 changed by anonymous

Trac is important

(in reply to: ↑ 8 ) 07/02/11 19:52:41 changed by hasienda

Replying to anonymous:

Trac is important

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

07/07/11 22:19:25 changed by hasienda

  • status changed from assigned to closed.
  • resolution set to fixed.

(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.


Add/Change #8813 (German documents of options is leaked when browser's locale is other than 'de')




Change Properties
Action