forked from microsoft/CopilotStudioSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserLanguage.cs
More file actions
33 lines (29 loc) · 852 Bytes
/
Copy pathUserLanguage.cs
File metadata and controls
33 lines (29 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Concurrent;
using Microsoft.Translation.Helpers;
namespace TranslationBot.Translation.Helpers
{
/// <summary>
/// Dictionary for setting the language send through the URL
/// </summary>
public class UserLanguage : ConcurrentDictionary<string, string>
{
public String Get(string userName)
{
if (TryGetValue(userName, out String value))
{
return value;
}
return null;
}
public void Save(String languageUrl)
{
AddOrUpdate(
TranslationSettings.DefaultDictionaryKey,
languageUrl,
(key, oldValue) => languageUrl);
}
}
}