Abdelrazak Younes schrieb:
Modified: lyx-devel/trunk/src/Buffer.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/Buffer.cpp?rev=18143
==============================================================================
--- lyx-devel/trunk/src/Buffer.cpp (original)
+++ lyx-devel/trunk/src/Buffer.cpp Tue May 1 10:26:40 2007
@@ -1451,11 +1451,7 @@
docstring const Buffer::B_(string const & l10n) const
{
- Language const * lang = pimpl_->params.language;
- if (lang)
- return getMessages(lang->code()).get(l10n);
-
- return _(l10n);
+ return params().B_(l10n);
}
If you want to transfer the translation method to BufferParams, you
should also remove this one.
We translate to the buffer language, thus the buffer itself should offer
B_, too. Don't you think so? If we drop this method, I have to write
"buf.params().B_(...)" rather than "buf.B_(...)" all over the place.
+docstring const BufferParams::B_(string const & l10n) const
+{
+ BOOST_ASSERT(language);
+ return getMessages(language->code()).get(l10n);
+}
Are we sure that language is always set? In the original Buffer::B_
language is checked for nullity. I think you should keep this test.
Hmmm... initially, the buffer language is set to the default language
(=> Language.cpp). AFAICS, it is always defined as long as there is at
least one language available (which should always be the case, otherwise
we should be in great trouble).
Michael