From: Angus Leeming Date: Fri, 26 Apr 2002 15:38:15 +0000 (+0000) Subject: Translate labels for float:algorithm, float:figure and float:table. X-Git-Tag: 1.6.10~19328 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1a5a664e4445534aa6e7212408bbbdd64af9d78e;p=features.git Translate labels for float:algorithm, float:figure and float:table. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4079 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 646f0487aa..2f85856551 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-04-26 Angus Leeming + + * insetfloat.C (c-tor, wide): translate the name of the float. + 2002-04-22 Angus Leeming * insetcite.[Ch]: take Herbert's patch to give WYSIWYG citation labels diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 7037a3801b..369efd9808 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -99,11 +99,25 @@ using std::endl; // // Lgb +namespace { + +string floatname(string const & type) +{ + FloatList::const_iterator it = floatList[type]; + if (it == floatList.end()) + return type; + + return _(it->second.name()); +} + +} // namespace anon + + InsetFloat::InsetFloat(BufferParams const & bp, string const & type) : InsetCollapsable(bp), wide_(false) { - string lab(_("float:")); - lab += type; + string lab(_("float: ")); + lab += floatname(type); setLabel(lab); LyXFont font(LyXFont::ALL_SANE); font.decSize(); @@ -294,16 +308,14 @@ string const & InsetFloat::placement() const void InsetFloat::wide(bool w) { wide_ = w; - if (wide_) { - string lab(_("float:")); - lab += floatType_; + + string lab(_("float:")); + lab += floatname(floatType_); + + if (wide_) lab += "*"; - setLabel(lab); - } else { - string lab(_("float:")); - lab += floatType_; - setLabel(lab); - } + + setLabel(lab); }