28 lines
788 B
C#
28 lines
788 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Manager.Interfaces.DTO;
|
|
using Manager.Interfaces.Models;
|
|
using Microsoft.Extensions.Configuration;
|
|
using MongoDB.Driver;
|
|
|
|
namespace Manager.Helpers
|
|
{
|
|
public class LanguageInit
|
|
{
|
|
public static List<TranslationDTO> Init(string label, List<string> languages, bool toNull = false)
|
|
{
|
|
List<TranslationDTO> translations = new List<TranslationDTO>();
|
|
|
|
foreach (var language in languages)
|
|
{
|
|
var value = toNull ? null : $"{language} - {label}";
|
|
translations.Add(new TranslationDTO() { language = language.ToUpper(), value = value });
|
|
}
|
|
return translations;
|
|
}
|
|
|
|
}
|
|
}
|