StarMgr.cpp   StarMgr.cpp 
skipping to change at line 510 skipping to change at line 510
continue; continue;
} }
QString englishCommonName = recordRx.capturedTexts() .at(2).trimmed(); QString englishCommonName = recordRx.capturedTexts() .at(2).trimmed();
if (englishCommonName.isEmpty()) if (englishCommonName.isEmpty())
{ {
qWarning() << "WARNING - parse error at line " << lineNumber << "in" << commonNameFile qWarning() << "WARNING - parse error at line " << lineNumber << "in" << commonNameFile
<< " - empty name field"; << " - empty name field";
continue; continue;
} }
englishCommonName.replace('_', ' '); // Fix for translate star names
// englishCommonName.replace('_', ' ');
const QString commonNameI18n = q_(englishCommonName) ; const QString commonNameI18n = q_(englishCommonName) ;
QString commonNameI18n_cap = commonNameI18n.toUpper( ); QString commonNameI18n_cap = commonNameI18n.toUpper( );
commonNamesMap[hip] = englishCommonName; commonNamesMap[hip] = englishCommonName;
commonNamesMapI18n[hip] = commonNameI18n; commonNamesMapI18n[hip] = commonNameI18n;
commonNamesIndexI18n[commonNameI18n_cap] = hip; commonNamesIndexI18n[commonNameI18n_cap] = hip;
readOk++; readOk++;
} }
} }
cnFile.close(); cnFile.close();
skipping to change at line 757 skipping to change at line 758
//qDebug() << " " << zone; //qDebug() << " " << zone;
} }
} }
return result; return result;
} }
//! Update i18 names from english names according to passed translator. //! Update i18 names from english names according to passed translator.
//! The translation is done using gettext with translated strings defined i n translations.h //! The translation is done using gettext with translated strings defined i n translations.h
void StarMgr::updateI18n() void StarMgr::updateI18n()
{ {
QRegExp transRx("_[(]\"(.*)\"[)]");
StelTranslator trans = StelApp::getInstance().getLocaleMgr().getSkyT ranslator(); StelTranslator trans = StelApp::getInstance().getLocaleMgr().getSkyT ranslator();
commonNamesMapI18n.clear(); commonNamesMapI18n.clear();
commonNamesIndexI18n.clear(); commonNamesIndexI18n.clear();
for (QHash<int,QString>::ConstIterator it(commonNamesMap.constBegin( ));it!=commonNamesMap.constEnd();it++) for (QHash<int,QString>::ConstIterator it(commonNamesMap.constBegin( ));it!=commonNamesMap.constEnd();it++)
{ {
const int i = it.key(); const int i = it.key();
const QString t(trans.qtranslate(it.value())); transRx.exactMatch(it.value());
QString tt = transRx.capturedTexts().at(1);
const QString t = trans.qtranslate(tt);
//const QString t(trans.qtranslate(it.value()));
commonNamesMapI18n[i] = t; commonNamesMapI18n[i] = t;
commonNamesIndexI18n[t.toUpper()] = i; commonNamesIndexI18n[t.toUpper()] = i;
} }
} }
// Search the star by HP number // Search the star by HP number
StelObjectP StarMgr::searchHP(int hp) const StelObjectP StarMgr::searchHP(int hp) const
{ {
if (0 < hp && hp <= NR_OF_HIP) if (0 < hp && hp <= NR_OF_HIP)
{ {
 End of changes. 3 change blocks. 
2 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/