69
69
throw Ts.fallback();
71
71
Ts.setcall("properties", setprops);
73
// ------------------------------
74
// Standard message dialogs come with cookie-cutter "Yes", "No", etc. buttons,
75
// but we can't translate them properly like that.
76
// Instead, attach the proper answers to the message caption/text in the PO,
77
// and then retrieve them in filtering messages for message dialog buttons
78
// in kdelibs4.po (those with context "@action:button filter-...").
80
// Dictionary of answers.
83
// Set answers as key-value pairs, as many as needed.
84
// The call always signals fallback.
85
function setAnswers (/*...*/)
87
if (arguments.length % 2 != 0)
88
throw Error("Answers setter given odd number of arguments.");
90
for (var i = 0; i < arguments.length; i += 2) {
91
var akey = arguments[i];
92
var answer = arguments[i + 1];
93
_answers_[akey] = answer;
98
Ts.setcall("set-answers", setAnswers);
99
// msgid "Blah, blah...?"
101
// "Eh laddy, blah, blah...?"
103
// "$[set-answers no '&Nay!' yes '&Arr!']"
105
// Get an answer by key.
106
// Signals fallback if the answer with the given key is not set.
107
// Deletes the answer from the dictionary, so that it doesn't happen
108
// that it gets retrieved in a later, unrelated question.
109
function getAnswer (akey)
111
answer = _answers_[akey];
112
if (!answer) throw Ts.fallback();
113
delete _answers_[akey];
116
Ts.setcall("get-answer", getAnswer);
117
// msgctxt "@action:button filter-yes"
119
// msgstr "%1|/|$[get-answer yes]"
121
// Reset all answers, so that they don't get used for the wrong question.
122
// Always signals fallback.
123
function resetAnswers ()
127
Ts.setcall("reset-answers", resetAnswers);
128
// msgctxt "@action:button post-filter"
130
// msgstr ".|/|$[reset-answers]"