Edgewall Software

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#12222 closed defect (fixed)

Bad translatable string for Pygments options config section

Reported by: Lele Gaifax Owned by: Jun Omae
Priority: normal Milestone: 1.2
Component: i18n Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed incorrect entries in pot (translation) file due to string interpolation in option description.

API Changes:

Add doc_args to pass parameters to the extracted messages to ConfigSection and Option classes.

Internal Changes:


At source:/trunk/trac/mimeview/pygments.py#L51 the description uses interpolation to inject the same URL in a couple of places: that confuses the i18n extractor, that puts a wrong entry in the pot file (see source:/trunk/trac/locale/tracini.pot#L506).

Attachments (0)

Change History (11)

comment:1 by Jun Omae, 7 years ago

Component: generali18n
Milestone: 1.2

Right. Thanks for the reporting!

Considering, how about adding doc_args to pass parameters to the extracted messages? See jomae.git@t12222.

comment:2 by Ryan J Ollos, 7 years ago

Those changes look good. Thanks for fixing.

comment:3 by Jun Omae, 7 years ago

API Changes: modified (diff)
Owner: set to Jun Omae
Status: newassigned

Thanks for the reviewing.

Additional changes:

Last edited 7 years ago by Jun Omae (previous) (diff)

comment:4 by Ryan J Ollos, 7 years ago

Would it make sense to have the doc() method be a property instead, or is there a possibility we'll need to pass parameters in the future?

comment:5 by Jun Omae, 7 years ago

Okay. I agree to use @property decorator the doc() methods. [6a422f6b8/jomae.git].

comment:6 by Jun Omae, 7 years ago

Resolution: fixed
Status: assignedclosed

Committed in [14509].

comment:7 by Jun Omae, 7 years ago

We could use parameters to jquery_location, jquery_ui_location and jquery_ui_theme_location in [trac] section like this. Extracted messages wouldn't be changed even if we upgrade the jquery or jquery-ui.

     jquery_location = Option('trac', 'jquery_location', '',
-        """Location of the jQuery !JavaScript library (version 1.11.3).
+        """Location of the jQuery !JavaScript library (version %(version)s).

         An empty value loads jQuery from the copy bundled with Trac.

         Alternatively, jQuery could be loaded from a CDN, for example:
-        http://code.jquery.com/jquery-1.11.3.min.js,
-        http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.3.min.js or
-        https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js.
+        http://code.jquery.com/jquery-%(version)s.min.js,
+        http://ajax.aspnetcdn.com/ajax/jQuery/jquery-%(version)s.min.js or
+        https://ajax.googleapis.com/ajax/libs/jquery/%(version)s/jquery.min.js.

-        (''since 1.0'')""")
+        (''since 1.0'')""", doc_args={'version': '1.11.3'})

comment:8 by Ryan J Ollos, 7 years ago

That looks like a great idea. Much simpler to edit the version number when upgrading jQuery.

comment:9 by Jun Omae, 7 years ago

Okay. Added doc_args to those options in [14510].

comment:10 by figaro, 6 years ago

Release Notes: modified (diff)

comment:11 by Ryan J Ollos, 6 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae 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.