예제 #1
0
        public IActionResult EditKey(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                return(View());
            }

            var rz = new Dictionary <string, string>();

            foreach (var item in _locConfig.Value.Languages)
            {
                var str = _localize.GetForLanguage(key, item.Identifier);
                rz.Add(item.Identifier, str.Value != $"[{str.Name}]" ? str : string.Empty);
            }

            var model = new EditLocalizationViewModel
            {
                Key = key,
                LocalizedStrings = rz,
                Languages        = _locConfig.Value.Languages.ToDictionary(f => f.Identifier, f => f.Name)
            };

            return(View(model));
        }