public static string GetL18nLabel(string name) { name = "_" + name + "_"; //Add l18n here AuthService authService = new AuthService(); var language = "nl-nl"; try { var currentUser = authService.Get(new CurrentUserAuthRequest()); language = currentUser.Language; } catch (Exception) { } LocalizationDictionary request = new LocalizationDictionary(); request.LocalizationData.Add(new LocalizationItem() { Key = name }); request.Locale = language; LocalizationDictionary localizationList = _client.Get<LocalizationDictionary>(request); return GetLabelFromLocalizationList(localizationList, name); }
public static void ApplyLanguagingToLabels(List<INameLabel> responseList) { //Add l18n here AuthService authService = new AuthService(); var language = "nl-nl"; try { var currentUser = authService.Get(new CurrentUserAuthRequest()); language = currentUser.Language; } catch (Exception) { } LocalizationDictionary request = new LocalizationDictionary(); request.Locale = language; LocalizationDictionary localizationList = _client.Get<LocalizationDictionary>(request); foreach (var obj in responseList) { obj.Label = GetLabelFromLocalizationList(localizationList, "_" + obj.Name + "_"); } }