From 5e4035ede6505f638f4741dcebbf19e485a1b993 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 29 Oct 2009 14:50:51 +0100 Subject: qdoc3: Fixed a linking error for qml properties. This: https://qtmetrics.europe.nokia.com/kinetic-declarativeui/qml-item.html#rotation-prop should now be this: https://qtmetrics.europe.nokia.com/kinetic-declarativeui/qml-item.html#transformOrigin-prop) --- tools/qdoc3/htmlgenerator.cpp | 11 +++++++---- tools/qdoc3/pagegenerator.cpp | 19 +++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 18c7916..eaf4b2e 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3467,10 +3467,13 @@ QString HtmlGenerator::refForNode(const Node *node) ref += "-" + QString::number(func->overloadNumber()); } break; - case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML + case Node::Fake: + if (node->subType() != Node::QmlPropertyGroup) + break; case Node::QmlProperty: #endif + case Node::Property: ref = node->name() + "-prop"; break; #ifdef QDOC_QML @@ -3512,9 +3515,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) // ### reintroduce this test, without breaking .dcf files if (fn != outFileName()) #endif - link += fn; + link += fn; - if (!node->isInnerNode()) { + if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { ref = refForNode(node); if (relative && fn == fileName(relative) && ref == refForNode(relative)) return QString(); diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 83ea561..7d9fbee 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -81,14 +81,13 @@ QString PageGenerator::fileBase(const Node *node) { if (node->relates()) node = node->relates(); - else if (!node->isInnerNode()) { + else if (!node->isInnerNode()) node = node->parent(); #ifdef QDOC_QML - if (node->subType() == Node::QmlPropertyGroup) { - node = node->parent(); - } -#endif + if (node->subType() == Node::QmlPropertyGroup) { + node = node->parent(); } +#endif QString base = node->doc().baseName(); if (!base.isEmpty()) @@ -97,6 +96,7 @@ QString PageGenerator::fileBase(const Node *node) const Node *p = node; forever { + const Node *pp = p->parent(); base.prepend(p->name()); #ifdef QDOC_QML /* @@ -104,15 +104,10 @@ QString PageGenerator::fileBase(const Node *node) we prepend "qml-" to the file name of QML element doc files. */ - if ((p->subType() == Node::QmlClass) || - (p->subType() == Node::QmlPropertyGroup)) - base.prepend("qml-"); - else if ((p->type() == Node::QmlProperty) || - (p->type() == Node::QmlSignal) || - (p->type() == Node::QmlMethod)) + if (p->subType() == Node::QmlClass) { base.prepend("qml-"); + } #endif - const Node *pp = p->parent(); if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake) break; base.prepend(QLatin1Char('-')); -- cgit v0.12 From 9f2a0c09a90daa46b7432037595b750406bbd506 Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Mon, 2 Nov 2009 11:44:21 +1000 Subject: Added documentation of RPATH defines. --- doc/src/development/qmake-manual.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 6c53242..352db75 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2342,6 +2342,8 @@ For example: \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. \section1 QMAKE_LFLAGS_RPATH + + \e {This is used on Unix platforms only.} Library paths in this definition are added to the executable at link time so that the added paths will be preferentially searched at runtime. @@ -2673,11 +2675,15 @@ For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 45 \section1 QMAKE_RPATH + + \e {This is used on Unix platforms only.} Is equivalent to \l QMAKE_LFLAGS_RPATH. \section1 QMAKE_RPATHDIR + \e {This is used on Unix platforms only.} + A list of library directory paths, these paths are added to the executable at link time so that the paths will be preferentially searched at runtime. -- cgit v0.12 From c55c08b38dd902765f476f62369378813c8e804f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 15:27:59 +0100 Subject: Doc: i18n overhaul for QObject::tr() and the Qt Linguist manual. Reviewed-by: Trust Me --- doc/src/internationalization/i18n.qdoc | 267 ++++++++++++++- doc/src/internationalization/linguist-manual.qdoc | 368 ++------------------- doc/src/snippets/code/doc_src_i18n.qdoc | 2 +- .../snippets/code/src_corelib_kernel_qobject.cpp | 3 +- examples/mainwindows/sdi/mainwindow.h | 2 + src/corelib/kernel/qobject.cpp | 146 +------- 6 files changed, 310 insertions(+), 478 deletions(-) diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index e873f4e..1a2839d 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -51,6 +51,7 @@ \page internationalization.html \title Internationalization with Qt \brief Information about Qt's support for internationalization and multiple languages. + \nextpage Writing Source Code for Translation \keyword internationalization \keyword i18n @@ -59,11 +60,11 @@ the application usable by people in countries other than one's own. \tableofcontents - + \section1 Relevant Qt Classes and APIs These classes support internationalizing of Qt applications. - + \annotatedlist i18n \section1 Languages and Writing Systems @@ -516,3 +517,265 @@ For details on Mac-specific translation, refer to the Qt/Mac Specific Issues document \l{Qt for Mac OS X - Specific Issues#Translating the Application Menu and Native Dialogs}{here}. */ + +/*! + \page i18n-source-translation.html + \title Writing Source Code for Translation + \ingroup i18n + \previouspage Internationalization with Qt + \contentspage Internationalization with Qt + \nextpage Translation Rules for Plurals + \brief How to write source code in a way that makes it possible for user-visible text to be translated. + + \tableofcontents + + \section1 The Basics + + Developers use the \l{QObject::}{tr()} function to obtain translated text + for their classes, typically for display purposes. This function is also + used to indicate which text strings in an application are translatable. + + Qt indexes each translatable string by the \e{translation context} it is + associated with; this is generally the name of the QObject subclass it is + used in. + + Translation contexts are defined for new QObject-based classes by the use + of the Q_OBJECT macro in each new class definition. + + When tr() is called, it looks up the translatable string using a QTranslator + object. For translation to work, one or more of these must have been + installed on the application object in the way described in the + \l{#Enabling Translation}{Enabling Translation} section below. + + \section1 Defining a Translation Context + + The translation context for QObject and each QObject subclass is the + class name itself. Developers subclassing QObject must use the + Q_OBJECT macro in their class definition to override the translation + context. This macro sets the context to the name of the subclass. + + For example, the following class definition includes the Q_OBJECT macro, + implementing a new tr() that uses the \c MainWindow context: + + \snippet mainwindows/sdi/mainwindow.h class definition with macro + \dots + + If Q_OBJECT is not used in a class definition, the context will be + inherited from the base class. For example, since all QObject-based + classes in Qt provide a context, a new QWidget subclass defined without + a Q_OBJECT macro will use the \c QWidget context if its tr() function + is invoked. + + \section1 Using tr() to Obtain a Translation + + The following example shows how a translation is obtained for the + class shown in the previous section: + + \snippet mainwindows/sdi/mainwindow.cpp implicit tr context + \dots + + Here, the translation context is \c MainWindow because it is the + \c MainWindow::tr() function that is invoked. The text returned + by the tr() function is a translation of "&File" obtained from + the \c MainWindow context. + + When Qt's translation tool, \l lupdate, is used to process a set of source + files, the text wrapped in tr() calls is stored in a section of the translation + file that corresponds to its translation context. + + In some situations, it is useful to give a translation context explicitly + by fully qualifying the call to tr(); for example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context + + This call obtains the translated text for "Page up" from the \c QScrollBar + context. Developers can also use the QCoreApplication::translate() function + to obtain a translation for a particular translation context. + + \section1 Translator Comments + + Developers can include information about each translatable string to + help translators with the translation process. These are extracted + when \l lupdate is used to process the source files. The recommended + way to add comments is to annotate the tr() calls in your code with + comments of the form: + + \tt{//: ...} + + or + + \tt{\begincomment: ... \endcomment} + + Examples: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 + + In these examples, the comments will be associated with the strings + passed to tr() in the context of each call. + + \section1 Adding Meta-Data to Strings + + Additional data can be attached to each translatable message. These are + extracted when \l lupdate is used to process the source files. The + recommended way to add meta-data is to annotate the tr() calls in your code + with comments of the form: + + \tt{//= } + + This can be used to give the message a unique identifier to support tools + which need it. + + An alternative way to attach meta-data is to use the following syntax: + + \tt{//~ } + + This can be used to attach meta-data to the message. The field name should + consist of a domain prefix (possibly the conventional file extension of the + file format the field is inspired by), a hyphen and the actual field name + in underscore-delimited notation. For storage in TS files, the field name + together with the prefix "extra-" will form an XML element name. The field + contents will be XML-escaped, but otherwise appear verbatim as the + element's contents. Any number of unique fields can be added to each + message. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data + + Meta-data appearing right in front of a magic TRANSLATOR comment applies to + the whole TS file. + + \section1 Disambiguation + + If the same translatable string is used in different roles within the same + translation context, an additional identifying string may be passed in + the call to \l{QObject::}{tr()}. This optional disambiguation argument + is used to distinguish between otherwise identical strings. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \dots + + In Qt 4.4 and earlier, this disambiguation parameter was the preferred + way to specify comments to translators. + + \section1 Character Encodings + + You can set the encoding for the source text by calling QTextCodec::setCodecForTr(). + By default, the source text is assumed to be in Latin-1 encoding. + + \section1 Handling Plurals + + Some translatable strings contain placeholders for integer values and need + to be translated differently depending on the values in use. + + To help with this problem, developers pass an additional integer argument + to the \l{QObject::}{tr()} function, and typically use a special notation + for plurals in each translatable string. + + If this argument is equal or greater than zero, all occurrences of + \c %n in the resulting string are replaced with a decimal representation + of the value supplied. In addition, the translation used will adapt to the + value according to the rules for each language. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 + + The table below shows what string is returned depending on the + active translation: + + \table + \header \o \o{3,1} Active Translation + \header \o \a n \o No Translation \o French \o English + \row \o 0 \o "0 message(s) saved" \o "0 message sauvegard\unicode{0xE9}" \o "0 message\bold{s} saved" + \row \o 1 \o "1 message(s) saved" \o "1 message sauvegard\unicode{0xE9}" \o "1 message saved" + \row \o 2 \o "2 message(s) saved" \o "2 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "2 message\bold{s} saved" + \row \o 37 \o "37 message(s) saved" \o "37 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "37 message\bold{s} saved" + \endtable + + This idiom is more flexible than the traditional approach; e.g., + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 + + because it also works with target languages that have several + plural forms (e.g., Irish has a special "dual" form that should + be used when \c n is 2), and it handles the \e n == 0 case + correctly for languages such as French that require the singular. + See the \l{Qt Linguist Manual} for details. + + Instead of \c %n, you can use \c %Ln to produce a localized + representation of \a n. The conversion uses the default locale, + set using QLocale::setDefault(). (If no default locale was + specified, the "C" locale is used.) + + A summary of the rules used to translate strings containing plurals can be + found in the \l{Translation Rules for Plurals} document. + + \section1 Enabling Translation + + Typically, your application's \c main() function will look like + this: + + \snippet doc/src/snippets/code/doc_src_i18n.qdoc 8 + + Note the use of QLibraryInfo::location() to locate the Qt translations. + Developers should request the path to the translations at run-time by + passing QLibraryInfo::TranslationsPath to this function instead of + using the \c QTDIR environment variable in their applications. + + \section1 Further Reading + + \l{Qt Linguist Manual}, \l{Hello tr Example}, \l{Translation Rules for Plurals} +*/ + +/*! + \page i18n-plural-rules.html + \title Translation Rules for Plurals + \ingroup i18n + \previouspage Writing Source Code for Translation + \contentspage Internationalization with Qt + \brief A summary of the translation rules for plurals produced by Qt's i18n tools. + + The table below shows the specific rules that are produced by Qt Linguist + and \c lrelease for a selection of languages. Cells marked \e otherwise + indicate the form used when none of the other rules are appropriate for a + specific language. + + \table 80% + \header \o Language \o Rule 1 \o Rule 2 \o Rule 3 + \row \o English \o \c{n == 1} + \o \e{otherwise} \o N/A + \row \o French \o \c{n < 2} + \o \e{otherwise} \o N/A + \row \o Czech \o \c{n % 100 == 1} + \o \c{n % 100 >= 2 && n % 100 <= 4} + \o \e{otherwise} + \row \o Irish \o \c{n == 1} + \o \c{n == 2} \o \e{otherwise} + \row \o Latvian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n != 0} \o \e{otherwise} + \row \o Lithuanian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n % 100 != 12 && n % 10 == 2} + \o \e{otherwise} + \row \o Macedonian \o \c{n % 10 == 1} + \o \c{n % 10 == 2} \o \e{otherwise} + \row \o Polish \o \c{n == 1} + \o \c{n % 10 >= 2 && n % 10 <= 4 + && (n % 100 < 10 || n % 100 > 20)} + \o \e{otherwise} + \row \o Romanian \o \c{n == 1} + \o \c{n == 0|| (n % 100 >= 1 && n % 100 <= 20)} + \o \e{otherwise} + \row \o Russian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n % 10 >= 2 && n % 10 <= 4 + && (n % 100 < 10 || n % 100 > 20)} + \o \e{otherwise} + \row \o Slovak \o \c{n == 1} \o \c{n >= 2 && n <= 4} + \o \e{otherwise} + \row \o Japanese \o \e{otherwise} \o N/A \o N/A + \endtable + + The rules themselves are not documented and are internal to Qt Linguist and \c lrelease. +*/ diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc index 5d388f1..3e06a2f 100644 --- a/doc/src/internationalization/linguist-manual.qdoc +++ b/doc/src/internationalization/linguist-manual.qdoc @@ -62,7 +62,7 @@ software engineers and the translator. The chapter describes the use of two tools. The \l{lupdate} tool is used to synchronize source code and translations. The \l{lrelease} tool is used to - create runtime translation files for use by the released + create run-time translation files for use by the released application. The \l{linguist-translators.html}{Translators} chapter is for @@ -119,7 +119,7 @@ \o Phrases that contain variables, for example, "The 25 files selected will take 63 seconds to process", where the two numbers - are inserted programmatically at runtime may need to be reworded + are inserted programmatically at run-time may need to be reworded because in a different language the word order and therefore the placement of the variables may have to change. @@ -147,7 +147,7 @@ \row \o{1,2} \inlineimage wVista-Cert-border-small.png \o \e{Qt Linguist 4.3 is Certified for Windows Vista} - + \row \o Windows Vista and the Windows Vista Start button are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. @@ -508,7 +508,7 @@ translation. The state is reset to \inlineimage linguist-danger.png , and the number of accepted translations in the \e{Items} column of the \l{Context Window} {context list} is decremented by 1. - + \row \o Not Accepted \o \inlineimage linguist-check-off.png @@ -781,7 +781,7 @@ changed. Whichever character (alpha or digit) is chosen, the translation must be in the form "Ctrl+" followed by the upper case character. \e{Qt} will automatically display the correct name at - runtime. As with Alt key accelerators, if the translator changes + run-time. As with Alt key accelerators, if the translator changes the character, the new character must not conflict with any other Ctrl key accelerator. @@ -790,14 +790,14 @@ supported languages, \e {Qt} automatically translates these strings. - \section2 Handling Numbered Arguments + \section2 Handling Numbered Arguments and Plurals Some phrases contain numbered arguments. A numbered argument is a - placeholder that will be replaced with text at runtime. A numbered + placeholder that will be replaced with text at run-time. A numbered argument appears in a source string as a percent sign followed by a digit. Consider an example: \c{After processing file %1, file %2 is next in line}. In this string to be translated, \c{%1} and - \c{%2} are numbered arguments. At runtime, \c{%1} and \c{%2} will + \c{%2} are numbered arguments. At run-time, \c{%1} and \c{%2} will be replaced with the first and next file names respectively. The same numbered arguments must appear in the translation, but not necessarily in the same order. A German translation of the string @@ -808,336 +808,14 @@ of where argument \e{i} appears in the argument sequence in the source string. - \section2 Plurals - - The problem of plurals in output is resolved by using an overload of - the \c tr() function with the signature - \code - QString tr(const char *text, const char *comment, int n); - \endcode - Using built in comparisons for the value of \c n the tr() function will - translate the phrase to the plural form for the target language. - - Different languages have various forms for plurals beyond simply - \e singular and \e plural. The rules for determining which form of the - plural to use are encoded as conditional tests. Below is a table - representing the numbers associated with the forms rather than the - conditional tests themselves. - - - - \table 90% - \header - \o Language - \o Form 1 - \o Form 2 - \o Form 3 - \o Form 4 - \row - \o Arabic - \o 0, 1, 11-102, 111-202... - \o 2 - \o 3-10, 103-110, 203-210... - \o - \row - \o Basque - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Bulgarian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Catalan - \o 1 - \o 11, 11 000-11 999, 11 000 000-11 999 999... - \o 0, 2-10, 12-10 999, 12-10 999 999... - \o - \row - \o Chinese-CN - \o 0- - \o - \o - \o - \row - \o Chinese-HK - \o 0- - \o - \o - \o - \row - \o Chinese-TW - \o 0- - \o - \o - \o - \row - \o Croation - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34, 42-44... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Czech - \o 1 - \o 2-4 - \o 0, 5- - \o - \row - \o Danish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Dutch - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o English - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o English-US - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Estonian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Finnish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o French-CA - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o French-FR - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o Galician - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o German - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Greek - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Hebrew - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Hungarian - \o 0- - \o - \o - \o - \row - \o Icelandic - \o 1, 21, 31, 41, 51....101, 121, 131... - \o 0, 2-20, 22-30, 32-40...102-120... - \o - \o - \row - \o Indonesian - \o 0- - \o - \o - \o - \row - \o Italian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Japanese - \o 0- - \o - \o - \o - \row - \o Korean - \o 0- - \o - \o - \o - \row - \o Latvian - \o 0 - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 131, 141... - \o 2-20, 22-30, 32-40, 42-50...202-220, 222-230... - \o - \row - \o Lithuanian - \o 1, 21, 31, 41, 51...101, 121, 131... - \o 2-9, 22-29, 32-39...102-109, 122-129, 132-139... - \o 0, 10-20, 30, 40, 50...110-120, 130, 140... - \o - \row - \o Malay - \o 0- - \o - \o - \o - \row - \o Norwegian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Persian - \o 0- - \o - \o - \o - \row - \o Polish - \o 1 - \o 2-4, 22-24, 32-34... - \o 5-21, 25-31, 35-41... - \o - \row - \o Portugese-BR - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o Portugese-PT - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Romanian - \o 1 - \o 0, 2-19, 101-119, 201-219... - \o 20-100, 120-200, 220-300... - \o - \row - \o Russian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Serbian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Slovak - \o 1 - \o 2-4 - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Slovene - \o 1, 101, 201, 301... - \o 2, 102, 202, 302... - \o 3, 4, 103, 104, 203, 204, 303, 304... - \o 0, 5-100, 105-200, 205-300... - \row - \o Spanish-US - \o 1 - \o 0, 2- - \o - \o - \row - \o Spanish-ES - \o 1 - \o 0, 2- - \o - \o - \row - \o Swedish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Tagalog - \o 0, 1 - \o 2, 3, 5, 7-8, 10-13, 15, 17-18, 20-23...101...1001 - \o 4, 6, 9, 14, 16, 19, 24, 26, 29...104, 106, 109... - \o - \row - \o Thai - \o 0- - \o - \o - \o - \row - \o Turkish - \o 0- - \o - \o - \o - \row - \o Ukrainian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Urdu - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Vietnamese - \o 0- - \o - \o - \o - \endtable - - These rules are embedded within the Qt libraries, there is no need for - the developer to know them. Merely to use the correct \c tr() call. - + The use of numbered arguments is often accompanied by the use of + plurals in the source text. In many languages, the form of the + text will depend on the value shown, and more than one translation + is required. If the developers have marked up the source text in + correct way, fields for each of the possible plural forms will be + available in the translation area. (The + \l{Writing Source Code for Translation#Handling Plurals}{Writing Source Code for Translation} + document contains details about this feature for developers.) \section2 Reusing Translations @@ -1157,7 +835,7 @@ {translation area}, and adapts the number of input fields for plural forms accordingly. If not explicitly set, \QL guesses the target language and country by evaluating the translation source - file name: E.g. \c app_de.ts sets the target language to German, + file name. For example, \c app_de.ts sets the target language to German, and \c app_de_ch.ts sets the target language to German and the target country to Switzerland (this also helps loading translations for the current locale automatically; see @@ -1287,7 +965,7 @@ can be used to edit XLIFF files generated by other programs. For standard Qt projects, however, only the TS file format is used. \o QM \e {Qt message files} \BR are binary files that contain - translations used by an application at runtime. These files are + translations used by an application at run-time. These files are generated by \l lrelease, but can also be generated by \QL. \o \c .qph \e {Qt phrase book files} \BR are human-readable XML files containing standard phrases and their translations. These files @@ -1416,7 +1094,7 @@ \endlist - \o \gui {Tools} + \o \gui {Tools} \list \o \gui {Batch Translation...} \BR Opens a \l{Batch @@ -1427,7 +1105,7 @@ Preview}. This window let you instantly see translations for forms created with \QD. \endlist - \o \gui {View} + \o \gui {View} \list \o \gui {Revert Sorting} \BR puts the items in the \l{Context @@ -1449,7 +1127,7 @@ \endlist - \o \gui {Help} + \o \gui {Help} \list \o \gui {Manual F1} \BR opens this manual. \o \gui {About Qt Linguist} \BR Shows information about \QL. @@ -1621,7 +1299,7 @@ \code CODECFORTR = UTF-8 \endcode - + See the \l lupdate and \l lrelease sections. \section2 Loading Translations @@ -1683,7 +1361,7 @@ \snippet doc/src/snippets/code/doc_src_linguist-manual.qdoc 9 - \section2 Distinguishing Identical Strings That Require Different Translations + \section2 Distinguishing Between Identical Translatable Strings The \l lupdate program automatically provides a \e context for every source text. This context is the class name of the class that contains diff --git a/doc/src/snippets/code/doc_src_i18n.qdoc b/doc/src/snippets/code/doc_src_i18n.qdoc index eca2868..80faabc 100644 --- a/doc/src/snippets/code/doc_src_i18n.qdoc +++ b/doc/src/snippets/code/doc_src_i18n.qdoc @@ -184,7 +184,7 @@ void Clock::setTime(const QTime &time) //! [12] -void QWidget::changeEvent(QEvent *event) +void MyWidget::changeEvent(QEvent *event) { if (e->type() == QEvent::LanguageChange) { titleLabel->setText(tr("Document Title")); diff --git a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp index 4c64374..88d8025 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp @@ -235,9 +235,8 @@ MyWindow::MyWindow() { QLabel *senderLabel = new QLabel(tr("Name:")); QLabel *recipientLabel = new QLabel(tr("Name:", "recipient")); - ... -} //! [17] +} //! [18] diff --git a/examples/mainwindows/sdi/mainwindow.h b/examples/mainwindows/sdi/mainwindow.h index ca478df..a925e2f 100644 --- a/examples/mainwindows/sdi/mainwindow.h +++ b/examples/mainwindows/sdi/mainwindow.h @@ -50,12 +50,14 @@ class QMenu; class QTextEdit; QT_END_NAMESPACE +//! [class definition with macro] class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); +//! [class definition with macro] MainWindow(const QString &fileName); protected: diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7be19b3..7031957 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -582,7 +582,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) QObjects organize themselves in object trees. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The - parent takes ownership of the object i.e. it will automatically + parent takes ownership of the object; i.e., it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren(). @@ -646,7 +646,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) to be stored in one of the container classes. You must store pointers. - \section2 Auto-Connection + \section1 Auto-Connection Qt's meta-object system provides a mechanism to automatically connect signals and slots between QObject subclasses and their children. As long @@ -660,7 +660,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) given in the \l{Using a Designer UI File in Your Application} section of the \QD manual. - \section2 Dynamic Properties + \section1 Dynamic Properties From Qt 4.2, dynamic properties can be added to and removed from QObject instances at run-time. Dynamic properties do not need to be declared at @@ -673,6 +673,15 @@ int QMetaCallEvent::placeMetaCall(QObject *object) and both standard Qt widgets and user-created forms can be given dynamic properties. + \section1 Internationalization (i18n) + + All QObject subclasses support Qt's translation features, making it possible + to translate an application's user interface into different languages. + + To make user-visible text translatable, it must be wrapped in calls to + the tr() function. This is explained in detail in the + \l{Writing Source Code for Translation} document. + \sa QMetaObject, QPointer, QObjectCleanupHandler, Q_DISABLE_COPY() {Object Trees and Object Ownership} */ @@ -2157,65 +2166,10 @@ void QObject::deleteLater() otherwise returns \a sourceText itself if no appropriate translated string is available. - See the sections below on Disambiguation and Handling Plurals for more - information about the optional \a disambiguation and \a n parameters. - - QObject and its subclasses obtain translated strings from any translator - objects that have been installed on the application object; see the - QTranslator documentation for details about this mechanism. - - A translatable string is referenced by its translation context; - this is the name of the QObject subclass whose tr() function is invoked, - as in the following example: - + Example: \snippet mainwindows/sdi/mainwindow.cpp implicit tr context \dots - Here, the context is \c MainWindow because it is the \c MainWindow::tr() - function that is invoked. Translation contexts can be given explicitly - by fully qualifying the call to tr(); for example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context - - This call obtains the translated text for "Page up" from the \c QScrollBar - context. - - \section1 Defining Translation Contexts - - The translation context for QObject and each QObject subclass is the - class name itself. Developers subclassing QObject must use the - Q_OBJECT macro in their class definition to override the translation - context. This macro sets the context to the name of the subclass. - - If Q_OBJECT is not used in a class definition, the context will be - inherited from the base class. For example, since all QObject-based - classes in Qt provide a context, a new QWidget subclass defined without - a Q_OBJECT macro will use the "QWidget" context if its tr() function - is invoked. - - \section1 Translator Comments - - Developers can include information about each translatable string to - help translators with the translation process. These are extracted - when \l lupdate is used to process the source files. The recommended - way to add comments is to annotate the tr() calls in your code with - comments of the form: - - \tt{//: ...} - - or - - \tt{\begincomment: ... \endcomment} - - Examples: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 - - In these examples, the comments will be associated with the strings - passed to tr() in the context of each call. - - \section1 Disambiguation - If the same \a sourceText is used in different roles within the same context, an additional identifying string may be passed in \a disambiguation (0 by default). In Qt 4.4 and earlier, this was @@ -2224,76 +2178,12 @@ void QObject::deleteLater() Example: \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \dots - \section1 Meta Data - - Additional data can be attached to each translatable message. - The syntax: - - \tt{//= } - - can be used to give the message a unique identifier to support tools - which need it. - The syntax: - - \tt{//~ } - - can be used to attach meta data to the message. The field name should consist - of a domain prefix (possibly the conventional file extension of the file format - the field is inspired by), a hyphen and the actual field name in - underscore-delimited notation. For storage in TS files, the field name together - with the prefix "extra-" will form an XML element name. The field contents will - be XML-escaped, but otherwise appear verbatim as the element's contents. - Any number of unique fields can be added to each message. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data - - Meta data appearing right in front of a magic TRANSLATOR comment applies to the - whole TS file. - - \section1 Character Encodings - - You can set the encoding for \a sourceText by calling QTextCodec::setCodecForTr(). - By default \a sourceText is assumed to be in Latin-1 encoding. - - \section1 Handling Plurals - - If \a n >= 0, all occurrences of \c %n in the resulting string - are replaced with a decimal representation of \a n. In addition, - depending on \a n's value, the translation text may vary. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 - - The table below shows what string is returned depending on the - active translation: - - \table - \header \o \o{3,1} Active Translation - \header \o \a n \o No Translation \o French \o English - \row \o 0 \o "0 message(s) saved" \o "0 message sauvegard\unicode{0xE9}" \o "0 message\bold{s} saved" - \row \o 1 \o "1 message(s) saved" \o "1 message sauvegard\unicode{0xE9}" \o "1 message saved" - \row \o 2 \o "2 message(s) saved" \o "2 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "2 message\bold{s} saved" - \row \o 37 \o "37 message(s) saved" \o "37 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "37 message\bold{s} saved" - \endtable - - This idiom is more flexible than the traditional approach; e.g., - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 - - because it also works with target languages that have several - plural forms (e.g., Irish has a special "dual" form that should - be used when \c n is 2), and it handles the \e n == 0 case - correctly for languages such as French that require the singular. - See the \l{Qt Linguist Manual} for details. - - Instead of \c %n, you can use \c %Ln to produce a localized - representation of \a n. The conversion uses the default locale, - set using QLocale::setDefault(). (If no default locale was - specified, the "C" locale is used.) + See \l{Writing Source Code for Translation} for a detailed description of + Qt's translation mechanisms in general, and the + \l{Writing Source Code for Translation#Disambiguation}{Disambiguation} + section for information on disambiguation. \warning This method is reentrant only if all translators are installed \e before calling this method. Installing or removing -- cgit v0.12 From 50a745d31e348c113d42444d527b4286b7064e3e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 15:30:15 +0100 Subject: Doc: Fixed qdoc warnings. Reviewed-by: Trust Me --- src/gui/kernel/qevent.cpp | 2 +- src/gui/symbian/qsymbianevent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 065bd09..617d016 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4330,7 +4330,7 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const } /*! - Sets the widget for this event. + Sets the widget for this event to the \a widget specified. */ void QGestureEvent::setWidget(QWidget *widget) { diff --git a/src/gui/symbian/qsymbianevent.cpp b/src/gui/symbian/qsymbianevent.cpp index af2c861..2799e6f 100644 --- a/src/gui/symbian/qsymbianevent.cpp +++ b/src/gui/symbian/qsymbianevent.cpp @@ -66,13 +66,13 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QSymbianEvent::type() + \fn QSymbianEvent::type() const Returns the event type contained in the QSymbianEvent instance. */ /*! - \fn QSymbianEvent::isValid() + \fn QSymbianEvent::isValid() const Returns whether this QSymbianEvent instance contains a valid event. */ -- cgit v0.12 From c4ce16e1eaa4504787f4cc739f3af7d1fdea8351 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 16:11:49 +0100 Subject: Fixed main window closing when subwindows cancel their close events. Reviewed-by: Trust Me Reported-here: http://lists.trolltech.com/pipermail/qt4-preview-feedback /2009-October/001023.html --- examples/mainwindows/mdi/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mainwindows/mdi/mainwindow.cpp b/examples/mainwindows/mdi/mainwindow.cpp index 712d91f..edb33b7 100644 --- a/examples/mainwindows/mdi/mainwindow.cpp +++ b/examples/mainwindows/mdi/mainwindow.cpp @@ -71,7 +71,7 @@ MainWindow::MainWindow() void MainWindow::closeEvent(QCloseEvent *event) { mdiArea->closeAllSubWindows(); - if (activeMdiChild()) { + if (mdiArea->currentSubWindow()) { event->ignore(); } else { writeSettings(); -- cgit v0.12 From 803fb60b1e98beddf4ebb8ea1a9224889c392e4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 17:34:41 +0100 Subject: Doc: Added a note about QApplication::installTranslator(). Reviewed-by: Alessandro Portale --- doc/src/internationalization/i18n.qdoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index 1a2839d..2d1b8cc 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -439,9 +439,13 @@ application language. The default event handler for QWidget subclasses responds to the - QEvent::LanguageChange event, and will call this function when necessary; - other application components can also force widgets to update themselves - by posting the \l{QEvent::LanguageChange}{LanguageChange} event to them. + QEvent::LanguageChange event, and will call this function when necessary. + + \l{QEvent::LanguageChange}{LanguageChange} events are posted when a new + translation is installed using the QCoreApplication::installTranslator() + function. Additionally, other application components can also force + widgets to update themselves by posting LanguageChange events to them. + \section1 Translating Non-Qt Classes -- cgit v0.12 From edec363cd4dfcb01c488be7f66bdfa2ca93f48bf Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 14:53:19 +0100 Subject: Doc: Added links to the SQL documentation and corrected license info. Reviewed-by: Trust Me --- doc/src/modules.qdoc | 5 ++++- doc/src/sql-programming/sql-programming.qdoc | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 9c92a31..ea5a9dc 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -367,6 +367,9 @@ The QtSql module is part of the \l{Qt Full Framework Edition} and the \l{Open Source Versions of Qt}. + + See the \l{SQL Programming} guide for information about using this + module in your applications. */ /*! @@ -576,7 +579,7 @@ the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU - GPL version 2. + GPL version 3. \legalese This file is part of the KDE project diff --git a/doc/src/sql-programming/sql-programming.qdoc b/doc/src/sql-programming/sql-programming.qdoc index d0b6776..3aceb17 100644 --- a/doc/src/sql-programming/sql-programming.qdoc +++ b/doc/src/sql-programming/sql-programming.qdoc @@ -49,6 +49,7 @@ /*! \page sql-programming.html \title SQL Programming + \nextpage Connecting to Databases \brief Database integration for Qt applications. @@ -95,7 +96,7 @@ and the SQL API layer. See \l{SQL Database Drivers} for more information. \section2 SQL API Layer - + These classes provide access to databases. Connections are made using the QSqlDatabase class. Database interaction is achieved by using the QSqlQuery class. @@ -119,6 +120,7 @@ \title Connecting to Databases \contentspage SQL Programming + \previouspage SQL Programming \nextpage Executing SQL Statements To access a database with QSqlQuery or QSqlQueryModel, create and -- cgit v0.12 From 86e074f47848955cd0ffbc78112493af46c2ed12 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 15:45:32 +0100 Subject: Doc: Fixed license information. Reviewed-by: Trust Me --- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 09dfae5..408478c 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -31,7 +31,7 @@ the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU - GPL version 2. + GPL version 3. \legalese WebKit is licensed under the GNU Library General Public License. -- cgit v0.12 From c95a0e6e8eb8ba5fd2a4412b318ad998b3ccb4fc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 16:06:05 +0100 Subject: Doc/i18n: Fixed source strings for translation. Reviewed-by: Oswald Buddenhagen --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 2 +- src/3rdparty/phonon/mmf/effectfactory.cpp | 4 ++-- .../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp | 4 ++-- src/gui/itemviews/qdirmodel.cpp | 2 +- src/network/ssl/qsslerror.cpp | 4 ++-- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/xmlpatterns/expr/qncnameconstructor_p.h | 2 +- src/xmlpatterns/parser/qquerytransformparser.cpp | 18 +++++++++--------- src/xmlpatterns/schema/qxsdschemahelper.cpp | 2 +- src/xmlpatterns/schema/qxsdschemaparser.cpp | 2 +- .../schema/qxsdvalidatinginstancereader.cpp | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 5dcbd42..0eb34b0 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -87,7 +87,7 @@ MediaObject::MediaObject(Backend *backend, QObject *parent) m_name = "MediaObject" + QString::number(count++); if (!m_backend->isValid()) { - setError(tr("Cannot start playback. \n\nCheck your Gstreamer installation and make sure you " + setError(tr("Cannot start playback. \n\nCheck your GStreamer installation and make sure you " "\nhave libgstreamer-plugins-base installed."), Phonon::FatalError); } else { m_root = this; diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 214baa0..e9c5e27 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -62,9 +62,9 @@ QHash EffectFactory::audioEffectDescriptions(AbstractAudio switch (type) { case AbstractAudioEffect::EffectAudioEqualizer: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "audio equalizer"), "Audio equalizer."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Audio Equalizer"), "Audio equalizer."); case AbstractAudioEffect::EffectBassBoost: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass boost"), "Bass boost."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass Boost"), "Bass boost."); case AbstractAudioEffect::EffectDistanceAttenuation: return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); case AbstractAudioEffect::EffectEnvironmentalReverb: diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 81ccbe8..1ed9b21 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -708,7 +708,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) { ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), - QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Request canceled", 0, QCoreApplication::UnicodeUTF8)); error.setIsCancellation(true); return error; } @@ -746,7 +746,7 @@ WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) { return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(), - QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Cannot show MIME type", 0, QCoreApplication::UnicodeUTF8)); } WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response) diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index 2973741..942cfd7 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -1351,7 +1351,7 @@ QString QDirModelPrivate::size(const QModelIndex &index) const return QFileSystemModel::tr("%1 MB").arg(QLocale().toString(qreal(bytes) / mb, 'f', 1)); if (bytes >= kb) return QFileSystemModel::tr("%1 KB").arg(QLocale().toString(bytes / kb)); - return QFileSystemModel::tr("%1 bytes").arg(QLocale().toString(bytes)); + return QFileSystemModel::tr("%1 byte(s)").arg(QLocale().toString(bytes)); } QString QDirModelPrivate::type(const QModelIndex &index) const diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index 62fcd4c..8fb605c 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -251,10 +251,10 @@ QString QSslError::errorString() const errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "One of the CA certificates is invalid")); break; case PathLengthExceeded: - errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints pathlength parameter has been exceeded")); + errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints path length parameter has been exceeded")); break; case InvalidPurpose: - errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuited for this purpose")); + errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuitable for this purpose")); break; case CertificateUntrusted: errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is not trusted for this purpose")); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 6f7e55a..743722f 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -324,7 +324,7 @@ init_context: // Check if the certificate matches the private key. if (!q_SSL_CTX_check_private_key(ctx)) { - q->setErrorString(QSslSocket::tr("Private key does not certificate public key, %1").arg(SSL_ERRORSTR())); + q->setErrorString(QSslSocket::tr("Private key does not certify public key, %1").arg(SSL_ERRORSTR())); emit q->error(QAbstractSocket::UnknownSocketError); return false; } diff --git a/src/xmlpatterns/expr/qncnameconstructor_p.h b/src/xmlpatterns/expr/qncnameconstructor_p.h index 6875c48..bbf9726 100644 --- a/src/xmlpatterns/expr/qncnameconstructor_p.h +++ b/src/xmlpatterns/expr/qncnameconstructor_p.h @@ -112,7 +112,7 @@ namespace QPatternist { return QtXmlPatterns::tr("The target name in a processing instruction " "cannot be %1 in any combination of upper " - "and lower case. Therefore, is %2 invalid.") + "and lower case. Therefore, %2 is invalid.") .arg(formatKeyword("xml"), formatKeyword(lexTarget)); } }; diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp index 5894b83..c250d0c 100644 --- a/src/xmlpatterns/parser/qquerytransformparser.cpp +++ b/src/xmlpatterns/parser/qquerytransformparser.cpp @@ -418,7 +418,7 @@ static void registerNamedTemplate(const QXmlName &name, if(e) { - parseInfo->staticContext->error(QtXmlPatterns::tr("A template by name %1 " + parseInfo->staticContext->error(QtXmlPatterns::tr("A template with name %1 " "has already been declared.") .arg(formatKeyword(parseInfo->staticContext->namePool(), name)), @@ -882,7 +882,7 @@ static void variableUnavailable(const QXmlName &variableName, const ParserContext *const parseInfo, const YYLTYPE &location) { - parseInfo->staticContext->error(QtXmlPatterns::tr("No variable by name %1 exists") + parseInfo->staticContext->error(QtXmlPatterns::tr("No variable with name %1 exists") .arg(formatKeyword(parseInfo->staticContext->namePool(), variableName)), ReportContext::XPST0008, fromYYLTYPE(location, parseInfo)); } @@ -4028,7 +4028,7 @@ yyreduce: const AtomicValue::Ptr val(Decimal::fromLexical((yyvsp[(2) - (2)].sval))); if(val->hasError()) { - parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must of type %2, which %3 isn't.") + parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must be of type %2, which %3 isn't.") .arg(formatKeyword(QLatin1String("priority")), formatType(parseInfo->staticContext->namePool(), BuiltinTypes::xsDecimal), formatData((yyvsp[(2) - (2)].sval))), @@ -4104,7 +4104,7 @@ yyreduce: else if ((yyvsp[(5) - (7)].sval) == CommonNamespaces::XML || (yyvsp[(3) - (7)].sval) == QLatin1String("xml")) { parseInfo->staticContext->error(QtXmlPatterns::tr( - "The prefix %1 can not be bound. By default, it is already bound " + "The prefix %1 cannot be bound. By default, it is already bound " "to the namespace %2.") .arg(formatKeyword("xml")) .arg(formatURI(CommonNamespaces::XML)), @@ -4415,7 +4415,7 @@ yyreduce: allowedIn(QXmlQuery::XQuery10, parseInfo, (yyloc), (yyvsp[(3) - (9)].enums.Bool)); if(variableByName((yyvsp[(5) - (9)].qName), parseInfo)) { - parseInfo->staticContext->error(QtXmlPatterns::tr("A variable by name %1 has already " + parseInfo->staticContext->error(QtXmlPatterns::tr("A variable with name %1 has already " "been declared.") .arg(formatKeyword(parseInfo->staticContext->namePool()->toLexical((yyvsp[(5) - (9)].qName)))), parseInfo->isXSLT() ? ReportContext::XTSE0630 : ReportContext::XQST0049, @@ -4455,7 +4455,7 @@ yyreduce: else { parseInfo->staticContext->error(QtXmlPatterns::tr("No value is available for the external " - "variable by name %1.") + "variable with name %1.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(5) - (9)].qName))), parseInfo->isXSLT() ? ReportContext::XTDE0050 : ReportContext::XPDY0002, fromYYLTYPE((yyloc), parseInfo)); @@ -4674,7 +4674,7 @@ yyreduce: { if((*it)->name() == (yyvsp[(3) - (3)].functionArgument)->name()) { - parseInfo->staticContext->error(QtXmlPatterns::tr("An argument by name %1 has already " + parseInfo->staticContext->error(QtXmlPatterns::tr("An argument with name %1 has already " "been declared. Every argument name " "must be unique.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(3) - (3)].functionArgument)->name())), @@ -6679,7 +6679,7 @@ yyreduce: (yyval.expr) = create(func, (yyloc), parseInfo); else { - parseInfo->staticContext->error(QtXmlPatterns::tr("No function by name %1 is available.") + parseInfo->staticContext->error(QtXmlPatterns::tr("No function with name %1 is available.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(1) - (4)].qName))), ReportContext::XPST0017, fromYYLTYPE((yyloc), parseInfo)); } @@ -6929,7 +6929,7 @@ yyreduce: &ryy, true); if(declaredAttributes.contains(att)) { - parseInfo->staticContext->error(QtXmlPatterns::tr("An attribute by name %1 has already appeared on this element.") + parseInfo->staticContext->error(QtXmlPatterns::tr("An attribute with name %1 has already appeared on this element.") .arg(formatKeyword(parseInfo->staticContext->namePool(), att)), ReportContext::XQST0040, fromYYLTYPE((yyloc), parseInfo)); diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp index e9f32c2..7813808 100644 --- a/src/xmlpatterns/schema/qxsdschemahelper.cpp +++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp @@ -727,7 +727,7 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis } } else { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exists in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exist in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp index 41c6b82..beb28bb 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser.cpp +++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp @@ -5959,7 +5959,7 @@ void XsdSchemaParser::validateIdAttribute(const char *elementName) attributeContentError("id", elementName, value, BuiltinTypes::xsID); } else { if (m_idCache->hasId(value)) { - error(QtXmlPatterns::tr("Component with id %1 has been defined previously.").arg(formatData(value))); + error(QtXmlPatterns::tr("Component with ID %1 has been defined previously.").arg(formatData(value))); } else { m_idCache->addId(value); } diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp index fda3548..622a39f 100644 --- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp +++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp @@ -469,7 +469,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara // 3.2.3.2 if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { - error(QtXmlPatterns::tr("Fixed value constrained not allowed if element is nillable.")); + error(QtXmlPatterns::tr("Fixed value constraint not allowed if element is nillable.")); return false; } } @@ -699,7 +699,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->contentType()->variety() == XsdComplexType::ContentType::Mixed) { if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (hasChildElement()) { - error(QtXmlPatterns::tr("Element %1 can not contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 cannot contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } -- cgit v0.12