Projection of localized content

Topics: Announcements, Localization
Aug 8, 2012 at 6:52 PM

Just informative: with Orchard 1.5 you can query localized content with filter 'For current culture'. This applies to whatever localized content (types with Localization Part attached) you have of course.
So, wether you have a routed projection or a projection widget, the content is always presented in the current language (if you apply the filter in your query).

Aug 8, 2012 at 7:51 PM
Edited Aug 8, 2012 at 7:51 PM

Already found this great feature, love the orchard more every day.

I happen to experience some issue though. After writing some blog posts i came to a state that projection did not return the last post (let's call it "Post8"). It was displayed only after i created new blogpost "Post9". BlogPost Content Type has Localization Part attached.

This issue also happened when using the Ljosland Localized Blog, so the cause is probably something with localization. Maybe something with LocalizationPartRecord querying?


context.Query = query.Where(x => x.ContentPartRecord<LocalizationPartRecord>(), x => x.Eq("CultureId", currentCultureId));




.Join<LocalizationPartRecord>().Where(x => x.CultureId == currentCulture.Id) 

I'm not sure though, hopefully i'll do some debugging and find out..


I just hope it is not something with LocalizationPartRecord storing in database.

Aug 12, 2012 at 10:15 AM

Hi. Thank for letting me know x0r. I've fixed the issue and updated the module. You can get version 1.5.1 from the gallery.

PS. The reason why I created the module was because translated blog posts did not appear in the correct blog, so I have to check both the original and the translated blog to fetch correct blog items. (also see related forum post