Translations: get hemisphere letters translated again

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-16 09:54:39 -07:00
parent 598102c351
commit 789a04bd70

View file

@ -1,5 +1,6 @@
#include "qthelper.h" #include "qthelper.h"
#include "qt-gui.h" #include "qt-gui.h"
#include "gettextfromc.h"
#include "dive.h" #include "dive.h"
#include "statistics.h" #include "statistics.h"
#include <exif.h> #include <exif.h>
@ -12,8 +13,7 @@
#include <QSettings> #include <QSettings>
#include <libxslt/documents.h> #include <libxslt/documents.h>
#define tr(_arg) QObject::tr(_arg) #define translate(_context, arg) trGettext(arg)
QString weight_string(int weight_in_grams) QString weight_string(int weight_in_grams)
{ {
@ -43,8 +43,8 @@ QString printGPSCoords(int lat, int lon)
if (!lat && !lon) if (!lat && !lon)
return QString(); return QString();
lath = lat >= 0 ? tr("N") : tr("S"); lath = lat >= 0 ? translate("gettextFromC", "N") : translate("gettextFromC", "S");
lonh = lon >= 0 ? tr("E") : tr("W"); lonh = lon >= 0 ? translate("gettextFromC", "E") : translate("gettextFromC", "W");
lat = abs(lat); lat = abs(lat);
lon = abs(lon); lon = abs(lon);
latdeg = lat / 1000000; latdeg = lat / 1000000;
@ -70,10 +70,10 @@ bool parseGpsText(const QString &gps_text, double *latitude, double *longitude)
int eastWest = 4; int eastWest = 4;
int northSouth = 1; int northSouth = 1;
QString trHemisphere[4]; QString trHemisphere[4];
trHemisphere[0] = tr("N"); trHemisphere[0] = translate("gettextFromC", "N");
trHemisphere[1] = tr("S"); trHemisphere[1] = translate("gettextFromC", "S");
trHemisphere[2] = tr("E"); trHemisphere[2] = translate("gettextFromC", "E");
trHemisphere[3] = tr("W"); trHemisphere[3] = translate("gettextFromC", "W");
QString regExp; QString regExp;
/* an empty string is interpreted as 0.0,0.0 and therefore "no gps location" */ /* an empty string is interpreted as 0.0,0.0 and therefore "no gps location" */
if (gps_text.trimmed().isEmpty()) { if (gps_text.trimmed().isEmpty()) {