break;
}
- // After we have read a file, we must ensure that the buffer
- // language is set and used in the gui.
- // If you know of a better place to put this, please tell me. (Lgb)
- updateDocLang(params().language);
-
return true;
}
if (readFile(lex, filename) != success)
return false;
- // After we have read a file, we must ensure that the buffer
- // language is set and used in the gui.
- // If you know of a better place to put this, please tell me. (Lgb)
- updateDocLang(params().language);
-
return true;
}
BOOST_ASSERT(from);
BOOST_ASSERT(to);
- // Take care of l10n/i18n
- updateDocLang(to);
-
for_each(par_iterator_begin(),
par_iterator_end(),
bind(&Paragraph::changeLanguage, _1, params(), from, to));
}
-void Buffer::updateDocLang(Language const * nlang)
-{
- BOOST_ASSERT(nlang);
-
- pimpl_->messages = &getMessages(nlang->code());
-}
-
-
bool Buffer::isMultiLingual() const
{
ParConstIterator end = par_iterator_end();
docstring const Buffer::B_(string const & l10n) const
{
- if (pimpl_->messages)
- return pimpl_->messages->get(l10n);
+ Language const * lang = pimpl_->params.language;
+ if (lang)
+ return getMessages(lang->code()).get(l10n);
return _(l10n);
}
if (oldL->rightToLeft() == newL->rightToLeft()
&& !buffer.isMultiLingual())
buffer.changeLanguage(oldL, newL);
- else
- buffer.updateDocLang(newL);
break;
}