Juergen Spitzmueller wrote:

> Juergen Spitzmueller wrote:
>> Jean-Marc Lasgouttes wrote:
>> > Except that I do not think this requires to create a vector. But I may
>> > be mistaken.
>>
>> No, you're right. I'm just about to implement this.
> 
> Attached.

+string const getGuiName(string const & type, Buffer const & buffer)
 {
     FloatList const & floats =
         buffer.params().getLyXTextClass().floats();
-    if (floats.typeExist(cmdName))
-        return _(floats.getType(cmdName).name());
+    if (floats.typeExist(type))
+        return floats.getType(type).name();
+    else if (type == "TOC")
+        return "Table of Contents";
     else
-        return getType(cmdName);
+        return type;
 }

Why is "Table of Contents" not translated? I guess that this question stems
from my disbelief that you don't translate these strings until you get to
QToc.C, etc.

toc.h: (added "@c" for doxygen).
+/// Returns the guiname from a given @c type
+std::string const getGuiName(std::string const & type, Buffer const &);

frontends/controllers/ControlToc.h:
-    /// Return the guiname from a given cmdName of the TOC param
-    std::string const getGuiName() const;
+    /// Return the guiname from a given @c type of the TOC param
+    std::string const getGuiName(std::string const & type) const;

frontends/gtk/GToc.C: (Jésus Christos!) Why not translate the name in
getGuiName and be done with it?
+    string const & guiname = _(controller().getGuiName(*it));

frontends/qt2/QToc.C, frontends/xforms/FormToc.C: ditto.

Angus

-- 
Angus

Reply via email to