Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#5560 closed Task/To do item (fixed)

TranslatedPages plugin for Trac on https://support.mayfirst.org

Reported by: Ross Owned by: Daniel Kahn Gillmor
Priority: Medium Component: Tech
Keywords: internationalization support.mayfirst.org trac debian-packaging Cc: internationalization@…, joseph@…
Sensitive: no

Description

I think there are two plugins we need to re-inject into our discussion about internationalization.

http://trac-hacks.org/wiki/TranslatedPagesMacro -- This creates an interface specifically for wiki translations.

http://trac-hacks.org/wiki/GoogleTranslatePlugin -- This makes a javascript api call to google, but dkg and I think we could rework the plugin to use a free translation tool, maybe running on our servers.

~/ross

Change History (13)

comment:1 Changed 7 years ago by Ross

Owner: set to Enrique Rosas
Status: newassigned

comment:2 Changed 7 years ago by Daniel Kahn Gillmor

TranslatedPagesMacro seems like it might be quite useful, but it also seems to presume that english is the source language and all other pages are derivatives from the source language.

If a fix is made only to a spanish page, it's not clear how that fix would get propagated back to the english page.

This seems suboptimal from a language-justice perspective, but it is still a clear improvement over our current all-english situation.

comment:3 Changed 7 years ago by Enrique Rosas

dkg, I totally agree in the perspective, and in the interpretation that suggest modifying and additing TranslatedPagesMacro could be an improvement. Hacking the plugin sounds so interesting. I will take a look at the documentation of both plugins and get back here with comments.

comment:4 in reply to:  3 ; Changed 7 years ago by Daniel Kahn Gillmor

Replying to https://id.mayfirst.org/erq:

modifying and additing TranslatedPagesMacro could be an improvement.

I'm not sure what additing means -- do you mean "editing"?

I'm going to call the issue i raised above the "English-primacy flaw".

I agree that if we could modify the TranslatedPagesMacro to remove the English-primacy flaw, it would be great. In particular, i imagine we'd want something like a "shared-primacy" arrangement, but i don't really know how that would work, even without looking at the code.

Brainstorming a desired workflow that does not include the English-primacy flaw might be a better way to begin, rather than jumping straight into the code of an existing plugin that already has the flaw.

With the current TranslatedPagesMacro plugin, i think the workflow in a bilingual (en-es) setup would go something like this:

  • english wiki page gets marked in need of translation to spanish
  • bilingual contributor creates spanish version of the page
  • english wiki page updated
  • bilingual contributor notices version difference between english and spanish, and updates the spanish version.

if a spanish-speaking contributor updates the spanish page with substantive changes, those changes will get lost on the translation of the next english revision (and the english version wouldn't get those substantive changes ever!)

The simplest modification of the workflow above to support bidirectional translation adds the following two steps:

  • spanish wiki page updated
  • bilingual contributor notices version difference between english and spanish, updates the english version.

but this creates an infinite loop, as each update of a version is effectively an update that the system will think is in need of another translation. So we need some workflow that is at least slightly more complex.

Can you propose a workflow that would work for the bilingual case without giving any particular language primacy?

Does that same workflow function for the case of more than 2 languages?

Can we think of a workflow for this with a minimalist user experience so that our members who are willing to translate don't have to become database experts or form wranglers?

note also that the tags plugin might be helpful here as a way of marking ephemeral state about a given wiki page.

comment:5 in reply to:  4 Changed 7 years ago by Enrique Rosas

Replying to https://id.mayfirst.org/dkg:

Replying to https://id.mayfirst.org/erq:

modifying and additing TranslatedPagesMacro could be an improvement.

I'm not sure what additing means -- do you mean "editing"?

Sorry, I meant adding, adding the TranslatedPagesMacro plugin could be an improvement.

Can you propose a workflow that would work for the bilingual case without giving any particular language primacy?

I think the best person to respond with alternatives and propose a design of a workflow that meets our pollitical definitions in a practical way is Roberto, I will make sure he is aware of this discusion.

comment:6 Changed 7 years ago by Joseph

Cc: joseph@… added

comment:7 Changed 7 years ago by Ross

Owner: changed from Enrique Rosas to Daniel Kahn Gillmor
Type: Bug/Something is brokenTask/To do item

Tonight Enrique and I installed the TranslatedPagesMacro on our trac installation. We can now offer a language switcher on our wiki pages by creating a page in the form of PageName.Es and adding [[TranslatedPages]] to the top of each of the pages.

I suppose dkg should review the installation, as I wasn't exactly sure if I approached it the way he would have. I'm assigning this to dkg for review. I used easy_install so the plugin files are currently in two places

0 moses:/usr/local/lib/python2.6/dist-packages/TranslatedPages-1.0-py2.6.egg# ls
EGG-INFO  translatedpages
0 moses:/usr/local/lib/python2.6/dist-packages/TranslatedPages-1.0-py2.6.egg# 

and

0 moses:/srv/trac/support/plugins# ls -l
total 72
-rw-r--r-- 1 root root   927 Dec 12  2010 emailnotsetwarning.py
-rw-r--r-- 1 root root  1412 Jan 13 14:27 emailnotsetwarning.pyc
-rw-r--r-- 1 root root   989 Dec 12  2010 emailorloginrequired.py
-rw-r--r-- 1 root root  1375 Jan 13 14:27 emailorloginrequired.pyc
-rw-r--r-- 1 root root  3752 Feb 28 17:06 scheduledworkflow.py
-rw-r--r-- 1 root root  4880 Apr  5 09:23 scheduledworkflow.pyc
-rwxr-xr-x 1 root root 21048 Jun 20 22:32 translatedpages.py
-rw-r--r-- 1 root root 18388 Jun 20 22:32 translatedpages.pyc
0 moses:/srv/trac/support/plugins# 

I just wasn't sure of the correct approach for installing the plugins.

~/ross

Last edited 7 years ago by Ross (previous) (diff)

comment:8 Changed 7 years ago by Ross

Also we modified the trac.ini to allow for PageName.Es construct, that modification is:

[translatedpages]
template = {page}.{lang}

comment:9 Changed 6 years ago by Daniel Kahn Gillmor

urgh, i'm just noticing this now.

Please never use easy_install as root on a Mayfirst server. I believe that this fetches code without verification over the internet and executes it as the superuser. This is a really bad idea.

I'm going to clean out /usr/local/lib/python2.6/dist-packages entirely. Hopefully easy_install didn't touch anything else on moses.

Looking at upstream's code, it appears to me that there are a couple small updates that have happened since this install, and we're not keeping up with them.

I think the right way to go here is to package the TranslatedPagesMacro plugin for debian, so i've filed an ITP bug for the package, and i'm preparing an upload now.

If it seems successful, i'll backport that package to squeeze, and then install the backported version on moses.

comment:10 Changed 6 years ago by Daniel Kahn Gillmor

I did the cleanup this way:

0 moses:~# tar cz /usr/local/lib/python2.6/dist-packages > tickets/5560/easy_install_cleanup.tgz
tar: Removing leading `/' from member names
0 moses:~# rm -rf /usr/local/lib/python2.6/dist-packages/*
0 moses:~# 

Then i installed the backported package and moved the other plugin out of the way and restarted apache:

0 moses:~# dpkg --install tickets/5560/trac-translatedpages_1.0~svn11919-1~bpo60+1_all.deb 
Selecting previously deselected package trac-translatedpages.
(Reading database ... 39341 files and directories currently installed.)
Unpacking trac-translatedpages (from .../trac-translatedpages_1.0~svn11919-1~bpo60+1_all.deb) ...
Setting up trac-translatedpages (1.0~svn11919-1~bpo60+1) ...
0 moses:~# mv /srv/trac/support/plugins/translatedpages.py
translatedpages.py   translatedpages.pyc  
0 moses:~# mv /srv/trac/support/plugins/translatedpages.py* tickets/5560/
0 moses:~# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .
0 moses:~# 

comment:11 Changed 6 years ago by Daniel Kahn Gillmor

Keywords: support.mayfirst.org trac added
Summary: Two Plugins for Trac TranslationTranslatedPages plugin for Trac on https://support.mayfirst.org

Weirdly, this fix meant that i needed to adjust trac.ini -- i'm not sure why. In the [components] section, i needed to change:

--- conf/trac.ini~
+++ conf/trac.ini
@@ -31,5 +31,5 @@ tracspamfilter.filters.session.* = disabled
 sensitivetickets.* = enabled
 tractags.* = enabled
-translatedpagesmacro.* = enabled
+translatedpages.* = enabled
 graphviz.* = enabled
 

with that change, things are running again, and the code in question is being tracked in debian.

comment:12 Changed 6 years ago by Daniel Kahn Gillmor

Resolution: fixed
Status: assignedclosed

This is now done.

comment:13 Changed 6 years ago by Daniel Kahn Gillmor

Keywords: debian-packaging added

trac-translatedpages is now in debian unstable.

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.