int QAChecker::Check(CatalogItemPtr item) { int issues = 0; for (auto& c: m_checks) { if (item->GetString().empty() || (item->HasPlural() && item->GetPluralString().empty())) continue; if (c->CheckItem(item)) issues++; } return issues; }
bool QACheck::CheckItem(CatalogItemPtr item) { if (!item->GetTranslation().empty() && CheckString(item, item->GetString(), item->GetTranslation())) return true; if (item->HasPlural()) { unsigned count = item->GetNumberOfTranslations(); for (unsigned i = 1; i < count; i++) { auto t = item->GetTranslation(i); if (!t.empty() && CheckString(item, item->GetPluralString(), t)) return true; } } return false; }