Use plural form for resolution change message, fixes #2219. ALso fix crash in tinygettext code handling plural forms
This commit is contained in:
parent
ae18901bb2
commit
0fdc7a2d98
@ -78,8 +78,10 @@ bool ConfirmResolutionDialog::onEscapePressed()
|
|||||||
void ConfirmResolutionDialog::updateMessage()
|
void ConfirmResolutionDialog::updateMessage()
|
||||||
{
|
{
|
||||||
//I18N: In the 'confirm resolution' dialog, that's shown when switching resoluton
|
//I18N: In the 'confirm resolution' dialog, that's shown when switching resoluton
|
||||||
stringw msg = _("Confirm resolution within %i seconds", (int)m_remaining_time);
|
|
||||||
//Log::info("ConfirmResolutionDialog", "stringc(msg.c_str()).c_str());
|
stringw msg = _P("Confirm resolution within %i second",
|
||||||
|
"Confirm resolution within %i seconds",
|
||||||
|
(int)m_remaining_time);
|
||||||
|
|
||||||
LabelWidget* countdown_message = getWidget<LabelWidget>("title");
|
LabelWidget* countdown_message = getWidget<LabelWidget>("title");
|
||||||
countdown_message->setText( msg.c_str(), false );
|
countdown_message->setText( msg.c_str(), false );
|
||||||
|
@ -63,10 +63,10 @@ std::string
|
|||||||
Dictionary::translate_plural(const Entries& dict, const std::string& msgid, const std::string& msgid_plural, int count)
|
Dictionary::translate_plural(const Entries& dict, const std::string& msgid, const std::string& msgid_plural, int count)
|
||||||
{
|
{
|
||||||
Entries::const_iterator i = dict.find(msgid);
|
Entries::const_iterator i = dict.find(msgid);
|
||||||
const std::vector<std::string>& msgstrs = i->second;
|
|
||||||
|
|
||||||
if (i != dict.end())
|
if (i != dict.end())
|
||||||
{
|
{
|
||||||
|
const std::vector<std::string>& msgstrs = i->second;
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
n = plural_forms.get_plural(count);
|
n = plural_forms.get_plural(count);
|
||||||
assert(/*n >= 0 &&*/ n < msgstrs.size());
|
assert(/*n >= 0 &&*/ n < msgstrs.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user