If you use Sitecore Content Editor on a regular basis, the follow advice regarding how to sort languages in the drop down menu of Content Editor without having to program anything may come in handy.
I fits have to warn you (disappoint you) that this possibility first appeared in the Sitecore Experience Platform 8.1 rev. 160302 (8.1 Update-2). Therefore, if you are using an older version, you will not be able to apply this approach. However, for those of you using an older version, there is a possibility to arrange the languages in Content Editor according to yourself but it includes programming. You can for example use the following link, but this article is not about this. This article describes how to, as a user, arrange the languages without programming. Let’s get down to it.
If you open Content Editor, you will have a drop down menu for selecting the language version of the selected item for every item in the right hand corner. In the default status, the languages in the menu are arranged in the way they were created in the System/Languages section (see Figure 1), which is truly impractical and significantly hindering when using Content Editor on a regular basis.
Modifying the Arrangement
It would be much more practical if the languages in the drop down menu were arranged as they are arranged in the System/Languages section. Here, we would arrange the languages according to ourselves (most likely according to the ones we use most frequently in the project) and this arrangement would automatically be applied on the drop down menu.
As mentioned at the beginning, Sitecore offer this possibility from the 8.1 rev. 160302 (8.1 Update-2) in the App_Config/Sitecore.config configuration file using the ContentEditor.SortLanguages setting. However, the value in the default status is set up as false, so we have to change it to true.
<!-- CONTENT EDITOR SORT LANGUAGES Indicates whether the Content Editor show languages in the language selection dropdown in the same order as /sitecore/system/Languages child items. Default value: false --> <setting name="ContentEditor.SortLanguages" value="true" />
If we make the change and go back to Content Editor, the languages will be arranged as they are arranged in the System/Languages (see Figure 2).
If you would like to further modify the drop down menu with languages in v Content Editor, open the \sitecore\shell\Applications\Content Manager\Galleries\Languages\Gallery Languages.xml file, change the GalleryLanguagesForm method from (Sitecore.Client.dll) to your own class and using CodeBeside, you can write your own code. The possibilities are endless 🙂
Since we are professionals, here is a small, final recommendation. As professionals, we will not modify the App_Config/Sitecore.config, configuration file directly but we will create our own, for example App_Config/Include/Z.Sitecore.Configuration.config. Here, we will make a so called patch for this set up. The resulting file, Z.Sitecore.Configuration.config may then look like this:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <settings> <!-- CONTENT EDITOR SORT LANGUAGES Indicates whether the Content Editor show languages in the language selection dropdown in the same order as /sitecore/system/Languages child items. Default value: false Patch value: true --> <setting name="ContentEditor.SortLanguages" > <patch:attribute name="value" value="true" /> </setting> </settings> </sitecore> </configuration>
If you would like to read more about how to correctly modify the configuration file, I recommend the following article.