Moved duplicate / missing translation keys log warning out of debug block
This commit is contained in:
@@ -174,7 +174,7 @@ namespace AyaNova.Biz
|
||||
NotUnique = await ct.Translation.AnyAsync(z => z.Name == newUniqueName);
|
||||
} while (NotUnique);
|
||||
newObject.Name = newUniqueName;
|
||||
newObject.BaseLanguage=dbObject.BaseLanguage;
|
||||
newObject.BaseLanguage = dbObject.BaseLanguage;
|
||||
newObject.Stock = false;
|
||||
newObject.CjkIndex = false;
|
||||
foreach (TranslationItem i in dbObject.TranslationItems)
|
||||
@@ -188,7 +188,7 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.Created), ct);
|
||||
// await SearchIndexAsync(newObject, true);
|
||||
|
||||
|
||||
return newObject;
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace AyaNova.Biz
|
||||
TrackRequestedKey(param);
|
||||
#endif
|
||||
var ret = await ct.TranslationItem.Where(z => z.TranslationId == UserTranslationId && param.Contains(z.Key)).AsNoTracking().ToDictionaryAsync(z => z.Key, z => z.Display);
|
||||
#if (DEBUG)
|
||||
|
||||
if (ret.Count != param.Count)
|
||||
{
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<TranslationBiz>();
|
||||
@@ -342,14 +342,14 @@ namespace AyaNova.Biz
|
||||
.ToList();
|
||||
|
||||
if (missingItems.Count > 0)
|
||||
log.LogError($"********* GetSubsetAsync problem: Non existant keys: {string.Join(",", missingItems)}");
|
||||
log.LogWarning($"Non existant translation keys requested: {string.Join(",", missingItems)}");
|
||||
|
||||
if (duplicateItems.Count > 0)
|
||||
log.LogError($"********* GetSubsetAsync problem: Duplicate keys: {string.Join(",", duplicateItems)}");
|
||||
log.LogWarning($"Duplicate translation keys requested: {string.Join(",", duplicateItems)}");
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return ret.ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user