In rare cases after an update you may see the secondary languages appear on pages of the primary language, and the Edit-UI seems to be missing the primary language. 

To explain the cause and solution, we'll use an example where

  1. the primary language is English (In this example Dimension ID #2)
  2. the secondary language is German (ID #4)

Cause

When you start creating a new website (years ago) you probably didn't have languages activated at first. So the values that were stored were not assigned to any language at all. 

Later on you probably activated a primary (English) and a secondary language (German) and edited only the new / changed stuff in the secondary language (German). 

Now in older versions of 2sxc (up to ca. v9) the rules for saving data were very strict: if nothing changed, don't make db-changes. So values of the primary language probably didn't change, so you end up with values like this

  1. "Good day!" - no language assigned
  2. "Guten Tag!" - assigned to German

Older versions of 2sxc handled this scenario when loading data, by determining values that had been saved earlier as being the primary languages. This caused other problems, so this was cleaned up ca. V9 so from then on all save operations also updated the languages on the primary values as well.

Solution

To fix this, let's first find all values which have translations, but where one of the values doesn't have a language assigned. 

1. Find all Values which need Language Assignment

Create a sql View called CleanUpLanguages_TranslatedValues which will find all values which have translations. Put this SQL in the view: 

SELECT        TOP (100) PERCENT EntityID, AttributeID, ChangeLogDeleted
FROM            dbo.ToSIC_EAV_Values
WHERE        (ChangeLogDeleted IS NULL)
GROUP BY EntityID, AttributeID, ChangeLogDeleted
HAVING        (COUNT(ValueID) > 1)
ORDER BY EntityID

Now create another SQL View which uses the previous view - this will show you a table of all values which have translations, showing you both the ones with language assigned an not. Call it CleanUpLanguages_TranslatedValuesAndDimensions:

SELECT        TOP (100) PERCENT dbo.ToSIC_EAV_Values.EntityID, dbo.ToSIC_EAV_Values.AttributeID, dbo.ToSIC_EAV_Values.ValueID, dbo.ToSIC_EAV_Values.Value, dbo.ToSIC_EAV_Entities.ChangeLogDeleted AS EntityDeleted, 
                         dbo.ToSIC_EAV_Attributes.StaticName, dbo.ToSIC_EAV_Attributes.Type, dbo.ToSIC_EAV_ValuesDimensions.DimensionID, dbo.ToSIC_EAV_ValuesDimensions.ReadOnly, 
                         dbo.ToSIC_EAV_Values.ChangeLogDeleted AS ValueDeleted
FROM            dbo.ToSIC_EAV_Values INNER JOIN
                         dbo.ToSIC_EAV_Entities ON dbo.ToSIC_EAV_Values.EntityID = dbo.ToSIC_EAV_Entities.EntityID INNER JOIN
                         dbo.ToSIC_EAV_Attributes ON dbo.ToSIC_EAV_Values.AttributeID = dbo.ToSIC_EAV_Attributes.AttributeID INNER JOIN
                         dbo.CleanUpLanguages_TranslatedValues ON dbo.ToSIC_EAV_Values.EntityID = dbo.CleanUpLanguages_TranslatedValues.EntityID AND 
                         dbo.ToSIC_EAV_Values.AttributeID = dbo.CleanUpLanguages_TranslatedValues.AttributeID LEFT OUTER JOIN
                         dbo.ToSIC_EAV_ValuesDimensions ON dbo.ToSIC_EAV_Values.ValueID = dbo.ToSIC_EAV_ValuesDimensions.ValueID
WHERE        (dbo.ToSIC_EAV_Entities.ChangeLogDeleted IS NULL) AND (dbo.ToSIC_EAV_Values.ChangeLogDeleted IS NULL)
ORDER BY dbo.ToSIC_EAV_Values.EntityID, dbo.ToSIC_EAV_Values.AttributeID

Look through this view just to verify that the data you see looks correct. We will only fix the ones which have no language assigned. 

2. Find out what the DimensionID is for the primary language

We must now prepare to create data adding the language-assignments. For this, review values in the view created before to see what DimensionID is shown for values of the primary language. 

Important: If you have multiple portals each will have a different ID for the primary language. In that case you must adjust the View above to do one portal at a time!

3. Create a View showing the Data we will Add

Now create a View which will show you what values to add to the Dimensions table. Let's call the view CleanUpLanguages_DimensionsToAdd

This is the view I created, where the DimensionID of my primary language was 2 - in your case it may need a different number!

SELECT        ValueID, 2 AS DimensionId, 0 AS ReadOnly
FROM            dbo.CleanUpLanguages_TranslatedValuesAndDimensions
WHERE        (DimensionID IS NULL)

Run the view and you'll see a table that looks just like the SQL Table ToSIC_EAV_ValuesDimensions.

4. Test that it matches expectations

  1. Run the CleanUpLanguages_DimensionsToAdd and see how many results you get - let's say you got 792 results. 
  2. Open the table ToSIC_EAV_ValuesDimensions in edit-mode and manually copy one line of output from the previous view into that table (as a new row).
  3. Now re-run the CleanUpLanguages_DimensionsToAdd. If everything worked out, you should see one fewer - in this example 791.

5. Create all Records

Now copy all the records you got from the CleanUpLanguages_DimensionsToAdd with the clipboard to ToSIC_EAV_ValuesDimensions. Or use SQL to generate those records, whatever you like. 

Note: To Copy-Paste it may help to first copy it to Excel, copy to clipboard again etc. For inserting into the ToSIC_EAV_ValuesDimensions you will probably first need to select the entire 'new' row. 

6. Test

Go to DNN, restart it, everything should work now.