Use plural form for resolution change message, fixes #2219. ALso fix crash in tinygettext code handling plural forms

This commit is contained in:
Marianne Gagnon 2015-06-22 19:26:20 -04:00
parent ae18901bb2
commit 0fdc7a2d98
2 changed files with 5 additions and 3 deletions

View File

@ -78,8 +78,10 @@ bool ConfirmResolutionDialog::onEscapePressed()
void ConfirmResolutionDialog::updateMessage()
{
//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");
countdown_message->setText( msg.c_str(), false );

View File

@ -63,10 +63,10 @@ std::string
Dictionary::translate_plural(const Entries& dict, const std::string& msgid, const std::string& msgid_plural, int count)
{
Entries::const_iterator i = dict.find(msgid);
const std::vector<std::string>& msgstrs = i->second;
if (i != dict.end())
{
const std::vector<std::string>& msgstrs = i->second;
unsigned int n = 0;
n = plural_forms.get_plural(count);
assert(/*n >= 0 &&*/ n < msgstrs.size());