Add Qtr_ macros that uses gettext in a tr() compatible manner

This should wrap gettext nicely and replace the "_()" macros we use in C
code.

Also added comments to the top of all the new files.

Suggested-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-04-13 20:44:02 -07:00
parent 14e133321f
commit f5c958ad73
16 changed files with 113 additions and 22 deletions

View file

@ -1,3 +1,10 @@
/*
* divetripmodel.cpp
*
* classes for the dive trip list in Subsurface
*/
#include "common.h"
#include "divetripmodel.h"
@ -63,15 +70,15 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
if (section == DIVE_NUMBER) {
return tr("Dive number");
return Qtr_("Dive number");
} else if (section == DIVE_DATE_TIME) {
return tr("Date");
return Qtr_("Date");
} else if (section == DIVE_DURATION) {
return tr("Duration");
return Qtr_("Duration");
} else if (section == DIVE_DEPTH) {
return tr("Depth");
return Qtr_("Depth");
} else if (section == DIVE_LOCATION) {
return tr("Location");
return Qtr_("Location");
}
}
return QVariant();