Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11250 closed defect (fixed)

malformed langauge tag in timeline rss if locale with no territory

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: timeline Version: 0.12-stable
Severity: minor Keywords: rss
Cc: Ryan J Ollos
Release Notes:

Fix malformed language tag in timeline rss if locale with no territory, e.g. de, ja.

API Changes:

Description (last modified by Jun Omae)

If locale with no territory, timeline rss has malformed langauge tag like this.

<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>0.12-stable ††</title>
    <link>http://localhost/timeline</link>
    <description>Trac Timeline</description>
    <language>ja-None</language>
    <generator>Trac 0.12.5</generator>
    <image>
      <title>0.12-stable ††</title>
      <url>http://localhost/chrome/common/trac_banner.png</url>
      <link>http://localhost/timeline</link>
    </image>
    <item>
...
  • trac/timeline/templates/timeline.rss

    index 2836ac7..50897ca 100644
    a b  
    66    <title>${project.name}</title>
    77    <link>${abs_href.timeline()}</link>
    88    <description>Trac Timeline</description>
    9     <language>${req.locale and \
    10                 '%s-%s' % (req.locale.language, req.locale.territory) or \
    11                 'en-US'}</language>
     9    <language>${locale and str(locale).replace('_', '-') or 'en-US'}</language>
    1210    <generator>Trac ${trac.version}</generator>
    1311    <image py:if="chrome.logo.src_abs">
    1412      <title>${project.name}</title>

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by Jun Omae

Owner: set to Jun Omae
Status: newassigned

comment:2 Changed 5 years ago by Ryan J Ollos

Cc: Ryan J Ollos added

I tried out the change and it works well with Babel 0.9.6 and Python 2.4/0.12-stable, Python 2.5/1.0-stable.

I don't know that this matters, but I noticed that the territories in the standard-language codes linked from the w3 site are lowercase, whereas Babel outputs them in uppercase.

comment:3 Changed 5 years ago by Jun Omae

Severity: normalminor

Thanks for the feedback.

The language tag in rss 2.0 have one of ISO 639 language codes, e.g. en, or a pair of ISO 639 language code and ISO 3166 country code, .e.g. en-US. Normally, a rss application treats as case-insensitive, or does not use it ;-)

Also, I think that Babel for the identifiers follows "2.1.1. Formatting of Language Tags" in RFC 5646 - Tags for Identifying Languages.

comment:4 Changed 5 years ago by Jun Omae

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Applied in [11856] and merged in [11857-11858].

comment:5 Changed 5 years ago by Jun Omae

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
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.