Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:57:35+00:00 2026-05-26T21:57:35+00:00

I’m using sitecore 6.5 with two languages installed, en (default) and fr-CA. There are

  • 0

I’m using sitecore 6.5 with two languages installed, en (default) and fr-CA. There are items in the tree with content in both en and fr-CA.

The problem is that the French url has ‘fr-CA’ in it and we want that to be ‘fr’, for example:

http://website.com/fr/page.aspx instead of http://website.com/fr-CA/page.aspx

I tried renaming the language from ‘fr-CA’ to ‘fr’ and that fixed the url but the content still points to the old language ‘fr-CA’, so the item shows three languages: en, fr and fr-CA. It’s not recognizing the name change.

Any suggestions are much appreciated.

Thanks,
Tarek

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:57:36+00:00Added an answer on May 26, 2026 at 9:57 pm

    The problem is you have created fr-CA versions of your items which cannot be fixed by renaming the language .. you can now make a fr version but, like you are seeing, this means there are now 3 possible versions.

    One suggestion is to leave the languages in Sitecore alone and alter how links are served and processed instead.

    You would probably need to look at adding your own method into the httpRequestBegin pipeline in Sitecore. This would follow the LanguageResolver entry. You can then parse the RawUrl and set Sitecore.Context.Langauge' to French if the first element in it matched/fr/`.

    Extremely quick & dirty example:

    public class MyLanguageResolver : HttpRequestProcessor
    {
        public override void Process(HttpRequestArgs args)
        {
            string languageText = WebUtil.ExtractLanguageName(args.Context.Request.RawUrl);
    
            if(languageText == "fr")
            {
                Sitecore.Context.Language = LanguageManager.GetLanguage("fr-CA");
            }
        }
    }
    

    You would probably also have to override the LinkProvider in the <linkManager> section of the web.config to format your URLs when they are resolved by Sitecore.

    Another extremely quick & dirty example:

    public class MyLinkProvider : LinkProvider
    {
        public override string GetItemUrl(Sitecore.Data.Items.Item item, UrlOptions options)
        {
            var url = base.GetItemUrl(item, options);
            url = url.Replace("/fr-CA/", "/fr/");
            return url;
        }    
    }
    

    Another way (slightly more long-winded as it will need to be executed via a script) is to copy the data from the fr-CA version to the fr version and then delete the fr-CA version of each item.

    Rough helper method that encompasses what you’re trying to do

        private void CopyLanguage(ID id, Language sourceLanguage, Language destinationLanguage)
        {
            var master = Database.GetDatabase("master");
    
            var sourceLanguageItem = master.GetItem(id, sourceLanguage);
            var destinationLanguageItem = master.GetItem(id, destinationLanguage);
    
            using (new SecurityDisabler())
            {
                destinationLanguageItem.Editing.BeginEdit();
    
                //for each field in source, create in destination if it does not exist
                foreach (Field sf in sourceLanguageItem.Fields)
                {
                    if (sf.Name.Contains("_")) continue;
    
                    destinationLanguageItem.Fields[sf.Name].Value = sf.Value;
                }
    
                destinationLanguageItem.Editing.AcceptChanges();
    
                ////Remove the source language version
                ItemManager.RemoveVersions(sourceLanguageItem,sourceLanguage, SecurityCheck.Disable);
            }
        }
    

    Another way to update the languages on your content items is:

    1. Export the fr-CA language to a .xml file (Using the Control Panel)
    2. In the .xml file replace all and tags with the and
    3. Rename fr-CA language in the master database to the fr
    4. Import language from the .xml file
    5. Run Clean Up Databases task (from the Control Panel)

    Also you can create a sql script that will change fr-CA language with the fr for all records in the UnversionedFields and VersionedFields tables.

    If you need any more information or examples please let me know. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.