[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
separate_translation patch 0.1
separate_translation patch 0.1
Tue, 6 Mar 2007 02:21:36 +0100 (CET)
hi samizdat-devel, imc-japan, [crosspost - すみません]
This is a patch which i think IMC Japan might want to use, until (if)
something similar gets put into the main samizdat code.
The reason i wrote it is that people in IMC Japan want to be able to
have a strong separation between the english and japanese versions of
the pages that users see, because users are frustrated by the present
cms (dada). (IMC Japan is looking around for a new cms and considering
PROBLEM: The problem is that in the "Recent Updates" column on the
right-hand side of the front page, translated articles appear with the
title in the user's preferred language (this is good, it is not a
problem). However, if the user clicks on this title instead of looking
for the "xx" link, where "xx" is his/her preferred language, then s/he
gets a page which is the "parent" (original) article and s/he might
not realise that s/he can scroll down to find the translation in
his/her language. This could be discouraging to people, even though
it's good for encouraging multilinguality.
PATCH: The five line patch below changes the link to be the link to
the preferred language translation, *even if this is a comment rather
than an article*. In other words, this patch links directly to a
translation rather than to the parent original, especially for the
right-hand column of the front page. For users expecting to see the
article in their language, not just a title in their language, this
patch should make them feel more comfortable.
ENABLING THE PATCH:
The patch only functions if "separate_translations: " has some
value in one of the yaml config files. See below for an example.
DISADVANTAGES OF THE PATCH:
However, unless the user chooses to click on "parent" and add his/her
comments to the parent, then his/her comments will only appear as
replies to a comment, and not as replies to the main parent
article. This may leading to branching off of the threads of a
discussion, especially it may generate parallel discussions in
different languages which do not meet.
COUNTERARGUMENT: When a thread display of discussions is introduced in
future versions, this may not be a major problem, since it will be
visually more obvious.
Another disadvantage is that a link to the original language disappears
from the Recent Updates entry, if the user's preferred language is a
different language and the translation in that language is available.
Is this really a huge problem? The reader prefers another language to
the original one anyway, and once s/he has clicked on the link, s/he
can go to the "parent", which is the original translation. IMHO this is
at least a functional hack until something better comes along.
IMHO, having parallel discussion threads on what the user perceives as
"different pages" is probably what IMC Japan wants, and personally,
i did get confused by clicking on a title which appeared to be in my
preferred language and then seeing that it seemed to have failed (because
i had to scroll down the page to find the preferred language).
On the other hand, i think that multilingual comments are probably
better, or there could probably be some better general solutions.
i'm sure dmitry has something in mind... :)
Anyway, nobody's being forced to use the patch.
i've enabled this patch on http://samizdat.axxs.org
original (parent) article (ja):
" 公開シンポジウム『寄せ場労働者・ホームレスの「生きる場所」はどこに？』 "
translation (comment) (en):
"symposium related to homeless people"
Someone with (en) preference starting from the front page will find
the english title, click and read, and will not be "frightened" by
the Japanese version. And someone with (ja) preference gets the
(ja) parent article anyway.
--- old/lib/samizdat/engine/resource.rb 2007-02-02 22:57:24.000000000 +0100
+++ /usr/lib/ruby/1.8/samizdat/engine/resource.rb 2007-03-06
@@ -84,8 +84,19 @@
r[:head] = CGI.escapeHTML(Template.limit_string(r[:head]))
:title == mode and return cache[cache_key] = r[:head]
+ # separate-translation PATCH:
+ # - link directly to translation rather than to parent original
+ # - warning: comment threads risk branching and separating by language
+ if config['separate_translations'] and :list == mode
+ message = Message.cached(@id, @session.showhidden?)
+ translation = message.select_translation(@session.accept_language)
+ return cache[cache_key] = template.resource(translation.id, r[:head],
:list == mode and return cache[cache_key] = template.resource(id,
r[:focuses] = render_focuses if :full == mode
class << r
--- old/data/samizdat/config.yaml 2007-02-18 15:17:22.000000000 +0100
+++ /etc/samizdat/sites/config.yaml 2007-03-06 01:23:17.845694104 +0100
@@ -139,1 +139,31 @@
+# separate-translation PATCH:
+# This patch links directly to a translation rather than to the parent
+# especially for the right-hand column of the front page. For users expecting
+# to see the article in their language, not just a title in their language,
+# this patch should make them feel more comfortable.
+# However, unless the user chooses to click on "parent" and add his/her
+# to the parent, then his/her comments will only appear as replies to a
+# and not as replies to the main parent article. This may leading to branching
+# off of the threads of a discussion, especially it may generate parallel
+# in different languages which do not meet. When a thread display of
+# is introduced in future versions, this may not be a major problem.
+# UNcomment the line below to ENable this patch. By default it is disabled.
+# To DISable the patch, comment out the line entirely.
+# separate_translations: true
- separate_translation patch 0.1,