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

Forums / Developing with Sitefinity / News and localization

News and localization

9 posts, 0 answered
  1. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    07 Feb 2008
    Link to this post
    I have set News module to be localizable.

    How can I set NewsList control to only display news that are actually translated to active language, instead of displaying all news (and displaying non-translated news in default language)?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Feb 2008
    Link to this post
    Hello Sasa,

    You can re-arrange all news in separate categories. Make new category for every news written in different localization and place them inside this category. When you want to view news with specific localization, simply go to News -> Search news by Category -> Specify which category you want to view, and click "Search".

    For example, you can create Category "English-US : World News", and place all world-news that are written in English. Then, you can find all these news very easily.

    I hope this will make you work more comfortably with Sitefinity.


    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    07 Feb 2008
    Link to this post
    Yes.

    What I actually require is to have news that may or may not be localized. So, when I add a news localized in english, it should only show up when site is switched to english. This same news item could be localized to any number of available languages - making it show up on site only then.

    I considered _categories_, but this is just far from convinient.

    Ironically, within sitefinity's news admin, when I click on "all news" it will only display ones translated to current language. I wish it would display all news.
  4. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    07 Feb 2008
    Link to this post
    To be more precise...

    I will use categories for news items, anyway. For sure, I'll have categories such as "World news", "This or that news", ...

    But, I will also need to localize News1 within "World news" to language1,2 but not to language3,4. And so on...
  5. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    08 Feb 2008
    Link to this post
    Hi Sasa,

    Please excuse us for the misunderstanding. Actually, currently you would not be able to achieve this functionality. We will try to add it as a feature for the upcoming release. However, if we fail to do that (the release is due in very short time), we will provide a custom implementation for you shortly after the release.

    Sorry for the inconvenience.
     
    Greetings,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    09 Feb 2008
    Link to this post
    Looking forward to the new release. Are we talking Friday February 15th?

    Sincerely,

    Ben
  7. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    11 Feb 2008
    Link to this post
    Hi bnye,

    Below are the release dates we have planned for Sitefinity v. 3.2. :

    • Beta release - 22 February, 2008
    • Final release  - 5 March, 2008
    • Service Pack 1 - 20 March, 2008

    We will soon update our web site with release related news.

    Kind regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Pavel
    Pavel avatar
    3 posts
    Registered:
    21 Feb 2008
    26 Feb 2008
    Link to this post

    Hi,
    I have set News module to be localizable. (<localization defaultProvider="Sitefinity" persistenceMode="QueryString" defaultCulture="cs" cultures="cs, en, de"> and so on)

    It works fine, but my problem is generating Multilanguage News via C# code – I have to prepare migration from old system into Sitefinity. I have seen here in the forum a snippet code using your API for creating content and I tried to modify it for generating news in foreign language.

    Here is the code:

    Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager("News");  
    Telerik.Cms.Engine.IContent submittedNews = newsManager.Content.CreateContent("text/html");  
     
    submittedNews.Language = "en";  
    submittedNews.SetMetaData("Title""Novelty of the day ");  
    submittedNews.SetMetaData("Expiration_Date", DateTime.Now.AddMonths(12));  
    submittedNews.SetMetaData("Publication_Date", DateTime. Now);  
    submittedNews.SetMetaData("Author""Pisalek");  
    submittedNews.SetMetaData("Summary""This is the summary");  
    submittedNews.Content = "Content BLA BLA ";  
     
    newsManager.Content.SaveContent(submittedNews);  
     


    When I look in Modules\News, the item created in english section looks ok, but unfortunately this item occurred also in default czech section without text in title.

    I created Multilanguage page with NewsList control. When I browse website, then on cs page this item isn’t shown (OK), but on en page is shown twice.

    May you explain me, where is the problem in content? When I create news trough the Sitefinity admin UI, then news are shown in their language’s sections ok.

    I’m using Sitefinity v. 3.2beta

    Thank you for your help

    Pavel
  9. Pavel
    Pavel avatar
    3 posts
    Registered:
    21 Feb 2008
    27 Feb 2008
    Link to this post

    Hi,
    I solved my problem described above in my previous post. I used your example code from http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bamced.aspx .

    Here is the code:

    Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager("News");  
    Telerik.Cms.Engine.IContent submittedNews = newsManager.Content.CreateContent("text/html");  
     
    System.Globalization.CultureInfo culture = Telerik.Localization.LocalizationManager.DefaultCulture;  
    foreach (System.Globalization.CultureInfo cultureItem in Telerik.Localization.LocalizationManager.Cultures)  
    {  
        if (cultureItem.Name == "en")  
        {  
            culture = cultureItem;  
            break;  
        }  
    }  
     
    submittedNews.Language = culture.Name;  
    submittedNews.SetMetaData("Title""Novelty of the day ");  
    submittedNews.SetMetaData("Expiration_Date", DateTime.Now.AddMonths(12));  
    submittedNews.SetMetaData("Publication_Date", DateTime.Now);  
    submittedNews.SetMetaData("Author""Pisalek");  
    submittedNews.SetMetaData("Summary""This is the summary");  
    submittedNews.Content = "Content  BLA BLA ";  
     
    System.Globalization.CultureInfo restoreCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;  
    System.Threading.Thread.CurrentThread.CurrentUICulture = culture;  
     
    newsManager.Content.SaveContent(submittedNews);  
     
    System.Threading.Thread.CurrentThread.CurrentUICulture = restoreCulture;  
     

    Current culture of the current thread was changed into foreign culture and the content was saved in this context. Then current thread was changed back to the current culture.

    These statements were marked as not required after upgrading with v.3.1 SP2. I’m using v.3.2beta. It’s possible anything from v.3.1SP2 didn’t take effect in v.3.2?

    Kind regards
    Pavel

Register for webinar
9 posts, 0 answered