]> git.lyx.org Git - features.git/commitdiff
Translate labels for float:algorithm, float:figure and float:table.
authorAngus Leeming <leeming@lyx.org>
Fri, 26 Apr 2002 15:38:15 +0000 (15:38 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 26 Apr 2002 15:38:15 +0000 (15:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4079 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetfloat.C

index 646f0487aa8535f3fe341f3446e79c080b0ace98..2f858565510d3fffad0e04b152935c224709d569 100644 (file)
@@ -1,3 +1,7 @@
+2002-04-26  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * insetfloat.C (c-tor, wide): translate the name of the float.
+
 2002-04-22  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * insetcite.[Ch]: take Herbert's patch to give WYSIWYG citation labels
index 7037a3801bc316441cf784cdeb750b190bc2d6a6..369efd9808a432713b9e474680e708dde7d4edee 100644 (file)
@@ -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);
 }