Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit fe35fa7

Browse files
Populating Lang and CurrentLang
1 parent ce8519b commit fe35fa7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/GitHub.Api/Metrics/UsageModel.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45

56
namespace GitHub.Unity
@@ -55,13 +56,7 @@ public Usage GetCurrentUsage(string appVersion, string unityVersion, string inst
5556
.FirstOrDefault(usage => usage.InstanceId == instanceId);
5657
}
5758

58-
if (currentUsage?.Dimensions.Date == date)
59-
{
60-
// update any fields that might be missing, if we've changed the format
61-
if (currentUsage.Dimensions.Guid != Guid)
62-
currentUsage.Dimensions.Guid = Guid;
63-
}
64-
else
59+
if (currentUsage == null)
6560
{
6661
currentUsage = new Usage
6762
{
@@ -70,7 +65,9 @@ public Usage GetCurrentUsage(string appVersion, string unityVersion, string inst
7065
Date = date,
7166
Guid = Guid,
7267
AppVersion = appVersion,
73-
UnityVersion = unityVersion
68+
UnityVersion = unityVersion,
69+
Lang = CultureInfo.InstalledUICulture.IetfLanguageTag,
70+
CurrentLang = CultureInfo.CurrentCulture.IetfLanguageTag
7471
}
7572
};
7673
Reports.Add(currentUsage);

0 commit comments

Comments
 (0)