Commit d2f3ac47 authored by Pino Toscano's avatar Pino Toscano Committed by Albert Astals Cid
Browse files

Store KGmap::p_name as translated

Almost all the users use it that way already; the only exceptions are
two diagnostic English messages on stderr, so print also the full path
of the file as workaround to identify the map.
parent 33906032
......@@ -416,7 +416,7 @@ void kgeography::setMap(KGmap *m)
p_map = m;
p_showAuthor->setEnabled(m);
QString mapName = i18nc(p_map -> getFileName().toUtf8(), p_map -> getName().toUtf8());
QString mapName = p_map -> getName();
QString divisionType = p_map->getDivisionsString();
p_askMap->setText(i18n("&Location of %1", divisionType));
......
......@@ -78,7 +78,7 @@ mapChooser::mapChooser(QWidget *parent) : QDialog(parent)
errorTexts << i18n("Error parsing %1: %2", mapFilename, p_reader.getError());
else
{
QString text = i18nc(m->getFileName().toUtf8(), m->getName().toUtf8());
QString text = m -> getName();
// avoid multiple and should guarantee that first in XDG_DATA_DIRS is chosen)
if (texts.contains(text))
delete m;
......
......@@ -43,7 +43,7 @@ KGmap *mapReader::parseMap(const QString &path)
const QByteArray ctxt = kgmap -> getFileName().toUtf8();
// Map name
kgmap -> setName( getElementString(QStringLiteral("name"), root, Mandatory) );
kgmap -> setName(i18nc(ctxt, getElementString(QStringLiteral("name"), root, Mandatory).toUtf8()));
// Map image file
if (!kgmap -> setMapFile( baseDir + getElementString(QStringLiteral("mapFile"), root, Mandatory) ))
......@@ -63,7 +63,7 @@ KGmap *mapReader::parseMap(const QString &path)
else if ( ! pat.isEmpty() )
{
QTextStream stream(stderr);
stream << "capitalToDivisionPattern element should contain one '%%' in map " << kgmap->getName();
stream << "capitalToDivisionPattern element should contain one '%%' in map " << kgmap->getName() << kgmap -> getFile();
}
pat = getElementString(QStringLiteral("divisionToCapitalPattern"), root, Optional);
......@@ -74,7 +74,7 @@ KGmap *mapReader::parseMap(const QString &path)
else if ( ! pat.isEmpty() )
{
QTextStream stream(stderr);
stream << "divisionToCapitalPattern element should contain one '%%' in map " << kgmap->getName();
stream << "divisionToCapitalPattern element should contain one '%%' in map " << kgmap->getName() << kgmap -> getFile();
}
QString title = getElementString(QStringLiteral("capitalToDivisionTitle"), root, Optional);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment