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

Forums / Bugs & Issues / Changing default language not working like it should.

Changing default language not working like it should.

2 posts, 1 answered
  1. medo
    medo avatar
    9 posts
    Registered:
    22 Nov 2009
    25 Jan 2010
    Link to this post
    Hi,

    I have use Dutch and english on the site and dutch(nl) used to be default.
    I read this document:
    http://www.sitefinity.com/support/kb/sitefinity-3-x/changing-the-default-site-language.aspx

    And changed in the defaultculture="en" web.config and I've run this query to change "en" to default.
    DECLARE @oldDefault INT = 19 --nl  
    DECLARE @newDefault INT = 9 --en  
     
     
    UPDATE sf_PageContentBase SET LangID=@oldDefault WHERE LangID = 127 AND  id NOT IN (SELECT id FROM sf_CmsTemplContent)  
    UPDATE sf_CmsCtrlLinks SET LangID=@oldDefault WHERE LangID = 127 AND  pageid NOT IN (SELECT id FROM sf_CmsTemplContent)  
    UPDATE sf_StagedPageContent SET LangID=@oldDefault WHERE LangID = 127  
    UPDATE sf_CmsPageContent SET LangID=@oldDefault WHERE LangID = 127  
    UPDATE sf_GCMetaData SET LangID=@oldDefault WHERE LangID = 127  
    UPDATE sf_CmsContentVersion SET LangID=@oldDefault WHERE LangID = 127  
     
     
    UPDATE sf_PageContentBase SET LangID=127 WHERE LangID = @newDefault AND  id NOT IN (SELECT id FROM sf_CmsTemplContent)  
    UPDATE sf_CmsCtrlLinks SET LangID=127 WHERE LangID = @newDefault AND  pageid NOT IN (SELECT id FROM sf_CmsTemplContent)  
    UPDATE sf_StagedPageContent SET LangID=127 WHERE LangID = @newDefault  
    UPDATE sf_CmsPageContent SET LangID=127 WHERE LangID = @newDefault  
    UPDATE sf_GCMetaData SET LangID=127 WHERE LangID = @newDefault  
    UPDATE sf_CmsContentVersion SET LangID=127 WHERE LangID = @newDefault 

    All seems well and works when browsing the pages.
    but when going to the admin pages all content is gone! I see the main menu but that is it.
    When clicking the edit this language button I get an empty template with no content what so ever in the content placeholders.
    When pressing View live page in a new window I see all content again.


  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Jan 2010
    Link to this post
    Hello medo,

    Thank you for using our services.

    Did you have localization turned on fro Generic Content based modules?
    <add name="News" allowLocalization="true" urlRewriteFormat="ID={GUID}" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" allowComments="true" applicationName="/News" versioningProviderName="" commentsModeration="true" allowWorflow="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data" />

    If yes then you have to run a similar script for changing default language for localized modules too. The full SQL script (both pages and generic content based module news) can be found bellow:
    declare @oldDefaultLangId int
    declare @newDefaultLangId int
       
    set @oldDefaultLangId = 19
    set @newDefaultLangId = 9
       
    -- Convert pages
    Update sf_PageContentBase set LangID = @oldDefaultLangId where LangID = 127 and ItemType = 'CmsPageContent' 
    Update sf_PageContentBase set LangID = 127 where LangID = @newDefaultLangId and ItemType = 'CmsPageContent'    
        
    Update sf_CmsPageContent set LangID = @oldDefaultLangId where LangID = 127  
    Update sf_CmsPageContent set LangID = 127 where LangID = @newDefaultLangId  
         
    Update sf_StagedPageContent set LangID = @oldDefaultLangId where LangID = 127 and ID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_StagedPageContent set LangID = 127 where LangID = @newDefaultLangId and ID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
         
    Update sf_CmsCtrlLinks set LangID = @oldDefaultLangId where LangID = 127 and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_CmsCtrlLinks set LangID = 127 where LangID = @newDefaultLangId and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')   
          
    Update sf_StagedCtrlLinks set LangID = @oldDefaultLangId where LangID = 127 and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_StagedCtrlLinks set LangID = 127 where LangID = @newDefaultLangId and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
         
       
    -- Convert generic content items.
    -- You should run this script if you have generic content modules with enabled localization in the web.config.
    -- In the IN clause specify the application names of the generic content providers with content with allowLocalization attribute set to true.
    -- For example: '/', '/News'
    Update sf_GCMetaData set LangID = @oldDefaultLangId where LangID = 127 and Application in ('/', '/News')
    Update sf_GCMetaData set LangID = 127 where LangID = @newDefaultLangId and Application in ('/', '/News')
          
    Update sf_CmsContentVersion set LangID = @oldDefaultLangId where LangID = 127 and Application in ('/', '/News')
    Update sf_CmsContentVersion set LangID = 127 where LangID = 9 and Application in ('/', '/News')
          
    Update sf_CmsTextContent set Culture = @oldDefaultLangId where Culture = 127 and Application in ('/', '/News')
    Update sf_CmsTextContent set Culture = 127 where Culture = @newDefaultLangId and Application in ('/', '/News')
         
    Update sf_VersionItem set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VersionItem set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')
         
    Update sf_VrsTxtData set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VrsTxtData set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')
        
    Update sf_VrsBinData set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VrsBinData set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')

    Can you try with similar script for all modules on which you have localization enabled?

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
2 posts, 1 answered