Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <translator.h>
Classes | |
struct | Duplicates |
struct | FileFormat |
Public Types | |
enum | LocationsType { DefaultLocations , NoLocations , RelativeLocations , AbsoluteLocations } |
using | DuplicateEntries = QHash<int, QVector<int>> |
typedef TranslatorMessage::ExtraData | ExtraData |
typedef bool(*) | SaveFunction(const Translator &, QIODevice &out, ConversionData &data) |
typedef bool(*) | LoadFunction(Translator &, QIODevice &in, ConversionData &data) |
Static Public Member Functions | |
static QString | makeLanguageCode (QLocale::Language language, QLocale::Territory territory) |
static void | languageAndTerritory (QStringView languageCode, QLocale::Language *langPtr, QLocale::Territory *territoryPtr) |
static QString | guessLanguageCodeFromFileName (const QString &fileName) |
static QStringList | normalizedTranslations (const TranslatorMessage &m, int numPlurals) |
static void | registerFileFormat (const FileFormat &format) |
static QList< FileFormat > & | registeredFileFormats () |
Static Public Attributes | |
static constexpr QChar | TextVariantSeparator {0x2762} |
static constexpr QChar | BinaryVariantSeparator {0x9c} |
Definition at line 88 of file translator.h.
using Translator::DuplicateEntries = QHash<int, QVector<int>> |
Definition at line 118 of file translator.h.
Definition at line 158 of file translator.h.
bool(*) Translator::LoadFunction(Translator &, QIODevice &in, ConversionData &data) |
Definition at line 167 of file translator.h.
bool(*) Translator::SaveFunction(const Translator &, QIODevice &out, ConversionData &data) |
Definition at line 166 of file translator.h.
Enumerator | |
---|---|
DefaultLocations | |
NoLocations | |
RelativeLocations | |
AbsoluteLocations |
Definition at line 131 of file translator.h.
QT_BEGIN_NAMESPACE Translator::Translator | ( | ) |
Definition at line 28 of file translator.cpp.
void Translator::append | ( | const TranslatorMessage & | msg | ) |
Definition at line 165 of file translator.cpp.
Referenced by appendSorted(), extend(), loadPO(), loadQM(), QPHReader::read(), TSReader::read(), and DataModel::release().
void Translator::appendSorted | ( | const TranslatorMessage & | msg | ) |
Definition at line 170 of file translator.cpp.
References append(), and TranslatorMessage::lineNumber().
Referenced by replaceSorted().
|
inline |
Definition at line 149 of file translator.h.
Referenced by updateTsFiles().
|
inline |
Definition at line 153 of file translator.h.
void Translator::dropTranslations | ( | ) |
Definition at line 468 of file translator.cpp.
Referenced by main(), and savePOT().
void Translator::dropUiLines | ( | ) |
Definition at line 477 of file translator.cpp.
Referenced by main().
void Translator::dump | ( | ) | const |
Definition at line 760 of file translator.cpp.
References TranslatorMessage::dump(), message(), and messageCount().
void Translator::extend | ( | const TranslatorMessage & | msg, |
ConversionData & | cd ) |
Definition at line 112 of file translator.cpp.
References append(), TranslatorMessage::extras(), find(), TranslatorMessage::lineNumber(), and TranslatorMessage::setExtras().
Referenced by FindTrCalls::endVisit(), and recordMessage().
Definition at line 750 of file translator.cpp.
|
inline |
Definition at line 162 of file translator.h.
Referenced by DataModel::load(), savePO(), saveTS(), and saveXLIFF().
int Translator::find | ( | const QString & | context | ) | const |
Definition at line 391 of file translator.cpp.
int Translator::find | ( | const QString & | context, |
const QString & | comment, | ||
const TranslatorMessage::References & | refs ) const |
Definition at line 373 of file translator.cpp.
int Translator::find | ( | const TranslatorMessage & | msg | ) | const |
Definition at line 360 of file translator.cpp.
Referenced by extend(), and replaceSorted().
Definition at line 719 of file translator.cpp.
bool Translator::hasExtra | ( | const QString & | ba | ) | const |
Definition at line 745 of file translator.cpp.
|
static |
Definition at line 336 of file translator.cpp.
|
inline |
Definition at line 128 of file translator.h.
bool Translator::load | ( | const QString & | filename, |
ConversionData & | err, | ||
const QString & | format ) |
Definition at line 244 of file translator.cpp.
|
inline |
Definition at line 133 of file translator.h.
Referenced by DataModel::load(), and merge().
Definition at line 649 of file translator.cpp.
|
static |
Definition at line 326 of file translator.cpp.
|
inline |
Definition at line 147 of file translator.h.
Referenced by PRESUBMIT_test_mocks.MockOutputApi.PresubmitResult::__repr__(), applySameTextHeuristic(), and main().
|
inline |
Definition at line 148 of file translator.h.
Referenced by PRESUBMIT_test_mocks.MockOutputApi.PresubmitResult::__repr__(), dump(), TranslatorMessagePtrBase::operator->(), and saveQM().
|
inline |
Definition at line 146 of file translator.h.
Referenced by applySameTextHeuristic(), dump(), DataModel::load(), main(), TSReader::read(), CppParser::recordResults(), saveQM(), and updateTsFiles().
const QList< TranslatorMessage > & Translator::messages | ( | ) | const |
Definition at line 664 of file translator.cpp.
QStringList Translator::normalizedTranslations | ( | const TranslatorMessage & | m, |
ConversionData & | cd, | ||
bool * | ok ) const |
|
static |
Definition at line 669 of file translator.cpp.
References TranslatorMessage::isPlural().
void Translator::normalizeTranslations | ( | ConversionData & | cd | ) |
Definition at line 686 of file translator.cpp.
References TranslatorMessage::isPlural().
Referenced by main(), and releaseTranslator().
|
static |
Definition at line 46 of file translator.cpp.
|
static |
Definition at line 34 of file translator.cpp.
References Translator::FileFormat::priority.
Referenced by initPO(), initQM(), initQPH(), initTS(), and initXLIFF().
void Translator::replaceSorted | ( | const TranslatorMessage & | msg | ) |
Definition at line 87 of file translator.cpp.
References appendSorted(), and find().
Referenced by main().
void Translator::reportDuplicates | ( | const Duplicates & | dupes, |
const QString & | fileName, | ||
bool | verbose ) |
Definition at line 609 of file translator.cpp.
void Translator::reportDuplicatesLines | ( | const TranslatorMessage & | msg, |
const DuplicateEntries::value_type & | dups ) const |
Definition at line 636 of file translator.cpp.
References TranslatorMessage::tsLineNumber().
Translator::Duplicates Translator::resolveDuplicates | ( | ) |
Definition at line 559 of file translator.cpp.
References TranslatorMessage::isTranslated(), and TranslatorMessage::tsLineNumber().
Referenced by DataModel::load(), main(), and releaseTranslator().
bool Translator::save | ( | const QString & | filename, |
ConversionData & | err, | ||
const QString & | format ) const |
Definition at line 287 of file translator.cpp.
|
inline |
Definition at line 152 of file translator.h.
Definition at line 755 of file translator.cpp.
Definition at line 163 of file translator.h.
Definition at line 138 of file translator.h.
|
inline |
Definition at line 132 of file translator.h.
Referenced by loadQPH(), main(), merge(), and TSReader::read().
Definition at line 139 of file translator.h.
|
inline |
Definition at line 129 of file translator.h.
void Translator::stripEmptyContexts | ( | ) |
Definition at line 436 of file translator.cpp.
void Translator::stripFinishedMessages | ( | ) |
Definition at line 407 of file translator.cpp.
References TranslatorMessage::Finished.
Referenced by main().
void Translator::stripIdenticalSourceTranslations | ( | ) |
Definition at line 456 of file translator.cpp.
Referenced by releaseTranslator().
void Translator::stripNonPluralForms | ( | ) |
Definition at line 446 of file translator.cpp.
Referenced by main().
void Translator::stripObsoleteMessages | ( | ) |
Definition at line 397 of file translator.cpp.
References TranslatorMessage::Obsolete, and TranslatorMessage::Vanished.
Referenced by main().
void Translator::stripUntranslatedMessages | ( | ) |
Definition at line 417 of file translator.cpp.
Referenced by main().
bool Translator::translationsExist | ( | ) | const |
Definition at line 427 of file translator.cpp.
|
staticconstexpr |
Definition at line 183 of file translator.h.
|
staticconstexpr |
Definition at line 182 of file translator.h.