Using latest dev versions of core, i18n and all other modules...

Steps to reproduce this:

  • Enable core forum module in a multilanguage site
  • Move the 'New forum topics' block to a visible region
  • Add a title to the default language (en) title of the block ('New forum topics' is just fine)
  • Enable translation of block title and hit the 'Save and translate' button
  • Translate the block's title to another language

Expected result: block's title should be translated when users switch between site languages.
Actual result: block's title remains the same (en) for all the site languages.

I initially thought that this won't work until the block has some actual content in it, so I went on to add a forum topic. The topic got listed in the block after save, but only in the default language (expected). I then translated the forum to another language and saved it. Switching the site language to the translation shows the block with the default (en) title and no topic is listed there.

Comments

klonos’s picture

Title: The 'New forum topics' block is not being translated and new translated topics aren't listed. » 'New forum topics' block WTF
Category: bug » support
Priority: Major » Normal

OK, I'm changing this to a support request and I need to stress that this happens only with the 'New forum topics' block - all other blocks work just fine...

I did something random, like editing a test forum topic and saving it and now the block's title is displayed in the proper translation when switching languages(???). Still, I have a remaining WTF... Now, instead of not listing any forum topics at all, both translations of the same topic show up regardless of the selected site language.

Consider this:

- node/20 is the source language (en) of a forum topic node.
- node/21 is the Italian translation of node20

When the site is in English (http://www.my-site.net/en) the block is like so:

English block title
- node 21 title (it) with link being: http://www.my-site.net/en/node/21
- node 20 title (en) with link being: http://www.my-site.net/en/forum/node-20-title

I would expect only the second link to be shown, since the site is switched to en.

When the site is in Italian (http://www.my-site.net/it) the block is like so:

Italian block title
- node 21 title (it) with link being: http://www.my-site.net/it/forum/node-21-title
- node 20 title (en) with link being: http://www.my-site.net/it/node/20

I would expect only the first link to be shown, since the site is switched to it.

Anyone has any idea what I might be doing wrong and why the block had the behavior I initially described in this issue's summary?

jose reyero’s picture

The reason may be block caching.

(Not very helpful issue title btw)

klonos’s picture

Title: 'New forum topics' block WTF » 'New forum topics' lists all translations of topics - no matter what language the site is switched to.
Category: support » bug

Thanx for taking the time to reply Jose. Yep, I know better than that. Here's a less vague issue title.

I have left this functionality of the site aside in the meantime so I can focus on other things. After so many times I run cron and emptied cache, shouldn't by now cache not be a "suspect" for this?

Block caching should explain the issue of the title not being displayed in its translated version. What about the fact that the block lists both (all if the site has more languages) the forum topic source and its translation(s), ignoring the current language? I actually tried this:

- Under /admin/config/regional/language/configure I've enabled the "URL" detection method for content (before only "Interface" was enabled).
- I made sure that "Use the detected interface language." came as a second/fallback option.
- I made sure that the preferred method (URL) uses path prefix to determine switched site language and thus present content accordingly.

In other words, I've configured site content to:

- display English content when the site's URL has a "en" prefix (http://www.mysite/en/...)
- display Italian content when the site's URL has a "it" prefix (http://www.mysite/it/...)

Still no magic :/

klonos’s picture

Title: 'New forum topics' lists all translations of topics - no matter what language the site is switched to. » All translations of forum topics are displayed - no matter what language the site is switched to.

...actually, this is not an issue with the 'New forum topics' block alone but with how forum topics are handled and displayed when language is a criterion in general. Going at ../en/forums/general-discussion I see both the source topic and its Italian translation when I'd expect only the English version shown. And the other way around: ../it/forums/general-discussion should list the Italian translation only, but it lists its English source topic too.

schwonder’s picture

I have exactly the same problem: Forums are localized and forum names are displayed translated, but translated forum topics show up alltogether regardless of how the language is switched to, whereas I would expect a "filtered" view of translated forum topics depending on current language of the site.
However, if I look at the overall forum list, everything is OK: Depending on to what language the site is switched to, the numbers of English or (in my case) German topics in the resp. forums is displayed correctly (only the number of topics in English or German depending on current language of the site).
Moreover, if I view the forum topic and switch the language while viewing, the translated version is displayed correctly, too.
BUT while viewing the topic list of the forum (e.g. "General discussion"), I constantly get listed all topics (resp.all translated versions of my topics).
Any idea of how to fix this? Maybe it is only a wrong configuration setting?

klonos’s picture

Component: Blocks » Miscellaneous

...Maybe it is only a wrong configuration setting?

Nope, I'm pretty sure this is a bug. Changing the component to misc btw, since this doesn't effect only blocks. I'll try to find some time to update the issue's summary.

klonos’s picture

I'm starting to think this is related to #237696: Add language filter to Drupal core

dcoulombe’s picture

This is NOT a recommended fix, but here how to solve this issue quickly:

Add this at line 770 of "/modules/forum/forum.module":

global $language;

$keys = array_keys($_forums);
foreach($keys as $key)
{
  if($_forums[$key]->language != $language->language
  && $_forums[$key]->language != LANGUAGE_NONE)
    unset($_forums[$key]);
}
klonos’s picture

Status: Active » Closed (fixed)

Using latest dev of core and i18n fixes this issue for me. I honestly have absolutely no idea though which commit it was that fixed things (???). So, I'm closing this issue so as to keep the issue queue as clean as possible, but feel free to reopen if you are still seeing this.

It would be equally nice if you reported whether this is fixed for you too or not though ;)

batigol’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

I still have this issue (latest dev of drupal 7 and i18n).

When i click on forum and translate it - everything is fine. Number of topics/answers are changed as a description language. But when I choose a specific forum (translated forum taxonomy term) - list of topics aren't changed... They numbers/answers still stay the same only the descriptions are translated properly. The path use a taxonomy ID not a translated forum taxonomy name...

Old but related: http://drupal.org/node/584356

Maybe better in D7.

Don't think so :)

http://drupal.org/node/277689

batigol’s picture

Status: Closed (fixed) » Active

When you browse a forum list in English and click on specific forum then English taxonomy forum path looks fine. But now when you click on Italian translation the path is wrong (ID).

In other way:

When you browse a forum list in Italian and click on specific forum then Italian taxonomy forum path looks fine. But now when you click on English translation the path is wrong (ID).

So it must be something with the way drupal forum choose it's taxonomy language (probably i18n related). I guess AF isn't a side here.

jose reyero’s picture

Check:

- Language selection module (i18n_select)
- Admin language (may interfere with language selection).

batigol’s picture

I have checked taxonomy terms options - I have enabled:

Content to filter by language
- Select nodes by language
- Select taxonomy terms by language

In Language - Detection and selection I have checked:

User interface text language detection:
- Determine the language from a request/session parameter.
- Determine the language from the URL (Path prefix or domain).

Content language detection:
- Use the detected interface language.

I tried to change those options but without any results...

jose reyero’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Try switching detection methods, set URL first.

Looks like not a bug but a misconfiguration or clashes with other modules. To be reconsidered if this can be reproduced with Drupal core + i18n alone.

batigol’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Jose thx for you interest on this. On clean drupal 7.12 (locale, forum enabled) and i18n I got:

Error
The website encountered an unexpected error. Please try again later.
Error message
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous: SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:db_condition_placeholder_2] => und ) in forum_forum_load() (line 779 of C:\xampp\htdocs\drupal\modules\forum\forum.module).

[related - http://drupal.org/node/1309142#comment-5592678 and http://drupal.org/node/1509508]

so with latest i18n you can access forum.

But when you translate forum and it's container and set everything up there is still issue I described - http://drupal.org/node/1331724#comment-5876486 (now when you click on other language the forum taxonomy (container) show up without any topics inside...) It seems that when you translate forum taxonomy you got for example:

computer forum EN (id2)
computer forum FR (id3)

Now when you browse top level of forum in EN you see proper ID when hover on forum taxonomy link (id2 in EN and id3 in FR). But when you get inside [computer forum EN (id2)] and try to click on other language (FR) you see (in Language switcher block - User interface text) proper language prefix but the same ID-2. It should be ID3.

I have set URL method first even test it a little bit more but without any results.

kelutrab11’s picture

When I try to use multilingual forum support on my site I had the same issue.

batigol’s picture

Is there any chance to fix this in incoming newest version of i18n (with new variable version)?

henrix34’s picture

@klonos How did you manage this to work ? By simply installing latest dev of drupal and i18n ? Cause I can't get this to work.

pwiniacki’s picture

@batigol I think you should create a separate issue cause your (and mine, cause I have the same) problem is different then @klonos.
This is serious bug cause it cut off multilingual ability on drupal forum.

batigol’s picture

With latest releases of i18n and variable modules this problem is still active. Some topics even appear twice (when edited) on forum topic list...

EDIT: It's look like the translated taxonomy terms is used for both language.

........................- ITA topics of EN term
........- term (EN) - EN topics of EN term
forum
........- term (ITA) - ITA topics os ITA term
........................- EN topics of ITA term

and it should looks like:

........- term (EN) - EN topics of EN term
forum
........- term (ITA) - ITA topics os ITA term

I hope it looks clear to you and you know what I'm talking about. Language switcher block should switch terms not language IN terms (but maybe I understand something wrong ?).

kerios83’s picture

I have problem with this and It seems to work just as you described. But I could swear I saw a drupal 7 multilingual site with forum working like it should but I can't remember address right now.

batigol’s picture

@Jose Reyero can you confirm this ? Cause no matter what options I set up I can't get proper translation of my forum.

batigol’s picture

Any ETA on this ?

kelutrab11’s picture

Don't look for fast fix. This has been a problem for ages - I first found this in D7.4 and it still persist.

batigol’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)