summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-08 08:38:15 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-08 08:38:15 +0200
commit15394157d0a3303c180e6cf07c9604f12975150b (patch)
treeee397add125f605688d0832af541cec881fbcf57 /src
parent92e96239dca854ef91508873325c0002e118c655 (diff)
parent6db52757d81870fe547d62e677fa0757fd663fcb (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: .qmake.conf Change-Id: I0edaed2aed9e488ba19bc479e37d91db54fd232c
Diffstat (limited to 'src')
-rw-r--r--src/linguist/linguist/doc/src/linguist-manual.qdoc23
-rw-r--r--src/linguist/linguist/messagemodel.cpp4
-rw-r--r--src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc27
3 files changed, 34 insertions, 20 deletions
diff --git a/src/linguist/linguist/doc/src/linguist-manual.qdoc b/src/linguist/linguist/doc/src/linguist-manual.qdoc
index 2b4fe34c2..09726dbd4 100644
--- a/src/linguist/linguist/doc/src/linguist-manual.qdoc
+++ b/src/linguist/linguist/doc/src/linguist-manual.qdoc
@@ -511,17 +511,28 @@
\section2 Changing the Target Locale
- If the target language and country are not explicitly set, \QL deducts them
- from the translation source file name. For example, \c app_de.ts sets the
+ You can set the locale information explicitly in \gui Edit >
+ \gui {Translation File Settings}. If the target language and country
+ are not explicitly set when you open a translation source file, \QL
+ attempts to deduct them from the translation source file name. This
+ requires that the translation files adhere to the following file name
+ convention:
+ \c appname_language[_country].ts, where:
+
+ \list
+ \li \c language is an ISO 639 language code in lowercase.
+ \li \c country is an ISO 3166 two-letter country code in uppercase.
+ \endlist
+
+ If this attempt to resolve the target language and country fails, the
+ \gui {Translation File Settings} window opens.
+
+ 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. For more information, see
\l{linguist-programmers.html}{Developers}.
- If your files do not follow this convention, you can also set the
- locale information explicitly by selecting \gui Edit >
- \gui {Translation File Settings}.
-
\image linguist-translationfilesettings.png
\section1 Selecting Context to Translate
diff --git a/src/linguist/linguist/messagemodel.cpp b/src/linguist/linguist/messagemodel.cpp
index ecaf2109b..bb9bd947a 100644
--- a/src/linguist/linguist/messagemodel.cpp
+++ b/src/linguist/linguist/messagemodel.cpp
@@ -275,8 +275,8 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent
if (lang.isEmpty()) {
lang = QFileInfo(fileName).baseName();
int pos = lang.indexOf(QLatin1Char('_'));
- if (pos != -1 && pos + 3 == lang.length())
- lang = fileName.mid(pos + 1);
+ if (pos != -1)
+ lang.remove(0, pos + 1);
else
lang.clear();
*langGuessed = true;
diff --git a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
index 09c49b9cb..3ebd0c8de 100644
--- a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
+++ b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
@@ -632,16 +632,19 @@
\previouspage Getting Started with QDoc
\nextpage Creating QDoc Configuration Files
- As of this writing, the decision of whether to use static or dynamic
- linking of libclang has not been made. The most likely outcome will be
- to include libclang in the binary packages with QDoc and have the installer
- put libclang in the same directory used for Creator's libclang. It is
- hoped that both Creator and QDoc will eventually use the same version of
- libclang, but as of this writing, QDoc might require a later version of
- libclang than is required for Creator.
-
- As of this writing, users wishing to build and/or run QDoc must install
- \l{http://clang.llvm.org}{LLVM 3.9} or greater and set the variable
- LLVM_INSTALL_DIR accordingly. The pre-built binaries needed can be
- found \l {http://releases.llvm.org/download.html}{here}.
+ If you are going to build QDoc from source, the following prerequisites
+ apply:
+
+ \list 1
+ \li Install \l{http://clang.llvm.org}{LLVM 3.9} or greater.
+ The pre-built binaries needed can be found
+ \l {http://releases.llvm.org/download.html}{here}.
+ \li Set the environment variable \c LLVM_INSTALL_DIR to point to the
+ directory where LLVM is installed. This should be the top level
+ directory. For example, on a Linux system with LLVM installed to
+ \c /usr/llvm:
+ \badcode
+ $ export LLVM_INSTALL_DIR=/usr/llvm
+ \endcode
+ \endlist
*/