+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Image gallery and localization

Image gallery and localization

4 posts, 0 answered
  1. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    23 Aug 2011
    Link to this post
    hi,
    I am using Arabic and English language localizations.I have created an album with Arabic and English version of images.I have an image gallery and when I change language selector, I need to change the image also(language wise)
    How can I do this?
    I tried with this

           CultureInfo currentCulture=CultureInfo.CurrentCulture;
             
            var images = App.WorkWith().Images().Where(i => i.Parent.Id == albumId)
                 .Where(i => i.AvailableCultures.Contains(currentCulture))
                .Where(i => i.Visible == true)
                .Get();   
         
            foreach (Telerik.Sitefinity.Libraries.Model.Image img in images)
            {
            }

    but I got an error saying

    Identifier 'AvailableCultures' is not a parameter or variable or field of 'Telerik.Sitefinity.Libraries.Model.Image'. If 'AvailableCultures' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias


    please help me....
  2. Lilia Messechkova
    Lilia Messechkova avatar
    42 posts
    Registered:
    13 Jul 2016
    26 Aug 2011
    Link to this post
    Hello Rakesh,

    AvailableCultures is not a persistable property so it can not be used in linq expression. You can modify your code to get all visible images and then itterate through them checking the AvailableLanguages Property.

    One other approach is to use the PublishedTranslations property which is persistable and could be used in linq expression.

    CultureInfo currentCulture=CultureInfo.CurrentUICulture;
             
            var images = App.WorkWith().Images().Where(i => i.Parent.Id == albumId)
                 .Where(i => i.PublishedTranslations.Contains(currentCulture.Name))
                .Get();   
         
            foreach (Telerik.Sitefinity.Libraries.Model.Image img in images)
            {
            }

    Note that the code above will work properly only when the project is multilingual as it is in your case.

    The code above provides access to all images in an album in a specific language.

    The language selector should navigate to different language versions of a specific page. If you have placed image galery in that page then the images should change automatically when the language is changed so they correspond to the language of the page.

    Please let me know if you have further problems.

    Greetings,
    Lilia Messechkova
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    08 Nov 2011
    Link to this post
    Hi,

    How can I give Arabic title and description for the image libraries created...
    I could not find any option for this.
    Is their any for doing this .
    Please help......

    When going to Manage Libraries,it shows only English versions ,no option for "AR"
  4. Lilia Messechkova
    Lilia Messechkova avatar
    42 posts
    Registered:
    13 Jul 2016
    09 Nov 2011
    Link to this post
    Hi Rakesh,

    The libraries are not localizable, only the items in  the library are localizable. The same is valid for the blogs and videos. The title of libraries is only visible in the admin section so you can give it Arabic name if you like instead of English. If you really need to have English and Arabic title, then you will have to create two libraries and spit the items across these libraries.

    All the best,
    Lilia Messechkova
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered