hi,
i tried language sections for some costum content types because i had some problems with i18n and cck node-reference
here's what i did:
*enabled the module
*enabled the filter, and orderd it to be the first
*edited the content as followind
===en===
english text
===de===
german text
( language is set to / also tried disabling language support )

the strange thing now is
when i view a certain teaser list (views) the content is english
http://www.euroby2008.at/de/leagues
http://www.euroby2008.at/en/leagues
when i view the full page the content is german
http://www.euroby2008.at/de/leagues/narosot-league
http://www.euroby2008.at/en/leagues/narosot-league

any idea on that???
only the body of the content should be translated. no other relevant cck fields are enabled.

best regards
hatsch

Comments

andy inman’s picture

Assigned: Unassigned » andy inman

Thanks for the report... I'm checking your examples pages and thinking! ...

andy inman’s picture

I checked your pages - for me *everything* is appearing in English. I doubt if Language Sections is the problem - something more basic maybe.

One point, the module is an "Input Filter" - with these, the order of execution can be important. I suggest you make Language Sections one of the first filters in the chain of filters.

The module is in use on my live site - www.axlan.com - and is working perfectly there. I don't think that your problem is a bug in Language Sections, though it's a possibility.

Let me know more information and I'll try to help more.

hatsch’s picture

hi there,
thank you for your reply.
hm, i did everything you explaned. and it doesn't work. when the filter is the last in the chain the content is blank, and when i move it up, the content alwas is the first language entered.

send you an account pm, so you can check if you're interested.

best regards
hatsch

andy inman’s picture

Priority: Critical » Normal
Status: Fixed » Active

edited - not relevant

andy inman’s picture

Priority: Normal » Critical

edited - not relevant.

hatsch’s picture

Priority: Normal » Critical

thanks for investigating. if there's anything i can do to support you. drop me a note. i'll be online the next hours.

andy inman’s picture

Status: Active » Needs review

Ok, I think I have finally found the cause - it's a caching problem.

If you want a quick fix, I think this will work: Edit the language_sections.module file and find these lines:

case 'no cache':
return false;

... change the second line to:

return true;

It seems that Drupal does not cache filtered text on a per-language basis as I thought. This means, apparently, you see a cached version of the text when you switch languages, so the wrong version. It's just coincidence that when I tested it on my site, this problem didn't occur, probably because some other input filter in the format-set was already preventing caching.

This also means that for performance reasons it would be better not to enable language_sections on a page unless its actually needed - by preventing caching, these pages may load more slowly. Just create one "standard text" input filter set and one "multi-language" input filter set.

This is something of a limitation in Drupal caching - if the caching were done on a per-language basis, this would not be a problem. I will look for a better solution rather than disabling caching for the text, but I don't think there will be one other than a patch to the caching logic in the core, which would probably not be a good idea.

Let me know if you implement the patch and if it works for you. I think it will.

hatsch’s picture

great! you're a hero! if you ever come to vienna, linz or zürich i'd be happy to invite to a handfull of beer ;)

another thing i found out is that when you use a costum teaser break

then it takes the first apperance of that tag. so you have to split it up into two areas like that

==en==
english teaser

==de==
german teaser

==en==
english the rest

==de==
german the rest

by the way this is a very usefull module!

best regards
hatsch

andy inman’s picture

Status: Needs review » Fixed

Hi hatsch, thanks for offer of beer, always appreciated :)

The strange thing is, I cannot duplicate this caching problem on my live nor test site. I guess it's something to do with my combination of modules compared with yours.

Anyway, I've uploaded a new dev version in which you can configure the "cache" setting - it's defaults to "no cache" for safety.
The .module is here:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/language_se...
.. the gz package will be available when drupal.org updates the listing.

About the teasers -- I hadn't tested it with teasers - I usually only use full node display. Are you saying it's a problem or just a quirk?

FYI, I'm working on another language module to simplify things in CCK and Views. Solves some problems, e.g. if you are defining CCK fields you can define field titles for 2 languages instead of having to use the string translations, which is not so easy to manage. Also in Views, field headings are easier to set up. I'll upload a beta release soon.

Anonymous’s picture

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.