Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#4952 closed Feature/Enhancement Request (fixed)

provide internationalization for trac webapp running https://support.mayfirst.org/

Reported by: Ross Owned by: Daniel Kahn Gillmor
Priority: High Component: Tech
Keywords: trac internationalization support.mayfirst.org Cc:
Sensitive: no

Description

Hi dkg,

If you could begin working on upgrading trac to version .12 so that we can do Spanish translations for the wiki, we'd very much appreciate it. There are a couple of links at the bottom of this page that might help Laneta transition?.

thanks,

~/ross

Change History (15)

comment:1 Changed 7 years ago by Ross

grr...and I was trying not to create a broken link!

https://support.mayfirst.org/wiki/projects/laneta-transition/tech-details

comment:2 Changed 7 years ago by Daniel Kahn Gillmor

is there any particular trac installation that you want upgraded? are we talking about support.mayfirst.org here?

comment:3 Changed 7 years ago by Ross

I'm pretty sure if you read the bottom of the wiki link I posted you'll see it says support.mayfirst.org ... so no I would rather you not just arbitrarily choose a trac instance to upgrade and more focus on the internationalization needed for May First/People Link support.

Localizing support.mayfirst.org

    The trac interface has  localization infrastructure starting with version .12. Although we're currently running 0.11, 0.12 is  available in squeeze backports. There also seems to be progress in creating a  translation file for es_ES.
    In addition, there is a plugin to assist with translating wiki pages called  TranslatedPagesMacro. 

comment:4 Changed 7 years ago by Daniel Kahn Gillmor

Keywords: support.mayfirst.org added

testing ticket comment modification

Last edited 7 years ago by Daniel Kahn Gillmor (previous) (diff)

comment:5 Changed 7 years ago by Daniel Kahn Gillmor

Status: newassigned

OK, thanks for the clarification. I'll have a look into this.

comment:6 Changed 7 years ago by Daniel Kahn Gillmor

I'm going to begin the process by running some overdue package updates on moses, which might cause a minute or two of downtime.

comment:7 Changed 7 years ago by Daniel Kahn Gillmor

OK, those are done, i'm backing up the database and looking into the upgrade now.

comment:8 Changed 7 years ago by Daniel Kahn Gillmor

OK, https://support.mayfirst.org/ is now running trac 0.12 from squeeze-backports.

I note that one of the recommended packages for this version is DebianPackage:python-babel, which is only available in squeeze as DebianPackage:python-pybabel. I've gone ahead and installed python-pybabel 0.9.4-2 on moses. if we need something more recent, i can look into backporting python-babel 0.9.6 to squeeze. But i'd rather not do the maintenance on that, so if we can work with the squeeze versions, that'd probably be better.

The site upgrade went like this:

0 moses:~# cat > /etc/apt/sources.list.d/squeeze-backports.list  <<EOF
> # added for trac backport (see https://support.mayfirst.org/ticket/4952)
> deb http://backports.debian.org/debian-backports squeeze-backports main
> EOF
0 moses:~# apt-get update
 [...]
Reading package lists... Done
0 moses:~# apt-get install trac/squeeze-backports
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '0.12.2-1~bpo60+1' (Debian Backports:squeeze-backports [all]) for 'trac'
Suggested packages:
  libapache2-mod-wsgi python-textile trac-git trac-spamfilter trac-bzr trac-mercurial trac-accountmanager trac-email2trac trac-xmlrpc trac-wysiwyg trac-mastertickets
  trac-customfieldadmin trac-bitten trac-authopenid trac-graphviz trac-wikirename trac-wikiprint trac-ja-resource
Recommended packages:
  python-babel
The following packages will be upgraded:
  trac
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/868 kB of archives.
After this operation, 509 kB of additional disk space will be used.
(Reading database ... 36002 files and directories currently installed.)
Preparing to replace trac 0.11.7-4 (using .../trac_0.12.2-1~bpo60+1_all.deb) ...
Unpacking replacement trac ...
Processing triggers for man-db ...
Setting up trac (0.12.2-1~bpo60+1) ...
0 moses:~# su - www-data -c 'trac-admin /srv/trac/support/'
Welcome to trac-admin 0.12.2
Interactive Trac administration console.
Copyright (C) 2003-2011 Edgewall Software

Type:  '?' or 'help' for help on commands.
        
Trac [/srv/trac/support]> upgrade
OSError: [Errno 13] Permission denied: '/srv/trac/support/conf/trac.ini.sample-KfPicN'
Trac [/srv/trac/support]> upgrade
Database is up to date, no upgrade necessary.
Trac [/srv/trac/support]> 

Presumably the upgrade script wanted to re-write some modified version of the trac.ini file, but since www-data doesn't have write permission on its configuration it couldn't. When i tried backing up the trac.ini file and granting www-data write access, i got the "Database is up to date, no upgrade necessary" message. So it doesn't look like it wants to upgrade the file a second time (and it seems to work with the old config file). I've changed the permissions back so www-data can't write to that file.

However, i feel like the visual layout of the pages got a little janky during the upgrade, so i'm going to leave this ticket open until i can sort out the changes to the templates.

comment:9 Changed 7 years ago by Daniel Kahn Gillmor

OK, i just updated /srv/trac/support/templates/ticket.html so that it minimizes its differences from the 0.12.2-shipped template. The changes i carried forward are:

--- /usr/share/pyshared/trac/ticket/templates/ticket.html       2011-01-31 17:05:46.000000000 -0500
+++ ticket.html 2011-12-05 00:07:29.000000000 -0500
@@ -363,7 +363,7 @@
             <table>
               <tr>
                 <th>
-                  <label for="author">Your email or username:</label><br />
+                  <label for="author">Your email address: <br/><i style="font-size:smaller;">(Are you an MF/PL member?<br/> You might prefer to <a href="/login">log in first</a>)</i></label><br />
                 </th>
                 <td>
                   <input type="text" id="author" name="author" size="40" value="$author_id" />
@@ -400,6 +400,11 @@
 
       </form>
 
+      <!-- added by Jamie - to avoid new tickets being created -->
+      <div py:if="authname == 'anonymous'" >
+        <p>Please <a href="/login">login</a> to add comments to this ticket.</p>
+      </div>
+
       <div id="help" i18n:msg="">
         <strong>Note:</strong> See
         <a href="${href.wiki('TracTickets')}">TracTickets</a> for help on using

I only updated the header of /srv/trac/support/templates/site.html since that apparently doesn't have a system-wide counterpart (see site.html documentation).

I'd prefer to have our ticket.html changes placed directly in site.html, since carrying them forward in the current implementation seems prone to breakage, but i haven't sorted out how to do that yet.

One interesting consequence of this upgrade is apparently that authenticated users can now modify their old comments.

comment:10 Changed 7 years ago by Daniel Kahn Gillmor

Resolution: fixed
Status: assignedclosed

comment:11 Changed 7 years ago by Daniel Kahn Gillmor

I just made one other change to the ticket template: in the stock template, the set of workflow changes (changing state of the ticket) are hidden within the "Modify Ticket" collapsible div. I moved them just above that div, so that they're more visible. If people would prefer to hide them, we can tuck them back into the "Modify Ticket" section.

comment:12 Changed 7 years ago by Jamie McClelland

Great work dkg!

btw - I had to clear my browser cache for the comment field to appear properly (cached css settings). Before clearing my cache, the comment field was just one pixel wide.

Nice live preview of comments now.

jamie

comment:13 Changed 7 years ago by Daniel Kahn Gillmor

Resolution: fixed
Status: closedassigned
Summary: Need trac upgraded for Internationalizationprovide internationalization for trac webapp running https://support.mayfirst.org/

Sigh. digging deeper, i see that debian's trac package doesn't provide translations properly. I've sent in a patch for that for unstable.

I note that trac 0.12.2 wants babel 0.9.5 for translations to work properly, so i'm also looking into backporting python-babel.

I'm re-opening this bug report because while the request has been fulfilled, the intent behind the request (internationalization support for the webapp running https://support.mayfirst.org/) has not.

comment:14 Changed 7 years ago by Daniel Kahn Gillmor

Resolution: fixed
Status: assignedclosed

I backported python-babel and asked if there were objections to making this an official backport (i hope to upload it in a day or two if there are no objections). Then, using this backport, i built a new backported trac 0.12.2 instance (including my fix for 644401, so that new package now includes the localizations as well.

I've installed both of these backports onto moses, and restarted apache.

Now, if you configure your web browser to prefer spanish (e.g. Preferences→Content→Languages in Iceweasel or Firefox), you should see the trac UI elements in spanish. If your web browser is crappy enough to not be able to indicate your preferred choice of languages, you can also force the matter with a preference within your trac session.

comment:15 Changed 6 years ago by http://pierre22.myopenid.com/

Same fix applies to the French version, managed to solve it through this tutorial, thanks.

Kind regards, Pierre D'Espard @Paris 9 demandes services

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.