]> git.lyx.org Git - features.git/commitdiff
convert more GUI strings to docstring
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 22 Dec 2006 10:06:40 +0000 (10:06 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 22 Dec 2006 10:06:40 +0000 (10:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16377 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/LColor.C
src/LColor.h
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlExternal.h
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlGraphics.h
src/frontends/controllers/ControlToc.C
src/frontends/controllers/ControlToc.h
src/frontends/controllers/character.C
src/frontends/controllers/character.h
src/frontends/qt4/QGraphics.C
src/frontends/qt4/QParagraph.C

index 18f2a0fbd5282b4b183e420708893356fd9030e3..1288b1d9d3f1c201741ed43ed2b806dad29a800d 100644 (file)
@@ -250,12 +250,14 @@ bool LColor::setColor(string const & lyxname, string const &x11name)
 }
 
 
-LColor::color LColor::getFromGUIName(string const & guiname) const
+LColor::color LColor::getFromGUIName(docstring const & guiname) const
 {
        Pimpl::InfoTab::const_iterator it = pimpl_->infotab.begin();
        Pimpl::InfoTab::const_iterator end = pimpl_->infotab.end();
        for (; it != end; ++it) {
-               if (!compare_ascii_no_case(to_utf8(_(it->second.guiname)), guiname))
+               // FIXME comparison of translated strings is problematic,
+               // and compare_ascii_no_case is probably not correct
+               if (!compare_ascii_no_case(_(it->second.guiname), guiname))
                        return it->first;
        }
        return LColor::inherit;
index d11b291ecbc83957c1e50c077e14c90e59632f66..e76de4536061005c482198480030ab9949c9cb5b 100644 (file)
@@ -216,7 +216,7 @@ public:
        std::string const getLyXName(LColor::color c) const;
 
        /// \returns the LColor::color associated with the GUI name.
-       LColor::color getFromGUIName(std::string const & guiname) const;
+       LColor::color getFromGUIName(docstring const & guiname) const;
        /// \returns the LColor::color associated with the LyX name.
        LColor::color getFromLyXName(std::string const & lyxname) const;
        /// \returns the LColor::color associated with the LaTeX name.
index 2fc9eb107dd6cf28f6c51e9d24cdc198d70da46d..fccc440c59e05d2dd375ed70450557ce9ff509a5 100644 (file)
@@ -245,9 +245,9 @@ vector<RotationDataType> const & all_origins()
        return origins;
 }
 
-string const origin_gui_str(size_type i)
+docstring const origin_gui_str(size_type i)
 {
-       return lyx::to_utf8(_(origin_gui_strs[i]));
+       return _(origin_gui_strs[i]);
 }
 
 } // namespace external
index 6d9d7dff3f06ac80aab772be1769f2ca724f3526..432924c02e944d5bb0bc04197d823767e97c5b07 100644 (file)
@@ -88,7 +88,7 @@ private:
 namespace external {
 
 std::vector<RotationDataType> const & all_origins();
-std::string const origin_gui_str(size_type i);
+docstring const origin_gui_str(size_type i);
 
 } // namespace external
 } // namespace lyx
index a1b90cd20b864e46f02ffee755b55d0aaa96bf1b..72ae744b7eb6ed9a817f8cd94758c54d23a127b5 100644 (file)
@@ -191,8 +191,7 @@ vector<RotationOriginPair> getRotationOriginData()
 
        data.resize(rorigin_size);
        for (size_type i = 0; i < rorigin_size; ++i) {
-               // FIXME UNICODE
-               data[i] = make_pair(lyx::to_utf8(_(rorigin_gui_strs[i])),
+               data[i] = make_pair(_(rorigin_gui_strs[i]),
                                    rorigin_lyx_strs[i]);
        }
 
index d0844e9a49815c557a38da4039f85c8d618ebadf..a668943ca38cf3fac6ec7f5702e91f2da744daed 100644 (file)
@@ -70,7 +70,7 @@ private:
 std::vector<std::string> const getBBUnits();
 
 /// The (tranlated) GUI std::string and it's LaTeX equivalent.
-typedef std::pair<std::string, std::string> RotationOriginPair;
+typedef std::pair<docstring, std::string> RotationOriginPair;
 ///
 std::vector<RotationOriginPair> getRotationOriginData();
 
index 08018b820c2480301d4c4fc0571a893bb4d05614..a3c099be929a854e04c2b40238ae49ed41fee9a6 100644 (file)
@@ -93,17 +93,17 @@ TocIterator const ControlToc::getCurrentTocItem(
 }
 
 
-string const ControlToc::getGuiName(string const & type) const
+docstring const ControlToc::getGuiName(string const & type) const
 {
        if (type == "tableofcontents")
-               return lyx::to_utf8(_("Table of Contents"));
+               return _("Table of Contents");
 
        FloatList const & floats =
                kernel().buffer().params().getLyXTextClass().floats();
        if (floats.typeExist(type))
-               return floats.getType(type).name();
+               return from_utf8(floats.getType(type).name());
        else
-               return lyx::to_utf8(_(type));
+               return _(type);
 }
 
 
index 58f1396ba44625e3dfe550778d55ea9af15c0cb5..9f30415154417fb00b20de4a67bf0dec5c53bc0c 100644 (file)
@@ -35,7 +35,7 @@ public:
        std::vector<std::string> const & getTypes() const;
 
        /// Return the guiname from a given cmdName of the TOC param
-       std::string const getGuiName(std::string const & type) const;
+       docstring const getGuiName(std::string const & type) const;
 
        /// Return the first TocItem before the cursor
        TocIterator const getCurrentTocItem(std::string const & type) const;
index a39e435a10a38db85f0753f62bdc0abccea88b7a..d13387cf66046e49c36cadd522cd41b2f35142ad 100644 (file)
@@ -26,23 +26,23 @@ vector<FamilyPair> const getFamilyData()
 
        FamilyPair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = LyXFont::IGNORE_FAMILY;
        family[0] = pr;
 
-       pr.first = lyx::to_utf8(_("Roman"));
+       pr.first = _("Roman");
        pr.second = LyXFont::ROMAN_FAMILY;
        family[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Sans Serif"));
+       pr.first = _("Sans Serif");
        pr.second = LyXFont::SANS_FAMILY;
        family[2] = pr;
 
-       pr.first = lyx::to_utf8(_("Typewriter"));
+       pr.first = _("Typewriter");
        pr.second = LyXFont::TYPEWRITER_FAMILY;
        family[3] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = LyXFont::INHERIT_FAMILY;
        family[4] = pr;
 
@@ -56,19 +56,19 @@ vector<SeriesPair> const getSeriesData()
 
        SeriesPair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = LyXFont::IGNORE_SERIES;
        series[0] = pr;
 
-       pr.first = lyx::to_utf8(_("Medium"));
+       pr.first = _("Medium");
        pr.second = LyXFont::MEDIUM_SERIES;
        series[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Bold"));
+       pr.first = _("Bold");
        pr.second = LyXFont::BOLD_SERIES;
        series[2] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = LyXFont::INHERIT_SERIES;
        series[3] = pr;
 
@@ -82,27 +82,27 @@ vector<ShapePair> const getShapeData()
 
        ShapePair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = LyXFont::IGNORE_SHAPE;
        shape[0] = pr;
 
-       pr.first = lyx::to_utf8(_("Upright"));
+       pr.first = _("Upright");
        pr.second = LyXFont::UP_SHAPE;
        shape[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Italic"));
+       pr.first = _("Italic");
        pr.second = LyXFont::ITALIC_SHAPE;
        shape[2] = pr;
 
-       pr.first = lyx::to_utf8(_("Slanted"));
+       pr.first = _("Slanted");
        pr.second = LyXFont::SLANTED_SHAPE;
        shape[3] = pr;
 
-       pr.first = lyx::to_utf8(_("Small Caps"));
+       pr.first = _("Small Caps");
        pr.second = LyXFont::SMALLCAPS_SHAPE;
        shape[4] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = LyXFont::INHERIT_SHAPE;
        shape[5] = pr;
 
@@ -116,59 +116,59 @@ vector<SizePair> const getSizeData()
 
        SizePair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = LyXFont::IGNORE_SIZE;
        size[0] = pr;
 
-       pr.first = lyx::to_utf8(_("Tiny"));
+       pr.first = _("Tiny");
        pr.second = LyXFont::SIZE_TINY;
        size[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Smallest"));
+       pr.first = _("Smallest");
        pr.second = LyXFont::SIZE_SCRIPT;
        size[2] = pr;
 
-       pr.first = lyx::to_utf8(_("Smaller"));
+       pr.first = _("Smaller");
        pr.second = LyXFont::SIZE_FOOTNOTE;
        size[3] = pr;
 
-       pr.first = lyx::to_utf8(_("Small"));
+       pr.first = _("Small");
        pr.second = LyXFont::SIZE_SMALL;
        size[4] = pr;
 
-       pr.first = lyx::to_utf8(_("Normal"));
+       pr.first = _("Normal");
        pr.second = LyXFont::SIZE_NORMAL;
        size[5] = pr;
 
-       pr.first = lyx::to_utf8(_("Large"));
+       pr.first = _("Large");
        pr.second = LyXFont::SIZE_LARGE;
        size[6] = pr;
 
-       pr.first = lyx::to_utf8(_("Larger"));
+       pr.first = _("Larger");
        pr.second = LyXFont::SIZE_LARGER;
        size[7] = pr;
 
-       pr.first = lyx::to_utf8(_("Largest"));
+       pr.first = _("Largest");
        pr.second = LyXFont::SIZE_LARGEST;
        size[8] = pr;
 
-       pr.first = lyx::to_utf8(_("Huge"));
+       pr.first = _("Huge");
        pr.second = LyXFont::SIZE_HUGE;
        size[9] = pr;
 
-       pr.first = lyx::to_utf8(_("Huger"));
+       pr.first = _("Huger");
        pr.second = LyXFont::SIZE_HUGER;
        size[10] = pr;
 
-       pr.first = lyx::to_utf8(_("Increase"));
+       pr.first = _("Increase");
        pr.second = LyXFont::INCREASE_SIZE;
        size[11] = pr;
 
-       pr.first = lyx::to_utf8(_("Decrease"));
+       pr.first = _("Decrease");
        pr.second = LyXFont::DECREASE_SIZE;
        size[12] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = LyXFont::INHERIT_SIZE;
        size[13] = pr;
 
@@ -182,23 +182,23 @@ vector<BarPair> const getBarData()
 
        BarPair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = IGNORE;
        bar[0] = pr;
 
-       pr.first = lyx::to_utf8(_("Emph"));
+       pr.first = _("Emph");
        pr.second = EMPH_TOGGLE;
        bar[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Underbar"));
+       pr.first = _("Underbar");
        pr.second = UNDERBAR_TOGGLE;
        bar[2] = pr;
 
-       pr.first = lyx::to_utf8(_("Noun"));
+       pr.first = _("Noun");
        pr.second = NOUN_TOGGLE;
        bar[3] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = INHERIT;
        bar[4] = pr;
 
@@ -212,47 +212,47 @@ vector<ColorPair> const getColorData()
 
        ColorPair pr;
 
-       pr.first = lyx::to_utf8(_("No change"));
+       pr.first = _("No change");
        pr.second = LColor::ignore;
        color[0] = pr;
 
-       pr.first = lyx::to_utf8(_("No color"));
+       pr.first = _("No color");
        pr.second = LColor::none;
        color[1] = pr;
 
-       pr.first = lyx::to_utf8(_("Black"));
+       pr.first = _("Black");
        pr.second = LColor::black;
        color[2] = pr;
 
-       pr.first = lyx::to_utf8(_("White"));
+       pr.first = _("White");
        pr.second = LColor::white;
        color[3] = pr;
 
-       pr.first = lyx::to_utf8(_("Red"));
+       pr.first = _("Red");
        pr.second = LColor::red;
        color[4] = pr;
 
-       pr.first = lyx::to_utf8(_("Green"));
+       pr.first = _("Green");
        pr.second = LColor::green;
        color[5] = pr;
 
-       pr.first = lyx::to_utf8(_("Blue"));
+       pr.first = _("Blue");
        pr.second = LColor::blue;
        color[6] = pr;
 
-       pr.first = lyx::to_utf8(_("Cyan"));
+       pr.first = _("Cyan");
        pr.second = LColor::cyan;
        color[7] = pr;
 
-       pr.first = lyx::to_utf8(_("Magenta"));
+       pr.first = _("Magenta");
        pr.second = LColor::magenta;
        color[8] = pr;
 
-       pr.first = lyx::to_utf8(_("Yellow"));
+       pr.first = _("Yellow");
        pr.second = LColor::yellow;
        color[9] = pr;
 
-       pr.first = lyx::to_utf8(_("Reset"));
+       pr.first = _("Reset");
        pr.second = LColor::inherit;
        color[10] = pr;
 
index 9e4f2cc79e3f08a4aa2267515d5ce1e230c380ba..a63f432aef260ca5d4a80c51cb5bfdf1af7f8ee4 100644 (file)
@@ -41,17 +41,17 @@ enum FONT_STATE {
 };
 
 ///
-typedef std::pair<std::string, LyXFont::FONT_FAMILY> FamilyPair;
+typedef std::pair<docstring, LyXFont::FONT_FAMILY> FamilyPair;
 ///
-typedef std::pair<std::string, LyXFont::FONT_SERIES> SeriesPair;
+typedef std::pair<docstring, LyXFont::FONT_SERIES> SeriesPair;
 ///
-typedef std::pair<std::string, LyXFont::FONT_SHAPE>  ShapePair;
+typedef std::pair<docstring, LyXFont::FONT_SHAPE>  ShapePair;
 ///
-typedef std::pair<std::string, LyXFont::FONT_SIZE>   SizePair;
+typedef std::pair<docstring, LyXFont::FONT_SIZE>   SizePair;
 ///
-typedef std::pair<std::string, FONT_STATE> BarPair;
+typedef std::pair<docstring, FONT_STATE> BarPair;
 ///
-typedef std::pair<std::string, LColor_color> ColorPair;
+typedef std::pair<docstring, LColor_color> ColorPair;
 
 ///
 std::vector<FamilyPair>   const getFamilyData();
index e9b872b131e635a0117f9ab369660f50c708cff1..5de55f52b1ef79899773d39f19a9af21ef2c90e9 100644 (file)
@@ -241,12 +241,11 @@ void QGraphics::update_contents()
 
        dialog_->origin->clear();
 
-       using namespace frontend;
        vector<RotationOriginPair> origindata = getRotationOriginData();
-       vector<string> const origin_lang = getFirst(origindata);
+       vector<docstring> const origin_lang = getFirst(origindata);
        QGraphics::origin_ltx = getSecond(origindata);
 
-       for (vector<string>::const_iterator it = origin_lang.begin();
+       for (vector<docstring>::const_iterator it = origin_lang.begin();
            it != origin_lang.end(); ++it)
                dialog_->origin->addItem(toqstr(*it));
 
index 5c326e06d76bec8cdb23a644b878df7b8fa7d358..1c6d7add91ffd31dd94c3b165de0f4e24fd75713 100644 (file)
@@ -114,7 +114,7 @@ void QParagraph::update_contents()
 
        // label width
        docstring const & labelwidth = params.labelWidthString();
-       // lyx::to_utf8(_() is correct here (this is stupid though !))
+       // FIXME We should not compare translated strings
        if (labelwidth != _("Senseless with this layout!")) {
                dialog_->labelwidthGB->setEnabled(true);
                dialog_->labelWidth->setText(toqstr(labelwidth));