CResourceTableModel: Mark strings as translatable where applicable

This commit is contained in:
Lioncash 2020-06-28 05:27:45 -04:00
parent 5d230811e8
commit 8f440ae90e
1 changed files with 13 additions and 11 deletions

View File

@ -35,14 +35,16 @@ QVariant CResourceTableModel::data(const QModelIndex& rkIndex, int Role) const
CVirtualDirectory *pDir = IndexDirectory(rkIndex); CVirtualDirectory *pDir = IndexDirectory(rkIndex);
if (Role == Qt::DisplayRole || Role == Qt::ToolTipRole) if (Role == Qt::DisplayRole || Role == Qt::ToolTipRole)
return ( (mpCurrentDir && !mpCurrentDir->IsRoot() && rkIndex.row() == 0) {
? ".." : TO_QSTRING(pDir->Name())); return ((mpCurrentDir && !mpCurrentDir->IsRoot() && rkIndex.row() == 0)
? tr("..")
: TO_QSTRING(pDir->Name()));
}
else if (Role == Qt::DecorationRole) if (Role == Qt::DecorationRole)
return QIcon(":/icons/Open_24px.svg"); return QIcon(QStringLiteral(":/icons/Open_24px.svg"));
else return QVariant::Invalid;
return QVariant::Invalid;
} }
// Resource // Resource
@ -51,11 +53,11 @@ QVariant CResourceTableModel::data(const QModelIndex& rkIndex, int Role) const
if (Role == Qt::DisplayRole) if (Role == Qt::DisplayRole)
return TO_QSTRING(pEntry->Name()); return TO_QSTRING(pEntry->Name());
else if (Role == Qt::ToolTipRole) if (Role == Qt::ToolTipRole)
return TO_QSTRING(pEntry->CookedAssetPath(true)); return TO_QSTRING(pEntry->CookedAssetPath(true));
else if (Role == Qt::DecorationRole) if (Role == Qt::DecorationRole)
return QIcon(":/icons/Sphere Preview.svg"); return QIcon(QStringLiteral(":/icons/Sphere Preview.svg"));
return QVariant::Invalid; return QVariant::Invalid;
} }
@ -238,9 +240,9 @@ void CResourceTableModel::FillEntryList(CVirtualDirectory *pDir, bool AssetListM
} }
if (pDir) if (pDir)
mModelDescription = pDir->IsRoot() ? "Resources" : TO_QSTRING(pDir->FullPath()); mModelDescription = pDir->IsRoot() ? tr("Resources") : TO_QSTRING(pDir->FullPath());
else else
mModelDescription = "Nothing"; mModelDescription = tr("Nothing");
endResetModel(); endResetModel();
} }