Skip to content

Commit

Permalink
Fix - Languages with same LCID value cause clash when importing.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Jun 28, 2024
1 parent 47725cd commit e06547c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uSync.Core/Serialization/Serializers/LanguageSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ protected override XElement InitializeBaseNode(ILanguage item, string alias, int
{
// language guids change all the time ! we ignore them, but here we set them to the 'id'
// this means the file stays the same!
var key = Int2Guid(item.CultureInfo.LCID);

// for backwards compatibility, use the LCID unless its
// the 'unknown' value then use the iso-code turn that into a guid
var key = item.CultureInfo.LCID != 4096
? Int2Guid(item.CultureInfo.LCID)
: item.IsoCode.ToGuid();

return new XElement(ItemType, new XAttribute(uSyncConstants.Xml.Key, key.ToString().ToLower()),
new XAttribute(uSyncConstants.Xml.Alias, alias),
Expand Down

0 comments on commit e06547c

Please sign in to comment.