mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
convert more GUI strings to docstring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16377 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
07e76f0911
commit
2caff468e5
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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]);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user