summaryrefslogtreecommitdiff
path: root/src/linguist/shared/simtexth.h
diff options
context:
space:
mode:
authorJosep Llodrà <jlg.hrtc@gmail.com>2018-03-29 15:52:51 +0200
committerJosep Llodrà Grimalt <jlg.hrtc@gmail.com>2018-04-09 22:39:40 +0000
commit04e7f6668dae79a402e2c2ff2f415a90399b295f (patch)
tree2a5b89b3e66a65c81cf89f6a2b7a6ffb86b634e8 /src/linguist/shared/simtexth.h
parente96c1bf0da93d3448d09d2364a910e4d784d5723 (diff)
downloadqttools-04e7f6668dae79a402e2c2ff2f415a90399b295f.tar.gz
linguist: Show context in guesses
Context for each Guess entry from "Phrases and guesses" is shown. This is quite convenient since context provides valuable information. Same source phrase could be in different contexts and the translation for each of them can be potentially different. For example, it would be useful in this situation (English-Spanish): Source phrase | Translation | Definition Add Añadir Guess from 'ButtonToolbar' (Ctrl+1) Add Sumar Guess from 'CalculatorDialog' (Ctrl+2) Addition: Ampliación: Guess from 'SizeEditorDisplay' (Ctrl+3) This is more helpful than: Source phrase | Translation | Definition Add Añadir Guess (Ctrl+1) Add Sumar Guess (Ctrl+2) Addition: Ampliación: Guess (Ctrl+3) Change-Id: I0b77cef0ea5fef95400ea60758cb0a96862e5bef Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/linguist/shared/simtexth.h')
-rw-r--r--src/linguist/shared/simtexth.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/linguist/shared/simtexth.h b/src/linguist/shared/simtexth.h
index 997867f30..0ba8f2e51 100644
--- a/src/linguist/shared/simtexth.h
+++ b/src/linguist/shared/simtexth.h
@@ -41,16 +41,17 @@ class Translator;
struct Candidate
{
Candidate() {}
- Candidate(const QString& source0, const QString &target0)
- : source(source0), target(target0)
+ Candidate(const QString& source0, const QString &target0, const QString &context0)
+ : source(source0), target(target0), context(context0)
{}
QString source;
QString target;
+ QString context;
};
inline bool operator==( const Candidate& c, const Candidate& d ) {
- return c.target == d.target && c.source == d.source;
+ return c.target == d.target && c.source == d.source && c.context == d.context;
}
inline bool operator!=( const Candidate& c, const Candidate& d ) {
return !operator==( c, d );